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