1// Copyright 2018 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 15syntax = "proto3"; 16 17package google.api.servicemanagement.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/service.proto"; 21import "google/api/servicemanagement/v1/resources.proto"; 22import "google/longrunning/operations.proto"; 23import "google/protobuf/any.proto"; 24import "google/protobuf/field_mask.proto"; 25import "google/protobuf/struct.proto"; 26import "google/rpc/status.proto"; 27 28option csharp_namespace = "Google.Cloud.ServiceManagement.V1"; 29option go_package = "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement"; 30option java_multiple_files = true; 31option java_outer_classname = "ServiceManagerProto"; 32option java_package = "com.google.api.servicemanagement.v1"; 33option objc_class_prefix = "GASM"; 34option php_namespace = "Google\\Cloud\\ServiceManagement\\V1"; 35 36// [Google Service Management API](/service-management/overview) 37service ServiceManager { 38 // Lists managed services. 39 // 40 // Returns all public services. For authenticated users, also returns all 41 // services the calling user has "servicemanagement.services.get" permission 42 // for. 43 // 44 // **BETA:** If the caller specifies the `consumer_id`, it returns only the 45 // services enabled on the consumer. The `consumer_id` must have the format 46 // of "project:{PROJECT-ID}". 47 rpc ListServices(ListServicesRequest) returns (ListServicesResponse) { 48 option (google.api.http) = { 49 get: "/v1/services" 50 }; 51 } 52 53 // Gets a managed service. Authentication is required unless the service is 54 // public. 55 rpc GetService(GetServiceRequest) returns (ManagedService) { 56 option (google.api.http) = { 57 get: "/v1/services/{service_name}" 58 }; 59 } 60 61 // Creates a new managed service. 62 // Please note one producer project can own no more than 20 services. 63 // 64 // Operation<response: ManagedService> 65 rpc CreateService(CreateServiceRequest) 66 returns (google.longrunning.Operation) { 67 option (google.api.http) = { 68 post: "/v1/services" 69 body: "service" 70 }; 71 } 72 73 // Deletes a managed service. This method will change the service to the 74 // `Soft-Delete` state for 30 days. Within this period, service producers may 75 // call 76 // [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] 77 // to restore the service. After 30 days, the service will be permanently 78 // deleted. 79 // 80 // Operation<response: google.protobuf.Empty> 81 rpc DeleteService(DeleteServiceRequest) 82 returns (google.longrunning.Operation) { 83 option (google.api.http) = { 84 delete: "/v1/services/{service_name}" 85 }; 86 } 87 88 // Revives a previously deleted managed service. The method restores the 89 // service using the configuration at the time the service was deleted. 90 // The target service must exist and must have been deleted within the 91 // last 30 days. 92 // 93 // Operation<response: UndeleteServiceResponse> 94 rpc UndeleteService(UndeleteServiceRequest) 95 returns (google.longrunning.Operation) { 96 option (google.api.http) = { 97 post: "/v1/services/{service_name}:undelete" 98 }; 99 } 100 101 // Lists the history of the service configuration for a managed service, 102 // from the newest to the oldest. 103 rpc ListServiceConfigs(ListServiceConfigsRequest) 104 returns (ListServiceConfigsResponse) { 105 option (google.api.http) = { 106 get: "/v1/services/{service_name}/configs" 107 }; 108 } 109 110 // Gets a service configuration (version) for a managed service. 111 rpc GetServiceConfig(GetServiceConfigRequest) returns (google.api.Service) { 112 option (google.api.http) = { 113 get: "/v1/services/{service_name}/configs/{config_id}" 114 additional_bindings { get: "/v1/services/{service_name}/config" } 115 }; 116 } 117 118 // Creates a new service configuration (version) for a managed service. 119 // This method only stores the service configuration. To roll out the service 120 // configuration to backend systems please call 121 // [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. 122 // 123 // Only the 100 most recent service configurations and ones referenced by 124 // existing rollouts are kept for each service. The rest will be deleted 125 // eventually. 126 rpc CreateServiceConfig(CreateServiceConfigRequest) 127 returns (google.api.Service) { 128 option (google.api.http) = { 129 post: "/v1/services/{service_name}/configs" 130 body: "service_config" 131 }; 132 } 133 134 // Creates a new service configuration (version) for a managed service based 135 // on 136 // user-supplied configuration source files (for example: OpenAPI 137 // Specification). This method stores the source configurations as well as the 138 // generated service configuration. To rollout the service configuration to 139 // other services, 140 // please call 141 // [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout]. 142 // 143 // Only the 100 most recent configuration sources and ones referenced by 144 // existing service configurtions are kept for each service. The rest will be 145 // deleted eventually. 146 // 147 // Operation<response: SubmitConfigSourceResponse> 148 rpc SubmitConfigSource(SubmitConfigSourceRequest) 149 returns (google.longrunning.Operation) { 150 option (google.api.http) = { 151 post: "/v1/services/{service_name}/configs:submit" 152 body: "*" 153 }; 154 } 155 156 // Lists the history of the service configuration rollouts for a managed 157 // service, from the newest to the oldest. 158 rpc ListServiceRollouts(ListServiceRolloutsRequest) 159 returns (ListServiceRolloutsResponse) { 160 option (google.api.http) = { 161 get: "/v1/services/{service_name}/rollouts" 162 }; 163 } 164 165 // Gets a service configuration 166 // [rollout][google.api.servicemanagement.v1.Rollout]. 167 rpc GetServiceRollout(GetServiceRolloutRequest) returns (Rollout) { 168 option (google.api.http) = { 169 get: "/v1/services/{service_name}/rollouts/{rollout_id}" 170 }; 171 } 172 173 // Creates a new service configuration rollout. Based on rollout, the 174 // Google Service Management will roll out the service configurations to 175 // different backend services. For example, the logging configuration will be 176 // pushed to Google Cloud Logging. 177 // 178 // Please note that any previous pending and running Rollouts and associated 179 // Operations will be automatically cancelled so that the latest Rollout will 180 // not be blocked by previous Rollouts. 181 // 182 // Only the 100 most recent (in any state) and the last 10 successful (if not 183 // already part of the set of 100 most recent) rollouts are kept for each 184 // service. The rest will be deleted eventually. 185 // 186 // Operation<response: Rollout> 187 rpc CreateServiceRollout(CreateServiceRolloutRequest) 188 returns (google.longrunning.Operation) { 189 option (google.api.http) = { 190 post: "/v1/services/{service_name}/rollouts" 191 body: "rollout" 192 }; 193 } 194 195 // Generates and returns a report (errors, warnings and changes from 196 // existing configurations) associated with 197 // GenerateConfigReportRequest.new_value 198 // 199 // If GenerateConfigReportRequest.old_value is specified, 200 // GenerateConfigReportRequest will contain a single ChangeReport based on the 201 // comparison between GenerateConfigReportRequest.new_value and 202 // GenerateConfigReportRequest.old_value. 203 // If GenerateConfigReportRequest.old_value is not specified, this method 204 // will compare GenerateConfigReportRequest.new_value with the last pushed 205 // service configuration. 206 rpc GenerateConfigReport(GenerateConfigReportRequest) 207 returns (GenerateConfigReportResponse) { 208 option (google.api.http) = { 209 post: "/v1/services:generateConfigReport" 210 body: "*" 211 }; 212 } 213 214 // Enables a [service][google.api.servicemanagement.v1.ManagedService] for a 215 // project, so it can be used for the project. See [Cloud Auth 216 // Guide](https://cloud.google.com/docs/authentication) for more information. 217 // 218 // Operation<response: EnableServiceResponse> 219 rpc EnableService(EnableServiceRequest) 220 returns (google.longrunning.Operation) { 221 option (google.api.http) = { 222 post: "/v1/services/{service_name}:enable" 223 body: "*" 224 }; 225 } 226 227 // Disables a [service][google.api.servicemanagement.v1.ManagedService] for a 228 // project, so it can no longer be be used for the project. It prevents 229 // accidental usage that may cause unexpected billing charges or security 230 // leaks. 231 // 232 // Operation<response: DisableServiceResponse> 233 rpc DisableService(DisableServiceRequest) 234 returns (google.longrunning.Operation) { 235 option (google.api.http) = { 236 post: "/v1/services/{service_name}:disable" 237 body: "*" 238 }; 239 } 240} 241 242// Request message for `ListServices` method. 243message ListServicesRequest { 244 // Include services produced by the specified project. 245 string producer_project_id = 1; 246 247 // Requested size of the next page of data. 248 int32 page_size = 5; 249 250 // Token identifying which result to start with; returned by a previous list 251 // call. 252 string page_token = 6; 253 254 // Include services consumed by the specified consumer. 255 // 256 // The Google Service Management implementation accepts the following 257 // forms: 258 // - project:<project_id> 259 string consumer_id = 7; 260} 261 262// Response message for `ListServices` method. 263message ListServicesResponse { 264 // The returned services will only have the name field set. 265 repeated ManagedService services = 1; 266 267 // Token that can be passed to `ListServices` to resume a paginated query. 268 string next_page_token = 2; 269} 270 271// Request message for `GetService` method. 272message GetServiceRequest { 273 // The name of the service. See the `ServiceManager` overview for naming 274 // requirements. For example: `example.googleapis.com`. 275 string service_name = 1; 276} 277 278// Request message for CreateService method. 279message CreateServiceRequest { 280 // Initial values for the service resource. 281 ManagedService service = 1; 282} 283 284// Request message for DeleteService method. 285message DeleteServiceRequest { 286 // The name of the service. See the [overview](/service-management/overview) 287 // for naming requirements. For example: `example.googleapis.com`. 288 string service_name = 1; 289} 290 291// Request message for UndeleteService method. 292message UndeleteServiceRequest { 293 // The name of the service. See the [overview](/service-management/overview) 294 // for naming requirements. For example: `example.googleapis.com`. 295 string service_name = 1; 296} 297 298// Response message for UndeleteService method. 299message UndeleteServiceResponse { 300 // Revived service resource. 301 ManagedService service = 1; 302} 303 304// Request message for GetServiceConfig method. 305message GetServiceConfigRequest { 306 enum ConfigView { 307 // Server response includes all fields except SourceInfo. 308 BASIC = 0; 309 310 // Server response includes all fields including SourceInfo. 311 // SourceFiles are of type 'google.api.servicemanagement.v1.ConfigFile' 312 // and are only available for configs created using the 313 // SubmitConfigSource method. 314 FULL = 1; 315 } 316 317 // The name of the service. See the [overview](/service-management/overview) 318 // for naming requirements. For example: `example.googleapis.com`. 319 string service_name = 1; 320 321 // The id of the service configuration resource. 322 string config_id = 2; 323 324 // Specifies which parts of the Service Config should be returned in the 325 // response. 326 ConfigView view = 3; 327} 328 329// Request message for ListServiceConfigs method. 330message ListServiceConfigsRequest { 331 // The name of the service. See the [overview](/service-management/overview) 332 // for naming requirements. For example: `example.googleapis.com`. 333 string service_name = 1; 334 335 // The token of the page to retrieve. 336 string page_token = 2; 337 338 // The max number of items to include in the response list. 339 int32 page_size = 3; 340} 341 342// Response message for ListServiceConfigs method. 343message ListServiceConfigsResponse { 344 // The list of service configuration resources. 345 repeated google.api.Service service_configs = 1; 346 347 // The token of the next page of results. 348 string next_page_token = 2; 349} 350 351// Request message for CreateServiceConfig method. 352message CreateServiceConfigRequest { 353 // The name of the service. See the [overview](/service-management/overview) 354 // for naming requirements. For example: `example.googleapis.com`. 355 string service_name = 1; 356 357 // The service configuration resource. 358 google.api.Service service_config = 2; 359} 360 361// Request message for SubmitConfigSource method. 362message SubmitConfigSourceRequest { 363 // The name of the service. See the [overview](/service-management/overview) 364 // for naming requirements. For example: `example.googleapis.com`. 365 string service_name = 1; 366 367 // The source configuration for the service. 368 ConfigSource config_source = 2; 369 370 // Optional. If set, this will result in the generation of a 371 // `google.api.Service` configuration based on the `ConfigSource` provided, 372 // but the generated config and the sources will NOT be persisted. 373 bool validate_only = 3; 374} 375 376// Response message for SubmitConfigSource method. 377message SubmitConfigSourceResponse { 378 // The generated service configuration. 379 google.api.Service service_config = 1; 380} 381 382// Request message for 'CreateServiceRollout' 383message CreateServiceRolloutRequest { 384 // The name of the service. See the [overview](/service-management/overview) 385 // for naming requirements. For example: `example.googleapis.com`. 386 string service_name = 1; 387 388 // The rollout resource. The `service_name` field is output only. 389 Rollout rollout = 2; 390} 391 392// Request message for 'ListServiceRollouts' 393message ListServiceRolloutsRequest { 394 // The name of the service. See the [overview](/service-management/overview) 395 // for naming requirements. For example: `example.googleapis.com`. 396 string service_name = 1; 397 398 // The token of the page to retrieve. 399 string page_token = 2; 400 401 // The max number of items to include in the response list. 402 int32 page_size = 3; 403 404 // Use `filter` to return subset of rollouts. 405 // The following filters are supported: 406 // -- To limit the results to only those in 407 // [status](google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', 408 // use filter='status=SUCCESS' 409 // -- To limit the results to those in 410 // [status](google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' 411 // or 'FAILED', use filter='status=CANCELLED OR status=FAILED' 412 string filter = 4; 413} 414 415// Response message for ListServiceRollouts method. 416message ListServiceRolloutsResponse { 417 // The list of rollout resources. 418 repeated Rollout rollouts = 1; 419 420 // The token of the next page of results. 421 string next_page_token = 2; 422} 423 424// Request message for GetServiceRollout method. 425message GetServiceRolloutRequest { 426 // The name of the service. See the [overview](/service-management/overview) 427 // for naming requirements. For example: `example.googleapis.com`. 428 string service_name = 1; 429 430 // The id of the rollout resource. 431 string rollout_id = 2; 432} 433 434// Request message for EnableService method. 435message EnableServiceRequest { 436 // Name of the service to enable. Specifying an unknown service name will 437 // cause the request to fail. 438 string service_name = 1; 439 440 // The identity of consumer resource which service enablement will be 441 // applied to. 442 // 443 // The Google Service Management implementation accepts the following 444 // forms: 445 // - "project:<project_id>" 446 // 447 // Note: this is made compatible with 448 // google.api.servicecontrol.v1.Operation.consumer_id. 449 string consumer_id = 2; 450} 451 452// Request message for DisableService method. 453message DisableServiceRequest { 454 // Name of the service to disable. Specifying an unknown service name 455 // will cause the request to fail. 456 string service_name = 1; 457 458 // The identity of consumer resource which service disablement will be 459 // applied to. 460 // 461 // The Google Service Management implementation accepts the following 462 // forms: 463 // - "project:<project_id>" 464 // 465 // Note: this is made compatible with 466 // google.api.servicecontrol.v1.Operation.consumer_id. 467 string consumer_id = 2; 468} 469 470// Request message for GenerateConfigReport method. 471message GenerateConfigReportRequest { 472 // Service configuration for which we want to generate the report. 473 // For this version of API, the supported types are 474 // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], 475 // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], 476 // and [google.api.Service][google.api.Service] 477 google.protobuf.Any new_config = 1; 478 479 // Service configuration against which the comparison will be done. 480 // For this version of API, the supported types are 481 // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef], 482 // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource], 483 // and [google.api.Service][google.api.Service] 484 google.protobuf.Any old_config = 2; 485} 486 487// Response message for GenerateConfigReport method. 488message GenerateConfigReportResponse { 489 // Name of the service this report belongs to. 490 string service_name = 1; 491 492 // ID of the service configuration this report belongs to. 493 string id = 2; 494 495 // list of ChangeReport, each corresponding to comparison between two 496 // service configurations. 497 repeated ChangeReport change_reports = 3; 498 499 // Errors / Linter warnings associated with the service definition this 500 // report 501 // belongs to. 502 repeated Diagnostic diagnostics = 4; 503} 504