Built motion from commit 6a09e18b.|2.6.11
[motion2.git] / legacy-libs / google-proto-files / google / monitoring / v3 / alert_service.proto
1 // Copyright 2018 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 //
15
16 syntax = "proto3";
17
18 package google.monitoring.v3;
19
20 import "google/api/annotations.proto";
21 import "google/monitoring/v3/alert.proto";
22 import "google/protobuf/empty.proto";
23 import "google/protobuf/field_mask.proto";
24
25 option csharp_namespace = "Google.Cloud.Monitoring.V3";
26 option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
27 option java_multiple_files = true;
28 option java_outer_classname = "AlertServiceProto";
29 option java_package = "com.google.monitoring.v3";
30 option php_namespace = "Google\\Cloud\\Monitoring\\V3";
31
32 // The AlertPolicyService API is used to manage (list, create, delete,
33 // edit) alert policies in Stackdriver Monitoring. An alerting policy is
34 // a description of the conditions under which some aspect of your
35 // system is considered to be "unhealthy" and the ways to notify
36 // people or services about this state. In addition to using this API, alert
37 // policies can also be managed through
38 // [Stackdriver Monitoring](https://cloud.google.com/monitoring/docs/),
39 // which can be reached by clicking the "Monitoring" tab in
40 // [Cloud Console](https://console.cloud.google.com/).
41 service AlertPolicyService {
42   // Lists the existing alerting policies for the project.
43   rpc ListAlertPolicies(ListAlertPoliciesRequest)
44       returns (ListAlertPoliciesResponse) {
45     option (google.api.http) = {
46       get: "/v3/{name=projects/*}/alertPolicies"
47     };
48   }
49
50   // Gets a single alerting policy.
51   rpc GetAlertPolicy(GetAlertPolicyRequest) returns (AlertPolicy) {
52     option (google.api.http) = {
53       get: "/v3/{name=projects/*/alertPolicies/*}"
54     };
55   }
56
57   // Creates a new alerting policy.
58   rpc CreateAlertPolicy(CreateAlertPolicyRequest) returns (AlertPolicy) {
59     option (google.api.http) = {
60       post: "/v3/{name=projects/*}/alertPolicies"
61       body: "alert_policy"
62     };
63   }
64
65   // Deletes an alerting policy.
66   rpc DeleteAlertPolicy(DeleteAlertPolicyRequest)
67       returns (google.protobuf.Empty) {
68     option (google.api.http) = {
69       delete: "/v3/{name=projects/*/alertPolicies/*}"
70     };
71   }
72
73   // Updates an alerting policy. You can either replace the entire policy with
74   // a new one or replace only certain fields in the current alerting policy by
75   // specifying the fields to be updated via `updateMask`. Returns the
76   // updated alerting policy.
77   rpc UpdateAlertPolicy(UpdateAlertPolicyRequest) returns (AlertPolicy) {
78     option (google.api.http) = {
79       patch: "/v3/{alert_policy.name=projects/*/alertPolicies/*}"
80       body: "alert_policy"
81     };
82   }
83 }
84
85 // The protocol for the `CreateAlertPolicy` request.
86 message CreateAlertPolicyRequest {
87   // The project in which to create the alerting policy. The format is
88   // `projects/[PROJECT_ID]`.
89   //
90   // Note that this field names the parent container in which the alerting
91   // policy will be written, not the name of the created policy. The alerting
92   // policy that is returned will have a name that contains a normalized
93   // representation of this name as a prefix but adds a suffix of the form
94   // `/alertPolicies/[POLICY_ID]`, identifying the policy in the container.
95   string name = 3;
96
97   // The requested alerting policy. You should omit the `name` field in this
98   // policy. The name will be returned in the new policy, including
99   // a new [ALERT_POLICY_ID] value.
100   AlertPolicy alert_policy = 2;
101 }
102
103 // The protocol for the `GetAlertPolicy` request.
104 message GetAlertPolicyRequest {
105   // The alerting policy to retrieve. The format is
106   //
107   //     projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]
108   string name = 3;
109 }
110
111 // The protocol for the `ListAlertPolicies` request.
112 message ListAlertPoliciesRequest {
113   // The project whose alert policies are to be listed. The format is
114   //
115   //     projects/[PROJECT_ID]
116   //
117   // Note that this field names the parent container in which the alerting
118   // policies to be listed are stored. To retrieve a single alerting policy
119   // by name, use the
120   // [GetAlertPolicy][google.monitoring.v3.AlertPolicyService.GetAlertPolicy]
121   // operation, instead.
122   string name = 4;
123
124   // If provided, this field specifies the criteria that must be met by
125   // alert policies to be included in the response.
126   //
127   // For more details, see [sorting and
128   // filtering](/monitoring/api/v3/sorting-and-filtering).
129   string filter = 5;
130
131   // A comma-separated list of fields by which to sort the result. Supports
132   // the same set of field references as the `filter` field. Entries can be
133   // prefixed with a minus sign to sort by the field in descending order.
134   //
135   // For more details, see [sorting and
136   // filtering](/monitoring/api/v3/sorting-and-filtering).
137   string order_by = 6;
138
139   // The maximum number of results to return in a single response.
140   int32 page_size = 2;
141
142   // If this field is not empty then it must contain the `nextPageToken` value
143   // returned by a previous call to this method.  Using this field causes the
144   // method to return more results from the previous method call.
145   string page_token = 3;
146 }
147
148 // The protocol for the `ListAlertPolicies` response.
149 message ListAlertPoliciesResponse {
150   // The returned alert policies.
151   repeated AlertPolicy alert_policies = 3;
152
153   // If there might be more results than were returned, then this field is set
154   // to a non-empty value. To see the additional results,
155   // use that value as `pageToken` in the next call to this method.
156   string next_page_token = 2;
157 }
158
159 // The protocol for the `UpdateAlertPolicy` request.
160 message UpdateAlertPolicyRequest {
161   // Optional. A list of alerting policy field names. If this field is not
162   // empty, each listed field in the existing alerting policy is set to the
163   // value of the corresponding field in the supplied policy (`alert_policy`),
164   // or to the field's default value if the field is not in the supplied
165   // alerting policy.  Fields not listed retain their previous value.
166   //
167   // Examples of valid field masks include `display_name`, `documentation`,
168   // `documentation.content`, `documentation.mime_type`, `user_labels`,
169   // `user_label.nameofkey`, `enabled`, `conditions`, `combiner`, etc.
170   //
171   // If this field is empty, then the supplied alerting policy replaces the
172   // existing policy. It is the same as deleting the existing policy and
173   // adding the supplied policy, except for the following:
174   //
175   // +   The new policy will have the same `[ALERT_POLICY_ID]` as the former
176   //     policy. This gives you continuity with the former policy in your
177   //     notifications and incidents.
178   // +   Conditions in the new policy will keep their former `[CONDITION_ID]` if
179   //     the supplied condition includes the `name` field with that
180   //     `[CONDITION_ID]`. If the supplied condition omits the `name` field,
181   //     then a new `[CONDITION_ID]` is created.
182   google.protobuf.FieldMask update_mask = 2;
183
184   // Required. The updated alerting policy or the updated values for the
185   // fields listed in `update_mask`.
186   // If `update_mask` is not empty, any fields in this policy that are
187   // not in `update_mask` are ignored.
188   AlertPolicy alert_policy = 3;
189 }
190
191 // The protocol for the `DeleteAlertPolicy` request.
192 message DeleteAlertPolicyRequest {
193   // The alerting policy to delete. The format is:
194   //
195   //     projects/[PROJECT_ID]/alertPolicies/[ALERT_POLICY_ID]
196   //
197   // For more information, see [AlertPolicy][google.monitoring.v3.AlertPolicy].
198   string name = 3;
199 }