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
15syntax = "proto3";
16
17package google.monitoring.v3;
18
19import "google/api/resource.proto";
20
21option csharp_namespace = "Google.Cloud.Monitoring.V3";
22option go_package = "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb";
23option java_multiple_files = true;
24option java_outer_classname = "GroupProto";
25option java_package = "com.google.monitoring.v3";
26option php_namespace = "Google\\Cloud\\Monitoring\\V3";
27option ruby_package = "Google::Cloud::Monitoring::V3";
28
29// The description of a dynamic collection of monitored resources. Each group
30// has a filter that is matched against monitored resources and their associated
31// metadata. If a group's filter matches an available monitored resource, then
32// that resource is a member of that group.  Groups can contain any number of
33// monitored resources, and each monitored resource can be a member of any
34// number of groups.
35//
36// Groups can be nested in parent-child hierarchies. The `parentName` field
37// identifies an optional parent for each group.  If a group has a parent, then
38// the only monitored resources available to be matched by the group's filter
39// are the resources contained in the parent group.  In other words, a group
40// contains the monitored resources that match its filter and the filters of all
41// the group's ancestors.  A group without a parent can contain any monitored
42// resource.
43//
44// For example, consider an infrastructure running a set of instances with two
45// user-defined tags: `"environment"` and `"role"`. A parent group has a filter,
46// `environment="production"`.  A child of that parent group has a filter,
47// `role="transcoder"`.  The parent group contains all instances in the
48// production environment, regardless of their roles.  The child group contains
49// instances that have the transcoder role *and* are in the production
50// environment.
51//
52// The monitored resources contained in a group can change at any moment,
53// depending on what resources exist and what filters are associated with the
54// group and its ancestors.
55message Group {
56  option (google.api.resource) = {
57    type: "monitoring.googleapis.com/Group"
58    pattern: "projects/{project}/groups/{group}"
59    pattern: "organizations/{organization}/groups/{group}"
60    pattern: "folders/{folder}/groups/{group}"
61    pattern: "*"
62  };
63
64  // Output only. The name of this group. The format is:
65  //
66  //     projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
67  //
68  // When creating a group, this field is ignored and a new name is created
69  // consisting of the project specified in the call to `CreateGroup`
70  // and a unique `[GROUP_ID]` that is generated automatically.
71  string name = 1;
72
73  // A user-assigned name for this group, used only for display purposes.
74  string display_name = 2;
75
76  // The name of the group's parent, if it has one. The format is:
77  //
78  //     projects/[PROJECT_ID_OR_NUMBER]/groups/[GROUP_ID]
79  //
80  // For groups with no parent, `parent_name` is the empty string, `""`.
81  string parent_name = 3;
82
83  // The filter used to determine which monitored resources belong to this
84  // group.
85  string filter = 5;
86
87  // If true, the members of this group are considered to be a cluster.
88  // The system can perform additional analysis on groups that are clusters.
89  bool is_cluster = 6;
90}
91