group_service.proto
7.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// Copyright 2018 Google LLC.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
syntax = "proto3";
package google.monitoring.v3;
import "google/api/annotations.proto";
import "google/api/monitored_resource.proto";
import "google/monitoring/v3/common.proto";
import "google/monitoring/v3/group.proto";
import "google/protobuf/empty.proto";
option csharp_namespace = "Google.Cloud.Monitoring.V3";
option go_package = "google.golang.org/genproto/googleapis/monitoring/v3;monitoring";
option java_multiple_files = true;
option java_outer_classname = "GroupServiceProto";
option java_package = "com.google.monitoring.v3";
option php_namespace = "Google\\Cloud\\Monitoring\\V3";
// The Group API lets you inspect and manage your
// [groups](#google.monitoring.v3.Group).
//
// A group is a named filter that is used to identify
// a collection of monitored resources. Groups are typically used to
// mirror the physical and/or logical topology of the environment.
// Because group membership is computed dynamically, monitored
// resources that are started in the future are automatically placed
// in matching groups. By using a group to name monitored resources in,
// for example, an alert policy, the target of that alert policy is
// updated automatically as monitored resources are added and removed
// from the infrastructure.
service GroupService {
// Lists the existing groups.
rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse) {
option (google.api.http) = {
get: "/v3/{name=projects/*}/groups"
};
}
// Gets a single group.
rpc GetGroup(GetGroupRequest) returns (Group) {
option (google.api.http) = {
get: "/v3/{name=projects/*/groups/*}"
};
}
// Creates a new group.
rpc CreateGroup(CreateGroupRequest) returns (Group) {
option (google.api.http) = {
post: "/v3/{name=projects/*}/groups"
body: "group"
};
}
// Updates an existing group.
// You can change any group attributes except `name`.
rpc UpdateGroup(UpdateGroupRequest) returns (Group) {
option (google.api.http) = {
put: "/v3/{group.name=projects/*/groups/*}"
body: "group"
};
}
// Deletes an existing group.
rpc DeleteGroup(DeleteGroupRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v3/{name=projects/*/groups/*}"
};
}
// Lists the monitored resources that are members of a group.
rpc ListGroupMembers(ListGroupMembersRequest)
returns (ListGroupMembersResponse) {
option (google.api.http) = {
get: "/v3/{name=projects/*/groups/*}/members"
};
}
}
// The `ListGroup` request.
message ListGroupsRequest {
// The project whose groups are to be listed. The format is
// `"projects/{project_id_or_number}"`.
string name = 7;
// An optional filter consisting of a single group name. The filters limit
// the groups returned based on their parent-child relationship with the
// specified group. If no filter is specified, all groups are returned.
oneof filter {
// A group name: `"projects/{project_id_or_number}/groups/{group_id}"`.
// Returns groups whose `parentName` field contains the group
// name. If no groups have this parent, the results are empty.
string children_of_group = 2;
// A group name: `"projects/{project_id_or_number}/groups/{group_id}"`.
// Returns groups that are ancestors of the specified group.
// The groups are returned in order, starting with the immediate parent and
// ending with the most distant ancestor. If the specified group has no
// immediate parent, the results are empty.
string ancestors_of_group = 3;
// A group name: `"projects/{project_id_or_number}/groups/{group_id}"`.
// Returns the descendants of the specified group. This is a superset of
// the results returned by the `childrenOfGroup` filter, and includes
// children-of-children, and so forth.
string descendants_of_group = 4;
}
// A positive number that is the maximum number of results to return.
int32 page_size = 5;
// If this field is not empty then it must contain the `nextPageToken` value
// returned by a previous call to this method. Using this field causes the
// method to return additional results from the previous method call.
string page_token = 6;
}
// The `ListGroups` response.
message ListGroupsResponse {
// The groups that match the specified filters.
repeated Group group = 1;
// If there are more results than have been returned, then this field is set
// to a non-empty value. To see the additional results,
// use that value as `pageToken` in the next call to this method.
string next_page_token = 2;
}
// The `GetGroup` request.
message GetGroupRequest {
// The group to retrieve. The format is
// `"projects/{project_id_or_number}/groups/{group_id}"`.
string name = 3;
}
// The `CreateGroup` request.
message CreateGroupRequest {
// The project in which to create the group. The format is
// `"projects/{project_id_or_number}"`.
string name = 4;
// A group definition. It is an error to define the `name` field because
// the system assigns the name.
Group group = 2;
// If true, validate this request but do not create the group.
bool validate_only = 3;
}
// The `UpdateGroup` request.
message UpdateGroupRequest {
// The new definition of the group. All fields of the existing group,
// excepting `name`, are replaced with the corresponding fields of this group.
Group group = 2;
// If true, validate this request but do not update the existing group.
bool validate_only = 3;
}
// The `DeleteGroup` request. You can only delete a group if it has no children.
message DeleteGroupRequest {
// The group to delete. The format is
// `"projects/{project_id_or_number}/groups/{group_id}"`.
string name = 3;
}
// The `ListGroupMembers` request.
message ListGroupMembersRequest {
// The group whose members are listed. The format is
// `"projects/{project_id_or_number}/groups/{group_id}"`.
string name = 7;
// A positive number that is the maximum number of results to return.
int32 page_size = 3;
// If this field is not empty then it must contain the `nextPageToken` value
// returned by a previous call to this method. Using this field causes the
// method to return additional results from the previous method call.
string page_token = 4;
// An optional [list filter](/monitoring/api/learn_more#filtering) describing
// the members to be returned. The filter may reference the type, labels, and
// metadata of monitored resources that comprise the group.
// For example, to return only resources representing Compute Engine VM
// instances, use this filter:
//
// resource.type = "gce_instance"
string filter = 5;
// An optional time interval for which results should be returned. Only
// members that were part of the group during the specified interval are
// included in the response. If no interval is provided then the group
// membership over the last minute is returned.
TimeInterval interval = 6;
}
// The `ListGroupMembers` response.
message ListGroupMembersResponse {
// A set of monitored resources in the group.
repeated google.api.MonitoredResource members = 1;
// If there are more results than have been returned, then this field is
// set to a non-empty value. To see the additional results, use that value as
// `pageToken` in the next call to this method.
string next_page_token = 2;
// The total number of elements matching this request.
int32 total_size = 3;
}