resources.proto 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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. //
  15. syntax = "proto3";
  16. package google.api.servicemanagement.v1;
  17. import "google/api/annotations.proto";
  18. import "google/api/config_change.proto";
  19. import "google/api/field_behavior.proto";
  20. import "google/api/metric.proto";
  21. import "google/api/quota.proto";
  22. import "google/api/service.proto";
  23. import "google/longrunning/operations.proto";
  24. import "google/protobuf/any.proto";
  25. import "google/protobuf/field_mask.proto";
  26. import "google/protobuf/timestamp.proto";
  27. import "google/rpc/status.proto";
  28. option csharp_namespace = "Google.Cloud.ServiceManagement.V1";
  29. option go_package = "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement";
  30. option java_multiple_files = true;
  31. option java_outer_classname = "ResourcesProto";
  32. option java_package = "com.google.api.servicemanagement.v1";
  33. option objc_class_prefix = "GASM";
  34. option php_namespace = "Google\\Cloud\\ServiceManagement\\V1";
  35. option ruby_package = "Google::Cloud::ServiceManagement::V1";
  36. // The full representation of a Service that is managed by
  37. // Google Service Management.
  38. message ManagedService {
  39. // The name of the service. See the [overview](https://cloud.google.com/service-management/overview)
  40. // for naming requirements.
  41. string service_name = 2;
  42. // ID of the project that produces and owns this service.
  43. string producer_project_id = 3;
  44. }
  45. // The metadata associated with a long running operation resource.
  46. message OperationMetadata {
  47. // Represents the status of one operation step.
  48. message Step {
  49. // The short description of the step.
  50. string description = 2;
  51. // The status code.
  52. Status status = 4;
  53. }
  54. // Code describes the status of the operation (or one of its steps).
  55. enum Status {
  56. // Unspecifed code.
  57. STATUS_UNSPECIFIED = 0;
  58. // The operation or step has completed without errors.
  59. DONE = 1;
  60. // The operation or step has not started yet.
  61. NOT_STARTED = 2;
  62. // The operation or step is in progress.
  63. IN_PROGRESS = 3;
  64. // The operation or step has completed with errors. If the operation is
  65. // rollbackable, the rollback completed with errors too.
  66. FAILED = 4;
  67. // The operation or step has completed with cancellation.
  68. CANCELLED = 5;
  69. }
  70. // The full name of the resources that this operation is directly
  71. // associated with.
  72. repeated string resource_names = 1;
  73. // Detailed status information for each step. The order is undetermined.
  74. repeated Step steps = 2;
  75. // Percentage of completion of this operation, ranging from 0 to 100.
  76. int32 progress_percentage = 3;
  77. // The start time of the operation.
  78. google.protobuf.Timestamp start_time = 4;
  79. }
  80. // Represents a diagnostic message (error or warning)
  81. message Diagnostic {
  82. // The kind of diagnostic information possible.
  83. enum Kind {
  84. // Warnings and errors
  85. WARNING = 0;
  86. // Only errors
  87. ERROR = 1;
  88. }
  89. // File name and line number of the error or warning.
  90. string location = 1;
  91. // The kind of diagnostic information provided.
  92. Kind kind = 2;
  93. // Message describing the error or warning.
  94. string message = 3;
  95. }
  96. // Represents a source file which is used to generate the service configuration
  97. // defined by `google.api.Service`.
  98. message ConfigSource {
  99. // A unique ID for a specific instance of this message, typically assigned
  100. // by the client for tracking purpose. If empty, the server may choose to
  101. // generate one instead.
  102. string id = 5;
  103. // Set of source configuration files that are used to generate a service
  104. // configuration (`google.api.Service`).
  105. repeated ConfigFile files = 2;
  106. }
  107. // Generic specification of a source configuration file
  108. message ConfigFile {
  109. enum FileType {
  110. // Unknown file type.
  111. FILE_TYPE_UNSPECIFIED = 0;
  112. // YAML-specification of service.
  113. SERVICE_CONFIG_YAML = 1;
  114. // OpenAPI specification, serialized in JSON.
  115. OPEN_API_JSON = 2;
  116. // OpenAPI specification, serialized in YAML.
  117. OPEN_API_YAML = 3;
  118. // FileDescriptorSet, generated by protoc.
  119. //
  120. // To generate, use protoc with imports and source info included.
  121. // For an example test.proto file, the following command would put the value
  122. // in a new file named out.pb.
  123. //
  124. // $protoc --include_imports --include_source_info test.proto -o out.pb
  125. FILE_DESCRIPTOR_SET_PROTO = 4;
  126. // Uncompiled Proto file. Used for storage and display purposes only,
  127. // currently server-side compilation is not supported. Should match the
  128. // inputs to 'protoc' command used to generated FILE_DESCRIPTOR_SET_PROTO. A
  129. // file of this type can only be included if at least one file of type
  130. // FILE_DESCRIPTOR_SET_PROTO is included.
  131. PROTO_FILE = 6;
  132. }
  133. // The file name of the configuration file (full or relative path).
  134. string file_path = 1;
  135. // The bytes that constitute the file.
  136. bytes file_contents = 3;
  137. // The type of configuration file this represents.
  138. FileType file_type = 4;
  139. }
  140. // Represents a service configuration with its name and id.
  141. message ConfigRef {
  142. // Resource name of a service config. It must have the following
  143. // format: "services/{service name}/configs/{config id}".
  144. string name = 1;
  145. }
  146. // Change report associated with a particular service configuration.
  147. //
  148. // It contains a list of ConfigChanges based on the comparison between
  149. // two service configurations.
  150. message ChangeReport {
  151. // List of changes between two service configurations.
  152. // The changes will be alphabetically sorted based on the identifier
  153. // of each change.
  154. // A ConfigChange identifier is a dot separated path to the configuration.
  155. // Example: visibility.rules[selector='LibraryService.CreateBook'].restriction
  156. repeated google.api.ConfigChange config_changes = 1;
  157. }
  158. // A rollout resource that defines how service configuration versions are pushed
  159. // to control plane systems. Typically, you create a new version of the
  160. // service config, and then create a Rollout to push the service config.
  161. message Rollout {
  162. // Strategy that specifies how clients of Google Service Controller want to
  163. // send traffic to use different config versions. This is generally
  164. // used by API proxy to split traffic based on your configured percentage for
  165. // each config version.
  166. //
  167. // One example of how to gradually rollout a new service configuration using
  168. // this
  169. // strategy:
  170. // Day 1
  171. //
  172. // Rollout {
  173. // id: "example.googleapis.com/rollout_20160206"
  174. // traffic_percent_strategy {
  175. // percentages: {
  176. // "example.googleapis.com/20160201": 70.00
  177. // "example.googleapis.com/20160206": 30.00
  178. // }
  179. // }
  180. // }
  181. //
  182. // Day 2
  183. //
  184. // Rollout {
  185. // id: "example.googleapis.com/rollout_20160207"
  186. // traffic_percent_strategy: {
  187. // percentages: {
  188. // "example.googleapis.com/20160206": 100.00
  189. // }
  190. // }
  191. // }
  192. message TrafficPercentStrategy {
  193. // Maps service configuration IDs to their corresponding traffic percentage.
  194. // Key is the service configuration ID, Value is the traffic percentage
  195. // which must be greater than 0.0 and the sum must equal to 100.0.
  196. map<string, double> percentages = 1;
  197. }
  198. // Strategy used to delete a service. This strategy is a placeholder only
  199. // used by the system generated rollout to delete a service.
  200. message DeleteServiceStrategy {
  201. }
  202. // Status of a Rollout.
  203. enum RolloutStatus {
  204. // No status specified.
  205. ROLLOUT_STATUS_UNSPECIFIED = 0;
  206. // The Rollout is in progress.
  207. IN_PROGRESS = 1;
  208. // The Rollout has completed successfully.
  209. SUCCESS = 2;
  210. // The Rollout has been cancelled. This can happen if you have overlapping
  211. // Rollout pushes, and the previous ones will be cancelled.
  212. CANCELLED = 3;
  213. // The Rollout has failed and the rollback attempt has failed too.
  214. FAILED = 4;
  215. // The Rollout has not started yet and is pending for execution.
  216. PENDING = 5;
  217. // The Rollout has failed and rolled back to the previous successful
  218. // Rollout.
  219. FAILED_ROLLED_BACK = 6;
  220. }
  221. // Optional. Unique identifier of this Rollout. Must be no longer than 63 characters
  222. // and only lower case letters, digits, '.', '_' and '-' are allowed.
  223. //
  224. // If not specified by client, the server will generate one. The generated id
  225. // will have the form of <date><revision number>, where "date" is the create
  226. // date in ISO 8601 format. "revision number" is a monotonically increasing
  227. // positive number that is reset every day for each service.
  228. // An example of the generated rollout_id is '2016-02-16r1'
  229. string rollout_id = 1 [(google.api.field_behavior) = OPTIONAL];
  230. // Creation time of the rollout. Readonly.
  231. google.protobuf.Timestamp create_time = 2;
  232. // The user who created the Rollout. Readonly.
  233. string created_by = 3;
  234. // The status of this rollout. Readonly. In case of a failed rollout,
  235. // the system will automatically rollback to the current Rollout
  236. // version. Readonly.
  237. RolloutStatus status = 4;
  238. // Strategy that defines which versions of service configurations should be
  239. // pushed
  240. // and how they should be used at runtime.
  241. oneof strategy {
  242. // Google Service Control selects service configurations based on
  243. // traffic percentage.
  244. TrafficPercentStrategy traffic_percent_strategy = 5;
  245. // The strategy associated with a rollout to delete a `ManagedService`.
  246. // Readonly.
  247. DeleteServiceStrategy delete_service_strategy = 200;
  248. }
  249. // The name of the service associated with this Rollout.
  250. string service_name = 8;
  251. }