group_service.proto 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. // Copyright 2016 Google Inc.
  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.monitoring.v3;
  16. import "google/api/annotations.proto";
  17. import "google/api/monitored_resource.proto";
  18. import "google/monitoring/v3/common.proto";
  19. import "google/monitoring/v3/group.proto";
  20. import "google/protobuf/empty.proto";
  21. option java_multiple_files = true;
  22. option java_outer_classname = "GroupServiceProto";
  23. option java_package = "com.google.monitoring.v3";
  24. // The Group API lets you inspect and manage your
  25. // [groups](google.monitoring.v3.Group).
  26. //
  27. // A group is a named filter that is used to identify
  28. // a collection of monitored resources. Groups are typically used to
  29. // mirror the physical and/or logical topology of the environment.
  30. // Because group membership is computed dynamically, monitored
  31. // resources that are started in the future are automatically placed
  32. // in matching groups. By using a group to name monitored resources in,
  33. // for example, an alert policy, the target of that alert policy is
  34. // updated automatically as monitored resources are added and removed
  35. // from the infrastructure.
  36. service GroupService {
  37. // Lists the existing groups. The project ID in the URL path must refer
  38. // to a Stackdriver account.
  39. rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse) {
  40. option (google.api.http) = { get: "/v3/{name=projects/*}/groups" };
  41. }
  42. // Gets a single group. The project ID in the URL path must refer to a
  43. // Stackdriver account.
  44. rpc GetGroup(GetGroupRequest) returns (Group) {
  45. option (google.api.http) = { get: "/v3/{name=projects/*/groups/*}" };
  46. }
  47. // Creates a new group. The project ID in the URL path must refer to a
  48. // Stackdriver account.
  49. rpc CreateGroup(CreateGroupRequest) returns (Group) {
  50. option (google.api.http) = { post: "/v3/{name=projects/*}/groups", body: "group" };
  51. }
  52. // Updates an existing group.
  53. // You can change any group attributes except `name`.
  54. // The project ID in the URL path must refer to a Stackdriver account.
  55. rpc UpdateGroup(UpdateGroupRequest) returns (Group) {
  56. option (google.api.http) = { put: "/v3/{group.name=projects/*/groups/*}", body: "group" };
  57. }
  58. // Deletes an existing group. The project ID in the URL path must refer to a
  59. // Stackdriver account.
  60. rpc DeleteGroup(DeleteGroupRequest) returns (google.protobuf.Empty) {
  61. option (google.api.http) = { delete: "/v3/{name=projects/*/groups/*}" };
  62. }
  63. // Lists the monitored resources that are members of a group. The project ID
  64. // in the URL path must refer to a Stackdriver account.
  65. rpc ListGroupMembers(ListGroupMembersRequest) returns (ListGroupMembersResponse) {
  66. option (google.api.http) = { get: "/v3/{name=projects/*/groups/*}/members" };
  67. }
  68. }
  69. // The `ListGroup` request.
  70. message ListGroupsRequest {
  71. // The project whose groups are to be listed. The format is
  72. // `"projects/{project_id_or_number}"`.
  73. string name = 7;
  74. // An optional filter consisting of a single group name. The filters limit the
  75. // groups returned based on their parent-child relationship with the specified
  76. // group. If no filter is specified, all groups are returned.
  77. oneof filter {
  78. // A group name: `"projects/{project_id_or_number}/groups/{group_id}"`.
  79. // Returns groups whose `parentName` field contains the group
  80. // name. If no groups have this parent, the results are empty.
  81. string children_of_group = 2;
  82. // A group name: `"projects/{project_id_or_number}/groups/{group_id}"`.
  83. // Returns groups that are ancestors of the specified group.
  84. // The groups are returned in order, starting with the immediate parent and
  85. // ending with the most distant ancestor. If the specified group has no
  86. // immediate parent, the results are empty.
  87. string ancestors_of_group = 3;
  88. // A group name: `"projects/{project_id_or_number}/groups/{group_id}"`.
  89. // Returns the descendants of the specified group. This is a superset of
  90. // the results returned by the `childrenOfGroup` filter, and includes
  91. // children-of-children, and so forth.
  92. string descendants_of_group = 4;
  93. }
  94. // A positive number that is the maximum number of results to return.
  95. int32 page_size = 5;
  96. // If this field is not empty then it must contain the `nextPageToken` value
  97. // returned by a previous call to this method. Using this field causes the
  98. // method to return additional results from the previous method call.
  99. string page_token = 6;
  100. }
  101. // The `ListGroups` response.
  102. message ListGroupsResponse {
  103. // The groups that match the specified filters.
  104. repeated Group group = 1;
  105. // If there are more results than have been returned, then this field is set
  106. // to a non-empty value. To see the additional results,
  107. // use that value as `pageToken` in the next call to this method.
  108. string next_page_token = 2;
  109. }
  110. // The `GetGroup` request.
  111. message GetGroupRequest {
  112. // The group to retrieve. The format is
  113. // `"projects/{project_id_or_number}/groups/{group_id}"`.
  114. string name = 3;
  115. }
  116. // The `CreateGroup` request.
  117. message CreateGroupRequest {
  118. // The project in which to create the group. The format is
  119. // `"projects/{project_id_or_number}"`.
  120. string name = 4;
  121. // A group definition. It is an error to define the `name` field because
  122. // the system assigns the name.
  123. Group group = 2;
  124. // If true, validate this request but do not create the group.
  125. bool validate_only = 3;
  126. }
  127. // The `UpdateGroup` request.
  128. message UpdateGroupRequest {
  129. // The new definition of the group. All fields of the existing group,
  130. // excepting `name`, are replaced with the corresponding fields of this group.
  131. Group group = 2;
  132. // If true, validate this request but do not update the existing group.
  133. bool validate_only = 3;
  134. }
  135. // The `DeleteGroup` request. You can only delete a group if it has no children.
  136. message DeleteGroupRequest {
  137. // The group to delete. The format is
  138. // `"projects/{project_id_or_number}/groups/{group_id}"`.
  139. string name = 3;
  140. }
  141. // The `ListGroupMembers` request.
  142. message ListGroupMembersRequest {
  143. // The group whose members are listed. The format is
  144. // `"projects/{project_id_or_number}/groups/{group_id}"`.
  145. string name = 7;
  146. // A positive number that is the maximum number of results to return.
  147. int32 page_size = 3;
  148. // If this field is not empty then it must contain the `nextPageToken` value
  149. // returned by a previous call to this method. Using this field causes the
  150. // method to return additional results from the previous method call.
  151. string page_token = 4;
  152. // An optional [list filter](/monitoring/api/learn_more#filtering) describing
  153. // the members to be returned. The filter may reference the type, labels, and
  154. // metadata of monitored resources that comprise the group.
  155. // For example, to return only resources representing Compute Engine VM
  156. // instances, use this filter:
  157. //
  158. // resource.type = "gce_instance"
  159. string filter = 5;
  160. // An optional time interval for which results should be returned. Only
  161. // members that were part of the group during the specified interval are
  162. // included in the response. If no interval is provided then the group
  163. // membership over the last minute is returned.
  164. TimeInterval interval = 6;
  165. }
  166. // The `ListGroupMembers` response.
  167. message ListGroupMembersResponse {
  168. // A set of monitored resources in the group.
  169. repeated google.api.MonitoredResource members = 1;
  170. // If there are more results than have been returned, then this field is
  171. // set to a non-empty value. To see the additional results, use that value as
  172. // `pageToken` in the next call to this method.
  173. string next_page_token = 2;
  174. // The total number of elements matching this request.
  175. int32 total_size = 3;
  176. }