servicemanager.proto 20 KB

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