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