servicemanager.proto 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. // Copyright 2016 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. syntax = "proto3";
  15. package google.api.servicemanagement.v1;
  16. import "google/api/annotations.proto";
  17. import "google/api/service.proto";
  18. import "google/api/servicemanagement/v1/resources.proto";
  19. import "google/longrunning/operations.proto";
  20. import "google/protobuf/any.proto";
  21. import "google/protobuf/empty.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/protobuf/struct.proto";
  24. import "google/rpc/status.proto";
  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. // [Google Service Management API](/service-management/overview)
  30. service ServiceManager {
  31. // Lists all managed services.
  32. rpc ListServices(ListServicesRequest) returns (ListServicesResponse) {
  33. option (google.api.http) = { get: "/v1/services" };
  34. }
  35. // Gets a managed service.
  36. rpc GetService(GetServiceRequest) returns (ManagedService) {
  37. option (google.api.http) = { get: "/v1/services/{service_name}" };
  38. }
  39. // Creates a new managed service.
  40. // Please note one producer project can own no more than 20 services.
  41. //
  42. // Operation<response: ManagedService>
  43. rpc CreateService(CreateServiceRequest) returns (google.longrunning.Operation) {
  44. option (google.api.http) = { post: "/v1/services" body: "service" };
  45. }
  46. // Deletes a managed service. This method will change the serivce in the
  47. // `Soft-Delete` state for 30 days. Within this period, service producers may
  48. // call [UndeleteService][google.api.servicemanagement.v1.ServiceManager.UndeleteService] to restore the service.
  49. // After 30 days, the service will be permanently deleted.
  50. //
  51. // Operation<response: google.protobuf.Empty>
  52. rpc DeleteService(DeleteServiceRequest) returns (google.longrunning.Operation) {
  53. option (google.api.http) = { delete: "/v1/services/{service_name}" };
  54. }
  55. // Revives a previously deleted managed service. The method restores the
  56. // service using the configuration at the time the service was deleted.
  57. // The target service must exist and must have been deleted within the
  58. // last 30 days.
  59. //
  60. // Operation<response: UndeleteServiceResponse>
  61. rpc UndeleteService(UndeleteServiceRequest) returns (google.longrunning.Operation) {
  62. option (google.api.http) = { post: "/v1/services/{service_name}:undelete" body: "null" };
  63. }
  64. // Lists the history of the service configuration for a managed service,
  65. // from the newest to the oldest.
  66. rpc ListServiceConfigs(ListServiceConfigsRequest) returns (ListServiceConfigsResponse) {
  67. option (google.api.http) = { get: "/v1/services/{service_name}/configs" };
  68. }
  69. // Gets a service configuration (version) for a managed service.
  70. rpc GetServiceConfig(GetServiceConfigRequest) returns (google.api.Service) {
  71. option (google.api.http) = { get: "/v1/services/{service_name}/configs/{config_id}" };
  72. }
  73. // Creates a new service configuration (version) for a managed service.
  74. // This method only stores the service configuration. To roll out the service
  75. // configuration to backend systems please call
  76. // [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout].
  77. rpc CreateServiceConfig(CreateServiceConfigRequest) returns (google.api.Service) {
  78. option (google.api.http) = { post: "/v1/services/{service_name}/configs" body: "service_config" };
  79. }
  80. // Creates a new service configuration (version) for a managed service based
  81. // on
  82. // user-supplied configuration source files (for example: OpenAPI
  83. // Specification). This method stores the source configurations as well as the
  84. // generated service configuration. To rollout the service configuration to
  85. // other services,
  86. // please call [CreateServiceRollout][google.api.servicemanagement.v1.ServiceManager.CreateServiceRollout].
  87. //
  88. // Operation<response: SubmitConfigSourceResponse>
  89. rpc SubmitConfigSource(SubmitConfigSourceRequest) returns (google.longrunning.Operation) {
  90. option (google.api.http) = { post: "/v1/services/{service_name}/configs:submit" body: "*" };
  91. }
  92. // Lists the history of the service configuration rollouts for a managed
  93. // service, from the newest to the oldest.
  94. rpc ListServiceRollouts(ListServiceRolloutsRequest) returns (ListServiceRolloutsResponse) {
  95. option (google.api.http) = { get: "/v1/services/{service_name}/rollouts" };
  96. }
  97. // Gets a service configuration [rollout][google.api.servicemanagement.v1.Rollout].
  98. rpc GetServiceRollout(GetServiceRolloutRequest) returns (Rollout) {
  99. option (google.api.http) = { get: "/v1/services/{service_name}/rollouts/{rollout_id}" };
  100. }
  101. // Creates a new service configuration rollout. Based on rollout, the
  102. // Google Service Management will roll out the service configurations to
  103. // different backend services. For example, the logging configuration will be
  104. // pushed to Google Cloud Logging.
  105. //
  106. // Please note that any previous pending and running Rollouts and associated
  107. // Operations will be automatically cancelled so that the latest Rollout will
  108. // not be blocked by previous Rollouts.
  109. //
  110. // Operation<response: Rollout>
  111. rpc CreateServiceRollout(CreateServiceRolloutRequest) returns (google.longrunning.Operation) {
  112. option (google.api.http) = { post: "/v1/services/{service_name}/rollouts" body: "rollout" };
  113. }
  114. // Generates and returns a report (errors, warnings and changes from
  115. // existing configurations) associated with
  116. // GenerateConfigReportRequest.new_value
  117. //
  118. // If GenerateConfigReportRequest.old_value is specified,
  119. // GenerateConfigReportRequest will contain a single ChangeReport based on the
  120. // comparison between GenerateConfigReportRequest.new_value and
  121. // GenerateConfigReportRequest.old_value.
  122. // If GenerateConfigReportRequest.old_value is not specified, this method
  123. // will compare GenerateConfigReportRequest.new_value with the last pushed
  124. // service configuration.
  125. rpc GenerateConfigReport(GenerateConfigReportRequest) returns (GenerateConfigReportResponse) {
  126. option (google.api.http) = { post: "/v1/services:generateConfigReport" body: "*" };
  127. }
  128. // Enable a managed service for a project with default setting.
  129. //
  130. // Operation<response: EnableServiceResponse>
  131. //
  132. // [google.rpc.Status][google.rpc.Status] errors may contain a
  133. // [google.rpc.PreconditionFailure][] error detail.
  134. rpc EnableService(EnableServiceRequest) returns (google.longrunning.Operation) {
  135. option (google.api.http) = { post: "/v1/services/{service_name}:enable" body: "*" };
  136. }
  137. // Disable a managed service for a project.
  138. //
  139. // Operation<response: DisableServiceResponse>
  140. rpc DisableService(DisableServiceRequest) returns (google.longrunning.Operation) {
  141. option (google.api.http) = { post: "/v1/services/{service_name}:disable" body: "*" };
  142. }
  143. }
  144. // Request message for `ListServices` method.
  145. message ListServicesRequest {
  146. // Include services produced by the specified project.
  147. string producer_project_id = 1;
  148. // Requested size of the next page of data.
  149. int32 page_size = 5;
  150. // Token identifying which result to start with; returned by a previous list
  151. // call.
  152. string page_token = 6;
  153. }
  154. // Response message for `ListServices` method.
  155. message ListServicesResponse {
  156. // The results of the query.
  157. repeated ManagedService services = 1;
  158. // Token that can be passed to `ListServices` to resume a paginated query.
  159. string next_page_token = 2;
  160. }
  161. // Request message for `GetService` method.
  162. message GetServiceRequest {
  163. // The name of the service. See the `ServiceManager` overview for naming
  164. // requirements. For example: `example.googleapis.com`.
  165. string service_name = 1;
  166. }
  167. // Request message for CreateService method.
  168. message CreateServiceRequest {
  169. // Initial values for the service resource.
  170. ManagedService service = 1;
  171. }
  172. // Request message for DeleteService method.
  173. message DeleteServiceRequest {
  174. // The name of the service. See the [overview](/service-management/overview)
  175. // for naming requirements. For example: `example.googleapis.com`.
  176. string service_name = 1;
  177. }
  178. // Request message for UndeleteService method.
  179. message UndeleteServiceRequest {
  180. // The name of the service. See the [overview](/service-management/overview)
  181. // for naming requirements. For example: `example.googleapis.com`.
  182. string service_name = 1;
  183. }
  184. // Response message for UndeleteService method.
  185. message UndeleteServiceResponse {
  186. // Revived service resource.
  187. ManagedService service = 1;
  188. }
  189. // Request message for GetServiceConfig method.
  190. message GetServiceConfigRequest {
  191. // The name of the service. See the [overview](/service-management/overview)
  192. // for naming requirements. For example: `example.googleapis.com`.
  193. string service_name = 1;
  194. string config_id = 2;
  195. }
  196. // Request message for ListServiceConfigs method.
  197. message ListServiceConfigsRequest {
  198. // The name of the service. See the [overview](/service-management/overview)
  199. // for naming requirements. For example: `example.googleapis.com`.
  200. string service_name = 1;
  201. // The token of the page to retrieve.
  202. string page_token = 2;
  203. // The max number of items to include in the response list.
  204. int32 page_size = 3;
  205. }
  206. // Response message for ListServiceConfigs method.
  207. message ListServiceConfigsResponse {
  208. // The list of service configuration resources.
  209. repeated google.api.Service service_configs = 1;
  210. // The token of the next page of results.
  211. string next_page_token = 2;
  212. }
  213. // Request message for CreateServiceConfig method.
  214. message CreateServiceConfigRequest {
  215. // The name of the service. See the [overview](/service-management/overview)
  216. // for naming requirements. For example: `example.googleapis.com`.
  217. string service_name = 1;
  218. // The service configuration resource.
  219. google.api.Service service_config = 2;
  220. }
  221. // Request message for SubmitConfigSource method.
  222. message SubmitConfigSourceRequest {
  223. // The name of the service. See the [overview](/service-management/overview)
  224. // for naming requirements. For example: `example.googleapis.com`.
  225. string service_name = 1;
  226. // The source configuration for the service.
  227. ConfigSource config_source = 2;
  228. // Optional. If set, this will result in the generation of a
  229. // `google.api.Service` configuration based on the `ConfigSource` provided,
  230. // but the generated config and the sources will NOT be persisted.
  231. bool validate_only = 3;
  232. }
  233. // Response message for SubmitConfigSource method.
  234. message SubmitConfigSourceResponse {
  235. // The generated service configuration.
  236. google.api.Service service_config = 1;
  237. }
  238. // Request message for 'CreateServiceRollout'
  239. message CreateServiceRolloutRequest {
  240. // The name of the service. See the [overview](/service-management/overview)
  241. // for naming requirements. For example: `example.googleapis.com`.
  242. string service_name = 1;
  243. // The rollout resource. The `service_name` field is output only.
  244. Rollout rollout = 2;
  245. }
  246. // Request message for 'ListServiceRollouts'
  247. message ListServiceRolloutsRequest {
  248. // The name of the service. See the [overview](/service-management/overview)
  249. // for naming requirements. For example: `example.googleapis.com`.
  250. string service_name = 1;
  251. // The token of the page to retrieve.
  252. string page_token = 2;
  253. // The max number of items to include in the response list.
  254. int32 page_size = 3;
  255. }
  256. // Response message for ListServiceRollouts method.
  257. message ListServiceRolloutsResponse {
  258. // The list of rollout resources.
  259. repeated Rollout rollouts = 1;
  260. // The token of the next page of results.
  261. string next_page_token = 2;
  262. }
  263. // Request message for GetServiceRollout method.
  264. message GetServiceRolloutRequest {
  265. // The name of the service. See the [overview](/service-management/overview)
  266. // for naming requirements. For example: `example.googleapis.com`.
  267. string service_name = 1;
  268. // The id of the rollout resource.
  269. string rollout_id = 2;
  270. }
  271. // Request message for EnableService method.
  272. message EnableServiceRequest {
  273. // Name of the service to enable. Specifying an unknown service name will
  274. // cause the request to fail.
  275. string service_name = 1;
  276. // The identity of consumer resource which service enablement will be
  277. // applied to.
  278. //
  279. // The Google Service Management implementation accepts the following
  280. // forms: "project:<project_id>", "project_number:<project_number>".
  281. //
  282. // Note: this is made compatible with
  283. // google.api.servicecontrol.v1.Operation.consumer_id.
  284. string consumer_id = 2;
  285. }
  286. // Request message for DisableService method.
  287. message DisableServiceRequest {
  288. // Name of the service to disable. Specifying an unknown service name
  289. // will cause the request to fail.
  290. string service_name = 1;
  291. // The identity of consumer resource which service disablement will be
  292. // applied to.
  293. //
  294. // The Google Service Management implementation accepts the following
  295. // forms: "project:<project_id>", "project_number:<project_number>".
  296. //
  297. // Note: this is made compatible with
  298. // google.api.servicecontrol.v1.Operation.consumer_id.
  299. string consumer_id = 2;
  300. }
  301. // Request message for GenerateConfigReport method.
  302. message GenerateConfigReportRequest {
  303. // Service configuration for which we want to generate the report.
  304. // For this version of API, the supported types are
  305. // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef],
  306. // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource],
  307. // and [google.api.Service][google.api.Service]
  308. google.protobuf.Any new_config = 1;
  309. // Service configuration against which the comparison will be done.
  310. // For this version of API, the supported types are
  311. // [google.api.servicemanagement.v1.ConfigRef][google.api.servicemanagement.v1.ConfigRef],
  312. // [google.api.servicemanagement.v1.ConfigSource][google.api.servicemanagement.v1.ConfigSource],
  313. // and [google.api.Service][google.api.Service]
  314. google.protobuf.Any old_config = 2;
  315. }
  316. // Response message for GenerateConfigReport method.
  317. message GenerateConfigReportResponse {
  318. // Name of the service this report belongs to.
  319. string service_name = 1;
  320. // ID of the service configuration this report belongs to.
  321. string id = 2;
  322. // list of ChangeReport, each corresponding to comparison between two
  323. // service configurations.
  324. repeated ChangeReport change_reports = 3;
  325. // Errors / Linter warnings associated with the service definition this
  326. // report
  327. // belongs to.
  328. repeated Diagnostic diagnostics = 4;
  329. }