resources.proto 9.6 KB

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