Skip to content

Commit e54f4ad

Browse files
authored
Add protos as an artifact to library (#7205)
1 parent 2fc01cb commit e54f4ad

17 files changed

+2770
-5
lines changed

packages/google-cloud-monitoring/google/cloud/monitoring_v3/proto/alert.proto

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

0 commit comments

Comments
 (0)