alertcenter.proto 18 KB

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