1// Copyright 2023 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/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/monitoring/v3/service.proto"; 24import "google/protobuf/empty.proto"; 25import "google/protobuf/field_mask.proto"; 26 27option csharp_namespace = "Google.Cloud.Monitoring.V3"; 28option go_package = "cloud.google.com/go/monitoring/apiv3/v2/monitoringpb;monitoringpb"; 29option java_multiple_files = true; 30option java_outer_classname = "ServiceMonitoringServiceProto"; 31option java_package = "com.google.monitoring.v3"; 32option php_namespace = "Google\\Cloud\\Monitoring\\V3"; 33option ruby_package = "Google::Cloud::Monitoring::V3"; 34 35// The Cloud Monitoring Service-Oriented Monitoring API has endpoints for 36// managing and querying aspects of a Metrics Scope's services. These include 37// the `Service`'s monitored resources, its Service-Level Objectives, and a 38// taxonomy of categorized Health Metrics. 39service ServiceMonitoringService { 40 option (google.api.default_host) = "monitoring.googleapis.com"; 41 option (google.api.oauth_scopes) = 42 "https://www.googleapis.com/auth/cloud-platform," 43 "https://www.googleapis.com/auth/monitoring," 44 "https://www.googleapis.com/auth/monitoring.read"; 45 46 // Create a `Service`. 47 rpc CreateService(CreateServiceRequest) returns (Service) { 48 option (google.api.http) = { 49 post: "/v3/{parent=*/*}/services" 50 body: "service" 51 }; 52 option (google.api.method_signature) = "parent,service"; 53 } 54 55 // Get the named `Service`. 56 rpc GetService(GetServiceRequest) returns (Service) { 57 option (google.api.http) = { 58 get: "/v3/{name=*/*/services/*}" 59 }; 60 option (google.api.method_signature) = "name"; 61 } 62 63 // List `Service`s for this Metrics Scope. 64 rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { 65 option (google.api.http) = { 66 get: "/v3/{parent=*/*}/services" 67 }; 68 option (google.api.method_signature) = "parent"; 69 } 70 71 // Update this `Service`. 72 rpc UpdateService(UpdateServiceRequest) returns (Service) { 73 option (google.api.http) = { 74 patch: "/v3/{service.name=*/*/services/*}" 75 body: "service" 76 }; 77 option (google.api.method_signature) = "service"; 78 } 79 80 // Soft delete this `Service`. 81 rpc DeleteService(DeleteServiceRequest) returns (google.protobuf.Empty) { 82 option (google.api.http) = { 83 delete: "/v3/{name=*/*/services/*}" 84 }; 85 option (google.api.method_signature) = "name"; 86 } 87 88 // Create a `ServiceLevelObjective` for the given `Service`. 89 rpc CreateServiceLevelObjective(CreateServiceLevelObjectiveRequest) 90 returns (ServiceLevelObjective) { 91 option (google.api.http) = { 92 post: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" 93 body: "service_level_objective" 94 }; 95 option (google.api.method_signature) = "parent,service_level_objective"; 96 } 97 98 // Get a `ServiceLevelObjective` by name. 99 rpc GetServiceLevelObjective(GetServiceLevelObjectiveRequest) 100 returns (ServiceLevelObjective) { 101 option (google.api.http) = { 102 get: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" 103 }; 104 option (google.api.method_signature) = "name"; 105 } 106 107 // List the `ServiceLevelObjective`s for the given `Service`. 108 rpc ListServiceLevelObjectives(ListServiceLevelObjectivesRequest) 109 returns (ListServiceLevelObjectivesResponse) { 110 option (google.api.http) = { 111 get: "/v3/{parent=*/*/services/*}/serviceLevelObjectives" 112 }; 113 option (google.api.method_signature) = "parent"; 114 } 115 116 // Update the given `ServiceLevelObjective`. 117 rpc UpdateServiceLevelObjective(UpdateServiceLevelObjectiveRequest) 118 returns (ServiceLevelObjective) { 119 option (google.api.http) = { 120 patch: "/v3/{service_level_objective.name=*/*/services/*/serviceLevelObjectives/*}" 121 body: "service_level_objective" 122 }; 123 option (google.api.method_signature) = "service_level_objective"; 124 } 125 126 // Delete the given `ServiceLevelObjective`. 127 rpc DeleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest) 128 returns (google.protobuf.Empty) { 129 option (google.api.http) = { 130 delete: "/v3/{name=*/*/services/*/serviceLevelObjectives/*}" 131 }; 132 option (google.api.method_signature) = "name"; 133 } 134} 135 136// The `CreateService` request. 137message CreateServiceRequest { 138 // Required. Resource 139 // [name](https://cloud.google.com/monitoring/api/v3#project_name) of the 140 // parent Metrics Scope. The format is: 141 // 142 // projects/[PROJECT_ID_OR_NUMBER] 143 string parent = 1 [ 144 (google.api.field_behavior) = REQUIRED, 145 (google.api.resource_reference) = { 146 child_type: "monitoring.googleapis.com/Service" 147 } 148 ]; 149 150 // Optional. The Service id to use for this Service. If omitted, an id will be 151 // generated instead. Must match the pattern `[a-z0-9\-]+` 152 string service_id = 3; 153 154 // Required. The `Service` to create. 155 Service service = 2 [(google.api.field_behavior) = REQUIRED]; 156} 157 158// The `GetService` request. 159message GetServiceRequest { 160 // Required. Resource name of the `Service`. The format is: 161 // 162 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] 163 string name = 1 [ 164 (google.api.field_behavior) = REQUIRED, 165 (google.api.resource_reference) = { 166 type: "monitoring.googleapis.com/Service" 167 } 168 ]; 169} 170 171// The `ListServices` request. 172message ListServicesRequest { 173 // Required. Resource name of the parent containing the listed services, 174 // either a [project](https://cloud.google.com/monitoring/api/v3#project_name) 175 // or a Monitoring Metrics Scope. The formats are: 176 // 177 // projects/[PROJECT_ID_OR_NUMBER] 178 // workspaces/[HOST_PROJECT_ID_OR_NUMBER] 179 string parent = 1 [ 180 (google.api.field_behavior) = REQUIRED, 181 (google.api.resource_reference) = { 182 child_type: "monitoring.googleapis.com/Service" 183 } 184 ]; 185 186 // A filter specifying what `Service`s to return. The filter supports 187 // filtering on a particular service-identifier type or one of its attributes. 188 // 189 // To filter on a particular service-identifier type, the `identifier_case` 190 // refers to which option in the `identifier` field is populated. For example, 191 // the filter `identifier_case = "CUSTOM"` would match all services with a 192 // value for the `custom` field. Valid options include "CUSTOM", "APP_ENGINE", 193 // "MESH_ISTIO", and the other options listed at 194 // https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service 195 // 196 // To filter on an attribute of a service-identifier type, apply the filter 197 // name by using the snake case of the service-identifier type and the 198 // attribute of that service-identifier type, and join the two with a period. 199 // For example, to filter by the `meshUid` field of the `MeshIstio` 200 // service-identifier type, you must filter on `mesh_istio.mesh_uid = 201 // "123"` to match all services with mesh UID "123". Service-identifier types 202 // and their attributes are described at 203 // https://cloud.google.com/monitoring/api/ref_v3/rest/v3/services#Service 204 string filter = 2; 205 206 // A non-negative number that is the maximum number of results to return. 207 // When 0, use default page size. 208 int32 page_size = 3; 209 210 // If this field is not empty then it must contain the `nextPageToken` value 211 // returned by a previous call to this method. Using this field causes the 212 // method to return additional results from the previous method call. 213 string page_token = 4; 214} 215 216// The `ListServices` response. 217message ListServicesResponse { 218 // The `Service`s matching the specified filter. 219 repeated Service services = 1; 220 221 // If there are more results than have been returned, then this field is set 222 // to a non-empty value. To see the additional results, 223 // use that value as `page_token` in the next call to this method. 224 string next_page_token = 2; 225} 226 227// The `UpdateService` request. 228message UpdateServiceRequest { 229 // Required. The `Service` to draw updates from. 230 // The given `name` specifies the resource to update. 231 Service service = 1 [(google.api.field_behavior) = REQUIRED]; 232 233 // A set of field paths defining which fields to use for the update. 234 google.protobuf.FieldMask update_mask = 2; 235} 236 237// The `DeleteService` request. 238message DeleteServiceRequest { 239 // Required. Resource name of the `Service` to delete. The format is: 240 // 241 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] 242 string name = 1 [ 243 (google.api.field_behavior) = REQUIRED, 244 (google.api.resource_reference) = { 245 type: "monitoring.googleapis.com/Service" 246 } 247 ]; 248} 249 250// The `CreateServiceLevelObjective` request. 251message CreateServiceLevelObjectiveRequest { 252 // Required. Resource name of the parent `Service`. The format is: 253 // 254 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] 255 string parent = 1 [ 256 (google.api.field_behavior) = REQUIRED, 257 (google.api.resource_reference) = { 258 type: "monitoring.googleapis.com/Service" 259 } 260 ]; 261 262 // Optional. The ServiceLevelObjective id to use for this 263 // ServiceLevelObjective. If omitted, an id will be generated instead. Must 264 // match the pattern `^[a-zA-Z0-9-_:.]+$` 265 string service_level_objective_id = 3; 266 267 // Required. The `ServiceLevelObjective` to create. 268 // The provided `name` will be respected if no `ServiceLevelObjective` exists 269 // with this name. 270 ServiceLevelObjective service_level_objective = 2 271 [(google.api.field_behavior) = REQUIRED]; 272} 273 274// The `GetServiceLevelObjective` request. 275message GetServiceLevelObjectiveRequest { 276 // Required. Resource name of the `ServiceLevelObjective` to get. The format 277 // is: 278 // 279 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] 280 string name = 1 [ 281 (google.api.field_behavior) = REQUIRED, 282 (google.api.resource_reference) = { 283 type: "monitoring.googleapis.com/ServiceLevelObjective" 284 } 285 ]; 286 287 // View of the `ServiceLevelObjective` to return. If `DEFAULT`, return the 288 // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the 289 // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the 290 // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. 291 ServiceLevelObjective.View view = 2; 292} 293 294// The `ListServiceLevelObjectives` request. 295message ListServiceLevelObjectivesRequest { 296 // Required. Resource name of the parent containing the listed SLOs, either a 297 // project or a Monitoring Metrics Scope. The formats are: 298 // 299 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID] 300 // workspaces/[HOST_PROJECT_ID_OR_NUMBER]/services/- 301 string parent = 1 [ 302 (google.api.field_behavior) = REQUIRED, 303 (google.api.resource_reference) = { 304 type: "monitoring.googleapis.com/Service" 305 } 306 ]; 307 308 // A filter specifying what `ServiceLevelObjective`s to return. 309 string filter = 2; 310 311 // A non-negative number that is the maximum number of results to return. 312 // When 0, use default page size. 313 int32 page_size = 3; 314 315 // If this field is not empty then it must contain the `nextPageToken` value 316 // returned by a previous call to this method. Using this field causes the 317 // method to return additional results from the previous method call. 318 string page_token = 4; 319 320 // View of the `ServiceLevelObjective`s to return. If `DEFAULT`, return each 321 // `ServiceLevelObjective` as originally defined. If `EXPLICIT` and the 322 // `ServiceLevelObjective` is defined in terms of a `BasicSli`, replace the 323 // `BasicSli` with a `RequestBasedSli` spelling out how the SLI is computed. 324 ServiceLevelObjective.View view = 5; 325} 326 327// The `ListServiceLevelObjectives` response. 328message ListServiceLevelObjectivesResponse { 329 // The `ServiceLevelObjective`s matching the specified filter. 330 repeated ServiceLevelObjective service_level_objectives = 1; 331 332 // If there are more results than have been returned, then this field is set 333 // to a non-empty value. To see the additional results, 334 // use that value as `page_token` in the next call to this method. 335 string next_page_token = 2; 336} 337 338// The `UpdateServiceLevelObjective` request. 339message UpdateServiceLevelObjectiveRequest { 340 // Required. The `ServiceLevelObjective` to draw updates from. 341 // The given `name` specifies the resource to update. 342 ServiceLevelObjective service_level_objective = 1 343 [(google.api.field_behavior) = REQUIRED]; 344 345 // A set of field paths defining which fields to use for the update. 346 google.protobuf.FieldMask update_mask = 2; 347} 348 349// The `DeleteServiceLevelObjective` request. 350message DeleteServiceLevelObjectiveRequest { 351 // Required. Resource name of the `ServiceLevelObjective` to delete. The 352 // format is: 353 // 354 // projects/[PROJECT_ID_OR_NUMBER]/services/[SERVICE_ID]/serviceLevelObjectives/[SLO_NAME] 355 string name = 1 [ 356 (google.api.field_behavior) = REQUIRED, 357 (google.api.resource_reference) = { 358 type: "monitoring.googleapis.com/ServiceLevelObjective" 359 } 360 ]; 361} 362