servicemanager.proto 22 KB

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