alertcenter.proto 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. // Copyright 2021 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.apps.alertcenter.v1beta1;
  16. import "google/api/annotations.proto";
  17. import "google/api/field_behavior.proto";
  18. import "google/protobuf/any.proto";
  19. import "google/protobuf/empty.proto";
  20. import "google/protobuf/timestamp.proto";
  21. import "google/rpc/status.proto";
  22. import "google/api/client.proto";
  23. option csharp_namespace = "Google.Apps.AlertCenter.V1Beta1";
  24. option go_package = "google.golang.org/genproto/googleapis/apps/alertcenter/v1beta1;alertcenter";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "AlertCenterProto";
  27. option java_package = "com.google.apps.alertcenter.v1beta1";
  28. option objc_class_prefix = "GAIC";
  29. option php_namespace = "Google\\Apps\\AlertCenter\\V1beta1";
  30. option ruby_package = "Google::Apps::AlertCenter::V1beta1";
  31. // Google Workspace Alert Center API (beta).
  32. service AlertCenterService {
  33. option (google.api.default_host) = "alertcenter.googleapis.com";
  34. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/apps.alerts";
  35. // Lists the alerts.
  36. rpc ListAlerts(ListAlertsRequest) returns (ListAlertsResponse) {
  37. option (google.api.http) = {
  38. get: "/v1beta1/alerts"
  39. };
  40. }
  41. // Gets the specified alert. Attempting to get a nonexistent alert returns
  42. // `NOT_FOUND` error.
  43. rpc GetAlert(GetAlertRequest) returns (Alert) {
  44. option (google.api.http) = {
  45. get: "/v1beta1/alerts/{alert_id}"
  46. };
  47. }
  48. // Marks the specified alert for deletion. An alert that has been marked for
  49. // deletion is removed from Alert Center after 30 days.
  50. // Marking an alert for deletion has no effect on an alert which has
  51. // already been marked for deletion. Attempting to mark a nonexistent alert
  52. // for deletion results in a `NOT_FOUND` error.
  53. rpc DeleteAlert(DeleteAlertRequest) returns (google.protobuf.Empty) {
  54. option (google.api.http) = {
  55. delete: "/v1beta1/alerts/{alert_id}"
  56. };
  57. }
  58. // Restores, or "undeletes", an alert that was marked for deletion within the
  59. // past 30 days. Attempting to undelete an alert which was marked for deletion
  60. // over 30 days ago (which has been removed from the Alert Center database) or
  61. // a nonexistent alert returns a `NOT_FOUND` error. Attempting to
  62. // undelete an alert which has not been marked for deletion has no effect.
  63. rpc UndeleteAlert(UndeleteAlertRequest) returns (Alert) {
  64. option (google.api.http) = {
  65. post: "/v1beta1/alerts/{alert_id}:undelete"
  66. body: "*"
  67. };
  68. }
  69. // Creates new feedback for an alert. Attempting to create a feedback for
  70. // a non-existent alert returns `NOT_FOUND` error. Attempting to create a
  71. // feedback for an alert that is marked for deletion returns
  72. // `FAILED_PRECONDITION' error.
  73. rpc CreateAlertFeedback(CreateAlertFeedbackRequest) returns (AlertFeedback) {
  74. option (google.api.http) = {
  75. post: "/v1beta1/alerts/{alert_id}/feedback"
  76. body: "feedback"
  77. };
  78. }
  79. // Lists all the feedback for an alert. Attempting to list feedbacks for
  80. // a non-existent alert returns `NOT_FOUND` error.
  81. rpc ListAlertFeedback(ListAlertFeedbackRequest) returns (ListAlertFeedbackResponse) {
  82. option (google.api.http) = {
  83. get: "/v1beta1/alerts/{alert_id}/feedback"
  84. };
  85. }
  86. // Returns the metadata of an alert. Attempting to get metadata for
  87. // a non-existent alert returns `NOT_FOUND` error.
  88. rpc GetAlertMetadata(GetAlertMetadataRequest) returns (AlertMetadata) {
  89. option (google.api.http) = {
  90. get: "/v1beta1/alerts/{alert_id}/metadata"
  91. };
  92. }
  93. // Returns customer-level settings.
  94. rpc GetSettings(GetSettingsRequest) returns (Settings) {
  95. option (google.api.http) = {
  96. get: "/v1beta1/settings"
  97. };
  98. }
  99. // Updates the customer-level settings.
  100. rpc UpdateSettings(UpdateSettingsRequest) returns (Settings) {
  101. option (google.api.http) = {
  102. patch: "/v1beta1/settings"
  103. body: "settings"
  104. };
  105. }
  106. // Performs batch delete operation on alerts.
  107. rpc BatchDeleteAlerts(BatchDeleteAlertsRequest) returns (BatchDeleteAlertsResponse) {
  108. option (google.api.http) = {
  109. post: "/v1beta1/alerts:batchDelete"
  110. body: "*"
  111. };
  112. }
  113. // Performs batch undelete operation on alerts.
  114. rpc BatchUndeleteAlerts(BatchUndeleteAlertsRequest) returns (BatchUndeleteAlertsResponse) {
  115. option (google.api.http) = {
  116. post: "/v1beta1/alerts:batchUndelete"
  117. body: "*"
  118. };
  119. }
  120. }
  121. // An alert affecting a customer.
  122. message Alert {
  123. // Output only. The unique identifier of the Google account of the customer.
  124. string customer_id = 1;
  125. // Output only. The unique identifier for the alert.
  126. string alert_id = 2;
  127. // Output only. The time this alert was created.
  128. google.protobuf.Timestamp create_time = 3;
  129. // Required. The time the event that caused this alert was started or
  130. // detected.
  131. google.protobuf.Timestamp start_time = 4;
  132. // Optional. The time the event that caused this alert ceased being active.
  133. // If provided, the end time must not be earlier than the start time.
  134. // If not provided, it indicates an ongoing alert.
  135. google.protobuf.Timestamp end_time = 5;
  136. // Required. The type of the alert.
  137. // This is output only after alert is created.
  138. // For a list of available alert types see
  139. // [Google Workspace Alert
  140. // types](https://developers.google.com/admin-sdk/alertcenter/reference/alert-types).
  141. string type = 6;
  142. // Required. A unique identifier for the system that reported the alert.
  143. // This is output only after alert is created.
  144. //
  145. // Supported sources are any of the following:
  146. //
  147. // * Google Operations
  148. // * Mobile device management
  149. // * Gmail phishing
  150. // * Domain wide takeout
  151. // * State sponsored attack
  152. // * Google identity
  153. string source = 7;
  154. // Optional. The data associated with this alert, for example
  155. // [google.apps.alertcenter.type.DeviceCompromised] [google.apps.alertcenter.type.DeviceCompromised].
  156. google.protobuf.Any data = 8;
  157. // Output only. An optional
  158. // [Security Investigation Tool](https://support.google.com/a/answer/7575955)
  159. // query for this alert.
  160. string security_investigation_tool_link = 9;
  161. // Output only. `True` if this alert is marked for deletion.
  162. bool deleted = 11;
  163. // Output only. The metadata associated with this alert.
  164. AlertMetadata metadata = 12;
  165. // Output only. The time this alert was last updated.
  166. google.protobuf.Timestamp update_time = 13;
  167. // Optional. `etag` is used for optimistic concurrency control as a way to help
  168. // prevent simultaneous updates of an alert from overwriting each other.
  169. // It is strongly suggested that systems make use of the `etag` in the
  170. // read-modify-write cycle to perform alert updates in order to avoid race
  171. // conditions: An `etag` is returned in the response which contains alerts,
  172. // and systems are expected to put that etag in the request to update alert to
  173. // ensure that their change will be applied to the same version of the alert.
  174. //
  175. // If no `etag` is provided in the call to update alert, then the existing
  176. // alert is overwritten blindly.
  177. string etag = 14;
  178. }
  179. // A customer feedback about an alert.
  180. message AlertFeedback {
  181. // Output only. The unique identifier of the Google account of the customer.
  182. string customer_id = 1;
  183. // Output only. The alert identifier.
  184. string alert_id = 2;
  185. // Output only. The unique identifier for the feedback.
  186. string feedback_id = 3;
  187. // Output only. The time this feedback was created.
  188. google.protobuf.Timestamp create_time = 4;
  189. // Required. The type of the feedback.
  190. AlertFeedbackType type = 5;
  191. // Output only. The email of the user that provided the feedback.
  192. string email = 6;
  193. }
  194. // An alert metadata.
  195. message AlertMetadata {
  196. // Output only. The unique identifier of the Google account of the customer.
  197. string customer_id = 1;
  198. // Output only. The alert identifier.
  199. string alert_id = 2;
  200. // The current status of the alert.
  201. // The supported values are the following:
  202. //
  203. // * NOT_STARTED
  204. // * IN_PROGRESS
  205. // * CLOSED
  206. string status = 4;
  207. // The email address of the user assigned to the alert.
  208. string assignee = 5;
  209. // Output only. The time this metadata was last updated.
  210. google.protobuf.Timestamp update_time = 6;
  211. // The severity value of the alert. Alert Center will set this field at alert
  212. // creation time, default's to an empty string when it could not be
  213. // determined.
  214. // The supported values for update actions on this field are the following:
  215. //
  216. // * HIGH
  217. // * MEDIUM
  218. // * LOW
  219. string severity = 7;
  220. // Optional. `etag` is used for optimistic concurrency control as a way to
  221. // help prevent simultaneous updates of an alert metadata from overwriting
  222. // each other. It is strongly suggested that systems make use of the `etag` in
  223. // the read-modify-write cycle to perform metatdata updates in order to avoid
  224. // race conditions: An `etag` is returned in the response which contains alert
  225. // metadata, and systems are expected to put that etag in the request to
  226. // update alert metadata to ensure that their change will be applied to the
  227. // same version of the alert metadata.
  228. //
  229. // If no `etag` is provided in the call to update alert metadata, then the
  230. // existing alert metadata is overwritten blindly.
  231. string etag = 8;
  232. }
  233. // Customer-level settings.
  234. message Settings {
  235. // Settings for callback notifications.
  236. // For more details see [Google Workspace Alert
  237. // Notification](https://developers.google.com/admin-sdk/alertcenter/guides/notifications).
  238. message Notification {
  239. // A reference to a Cloud Pubsub topic.
  240. //
  241. // To register for notifications, the owner of the topic must grant
  242. // `alerts-api-push-notifications@system.gserviceaccount.com` the
  243. // `projects.topics.publish` permission.
  244. message CloudPubsubTopic {
  245. // The `name` field of a Cloud Pubsub [Topic]
  246. // (https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic).
  247. string topic_name = 1;
  248. // Optional. The format of the payload that would be sent.
  249. // If not specified the format will be JSON.
  250. PayloadFormat payload_format = 2;
  251. }
  252. // The format of the payload.
  253. enum PayloadFormat {
  254. // Payload format is not specified (will use JSON as default).
  255. PAYLOAD_FORMAT_UNSPECIFIED = 0;
  256. // Use JSON.
  257. JSON = 1;
  258. }
  259. // Exactly one destination to be specified.
  260. oneof destination {
  261. // A Google Cloud Pub/sub topic destination.
  262. CloudPubsubTopic cloud_pubsub_topic = 1;
  263. }
  264. }
  265. // The list of notifications.
  266. repeated Notification notifications = 1;
  267. }
  268. // A request to perform batch delete on alerts.
  269. message BatchDeleteAlertsRequest {
  270. // Optional. The unique identifier of the Google Workspace organization
  271. // account of the customer the alerts are associated with.
  272. string customer_id = 1;
  273. // Required. list of alert IDs.
  274. repeated string alert_id = 2;
  275. }
  276. // Response to batch delete operation on alerts.
  277. message BatchDeleteAlertsResponse {
  278. // The successful list of alert IDs.
  279. repeated string success_alert_ids = 1;
  280. // The status details for each failed alert_id.
  281. map<string, google.rpc.Status> failed_alert_status = 2;
  282. }
  283. // A request to perform batch undelete on alerts.
  284. message BatchUndeleteAlertsRequest {
  285. // Optional. The unique identifier of the Google Workspace organization
  286. // account of the customer the alerts are associated with.
  287. string customer_id = 1;
  288. // Required. list of alert IDs.
  289. repeated string alert_id = 2;
  290. }
  291. // Response to batch undelete operation on alerts.
  292. message BatchUndeleteAlertsResponse {
  293. // The successful list of alert IDs.
  294. repeated string success_alert_ids = 1;
  295. // The status details for each failed alert_id.
  296. map<string, google.rpc.Status> failed_alert_status = 2;
  297. }
  298. // An alert listing request.
  299. message ListAlertsRequest {
  300. // Optional. The unique identifier of the Google Workspace organization
  301. // account of the customer the alerts are associated with.
  302. // Inferred from the caller identity if not provided.
  303. string customer_id = 1;
  304. // Optional. The requested page size. Server may return fewer items than
  305. // requested. If unspecified, server picks an appropriate default.
  306. int32 page_size = 2;
  307. // Optional. A token identifying a page of results the server should return.
  308. // If empty, a new iteration is started. To continue an iteration, pass in
  309. // the value from the previous ListAlertsResponse's
  310. // [next_page_token][google.apps.alertcenter.v1beta1.ListAlertsResponse.next_page_token] field.
  311. string page_token = 3;
  312. // Optional. A query string for filtering alert results.
  313. // For more details, see [Query
  314. // filters](https://developers.google.com/admin-sdk/alertcenter/guides/query-filters) and [Supported
  315. // query filter
  316. // fields](https://developers.google.com/admin-sdk/alertcenter/reference/filter-fields#alerts.list).
  317. string filter = 4;
  318. // Optional. The sort order of the list results.
  319. // If not specified results may be returned in arbitrary order.
  320. // You can sort the results in descending order based on the creation
  321. // timestamp using `order_by="create_time desc"`.
  322. // Currently, supported sorting are `create_time asc`, `create_time desc`,
  323. // `update_time desc`
  324. string order_by = 5;
  325. }
  326. // Response message for an alert listing request.
  327. message ListAlertsResponse {
  328. // The list of alerts.
  329. repeated Alert alerts = 1;
  330. // The token for the next page. If not empty, indicates that there may be more
  331. // alerts that match the listing request; this value can be used in a
  332. // subsequent [ListAlertsRequest][google.apps.alertcenter.v1beta1.ListAlertsRequest] to get alerts continuing from last result
  333. // of the current list call.
  334. string next_page_token = 2;
  335. }
  336. // Request for a specific alert.
  337. message GetAlertRequest {
  338. // Optional. The unique identifier of the Google Workspace organization
  339. // account of the customer the alert is associated with.
  340. // Inferred from the caller identity if not provided.
  341. string customer_id = 1;
  342. // Required. The identifier of the alert to retrieve.
  343. string alert_id = 2;
  344. }
  345. // A request to mark a specific alert for deletion.
  346. message DeleteAlertRequest {
  347. // Optional. The unique identifier of the Google Workspace organization
  348. // account of the customer the alert is associated with.
  349. // Inferred from the caller identity if not provided.
  350. string customer_id = 1;
  351. // Required. The identifier of the alert to delete.
  352. string alert_id = 2;
  353. }
  354. // A request to undelete a specific alert that was marked for deletion.
  355. message UndeleteAlertRequest {
  356. // Optional. The unique identifier of the Google Workspace organization
  357. // account of the customer the alert is associated with.
  358. // Inferred from the caller identity if not provided.
  359. string customer_id = 1;
  360. // Required. The identifier of the alert to undelete.
  361. string alert_id = 2;
  362. }
  363. // A request to create a new alert feedback.
  364. message CreateAlertFeedbackRequest {
  365. // Optional. The unique identifier of the Google Workspace organization
  366. // account of the customer the alert is associated with.
  367. // Inferred from the caller identity if not provided.
  368. string customer_id = 1;
  369. // Required. The identifier of the alert this feedback belongs to.
  370. string alert_id = 2;
  371. // Required. The new alert feedback to create.
  372. AlertFeedback feedback = 3;
  373. }
  374. // An alert feedback listing request.
  375. message ListAlertFeedbackRequest {
  376. // Optional. The unique identifier of the Google Workspace organization
  377. // account of the customer the alert feedback are associated with.
  378. // Inferred from the caller identity if not provided.
  379. string customer_id = 1;
  380. // Required. The alert identifier.
  381. // The "-" wildcard could be used to represent all alerts.
  382. string alert_id = 2;
  383. // Optional. A query string for filtering alert feedback results.
  384. // For more details, see [Query
  385. // filters](https://developers.google.com/admin-sdk/alertcenter/guides/query-filters) and [Supported
  386. // query filter
  387. // fields](https://developers.google.com/admin-sdk/alertcenter/reference/filter-fields#alerts.feedback.list).
  388. string filter = 3;
  389. }
  390. // Response message for an alert feedback listing request.
  391. message ListAlertFeedbackResponse {
  392. // The list of alert feedback.
  393. // Feedback entries for each alert are ordered by creation time descending.
  394. repeated AlertFeedback feedback = 1;
  395. }
  396. // Get the alert metadata.
  397. message GetAlertMetadataRequest {
  398. // Optional. The unique identifier of the Google Workspace organization
  399. // account of the customer the alert metadata is associated with.
  400. // Inferred from the caller identity if not provided.
  401. string customer_id = 1;
  402. // Required. The identifier of the alert this metadata belongs to.
  403. string alert_id = 2;
  404. }
  405. // Get the customer level settings.
  406. message GetSettingsRequest {
  407. // Optional. The unique identifier of the Google Workspace organization
  408. // account of the customer the alert settings are associated with.
  409. // Inferred from the caller identity if not provided.
  410. string customer_id = 1;
  411. }
  412. // The type of alert feedback.
  413. enum AlertFeedbackType {
  414. // The feedback type is not specified.
  415. ALERT_FEEDBACK_TYPE_UNSPECIFIED = 0;
  416. // The alert report is not useful.
  417. NOT_USEFUL = 1;
  418. // The alert report is somewhat useful.
  419. SOMEWHAT_USEFUL = 2;
  420. // The alert report is very useful.
  421. VERY_USEFUL = 3;
  422. }
  423. // Update the customer level settings.
  424. message UpdateSettingsRequest {
  425. // Optional. The unique identifier of the Google Workspace organization
  426. // account of the customer the alert settings are associated with.
  427. // Inferred from the caller identity if not provided.
  428. string customer_id = 1;
  429. // The customer settings to update.
  430. Settings settings = 2;
  431. }