-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
metrics_scopes.proto
183 lines (160 loc) · 6.71 KB
/
metrics_scopes.proto
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
// Copyright 2021 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.metricsscope.v1;
import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/longrunning/operations.proto";
import "google/monitoring/metricsscope/v1/metrics_scope.proto";
import "google/protobuf/timestamp.proto";
option go_package = "cloud.google.com/go/monitoring/metricsscope/apiv1/metricsscopepb;metricsscopepb";
option java_multiple_files = true;
option java_outer_classname = "MetricsScopesProto";
option java_package = "com.google.monitoring.metricsscope.v1";
option csharp_namespace = "Google.Cloud.Monitoring.MetricsScope.V1";
option php_namespace = "Google\\Cloud\\Monitoring\\MetricsScope\\V1";
option ruby_package = "Google::Cloud::Monitoring::MetricsScope::V1";
// Manages Cloud Monitoring Metrics Scopes, and the monitoring of Google Cloud
// projects and AWS accounts.
service MetricsScopes {
option (google.api.default_host) = "monitoring.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/monitoring,"
"https://www.googleapis.com/auth/monitoring.read,"
"https://www.googleapis.com/auth/monitoring.write";
// Returns a specific `Metrics Scope`.
rpc GetMetricsScope(GetMetricsScopeRequest) returns (MetricsScope) {
option (google.api.http) = {
get: "/v1/{name=locations/global/metricsScopes/*}"
};
option (google.api.method_signature) = "name";
}
// Returns a list of every `Metrics Scope` that a specific `MonitoredProject`
// has been added to. The metrics scope representing the specified monitored
// project will always be the first entry in the response.
rpc ListMetricsScopesByMonitoredProject(ListMetricsScopesByMonitoredProjectRequest) returns (ListMetricsScopesByMonitoredProjectResponse) {
option (google.api.http) = {
get: "/v1/locations/global/metricsScopes:listMetricsScopesByMonitoredProject"
};
}
// Adds a `MonitoredProject` with the given project ID
// to the specified `Metrics Scope`.
rpc CreateMonitoredProject(CreateMonitoredProjectRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=locations/global/metricsScopes/*}/projects"
body: "monitored_project"
};
option (google.api.method_signature) = "parent,monitored_project";
option (google.longrunning.operation_info) = {
response_type: "MonitoredProject"
metadata_type: "OperationMetadata"
};
}
// Deletes a `MonitoredProject` from the specified `Metrics Scope`.
rpc DeleteMonitoredProject(DeleteMonitoredProjectRequest) returns (google.longrunning.Operation) {
option (google.api.http) = {
delete: "/v1/{name=locations/global/metricsScopes/*/projects/*}"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "google.protobuf.Empty"
metadata_type: "OperationMetadata"
};
}
}
// Request for the `GetMetricsScope` method.
message GetMetricsScopeRequest {
// Required. The resource name of the `Metrics Scope`.
// Example:
// `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "monitoring.googleapis.com/MetricsScope"
}
];
}
// Request for the `ListMetricsScopesByMonitoredProject` method.
message ListMetricsScopesByMonitoredProjectRequest {
// Required. The resource name of the `Monitored Project` being requested.
// Example:
// `projects/{MONITORED_PROJECT_ID_OR_NUMBER}`
string monitored_resource_container = 1 [(google.api.field_behavior) = REQUIRED];
}
// Response for the `ListMetricsScopesByMonitoredProject` method.
message ListMetricsScopesByMonitoredProjectResponse {
// A set of all metrics scopes that the specified monitored project has been
// added to.
repeated MetricsScope metrics_scopes = 1;
}
// Request for the `CreateMonitoredProject` method.
message CreateMonitoredProjectRequest {
// Required. The resource name of the existing `Metrics Scope` that will monitor this
// project.
// Example:
// `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}`
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "monitoring.googleapis.com/MetricsScope"
}
];
// Required. The initial `MonitoredProject` configuration.
// Specify only the `monitored_project.name` field. All other fields are
// ignored. The `monitored_project.name` must be in the format:
// `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`
MonitoredProject monitored_project = 2 [(google.api.field_behavior) = REQUIRED];
}
// Request for the `DeleteMonitoredProject` method.
message DeleteMonitoredProjectRequest {
// Required. The resource name of the `MonitoredProject`.
// Example:
// `locations/global/metricsScopes/{SCOPING_PROJECT_ID_OR_NUMBER}/projects/{MONITORED_PROJECT_ID_OR_NUMBER}`
//
// Authorization requires the following [Google
// IAM](https://cloud.google.com/iam) permissions on both the `Metrics Scope`
// and on the `MonitoredProject`: `monitoring.metricsScopes.link`
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
type: "monitoring.googleapis.com/MonitoredProject"
}
];
}
// Contains metadata for longrunning operation for the edit Metrics Scope
// endpoints.
message OperationMetadata {
// Batch operation states.
enum State {
// Invalid.
STATE_UNSPECIFIED = 0;
// Request has been received.
CREATED = 1;
// Request is actively being processed.
RUNNING = 2;
// The batch processing is done.
DONE = 3;
// The batch processing was cancelled.
CANCELLED = 4;
}
// Current state of the batch operation.
State state = 1;
// The time when the batch request was received.
google.protobuf.Timestamp create_time = 5;
// The time when the operation result was last updated.
google.protobuf.Timestamp update_time = 6;
}