aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/googleapis/google/api/servicemanagement/v1/resources.proto
blob: 0d0f34d62ef3cc6ab6dccbd3aecc87f5847c88f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.api.servicemanagement.v1;

import "google/api/annotations.proto";
import "google/api/config_change.proto";
import "google/api/service.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/any.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";
import "google/rpc/status.proto";

option go_package = "google.golang.org/genproto/googleapis/api/servicemanagement/v1;servicemanagement";
option java_multiple_files = true;
option java_outer_classname = "ResourcesProto";
option java_package = "com.google.api.servicemanagement.v1";
option objc_class_prefix = "GASM";


// The full representation of a Service that is managed by
// Google Service Management.
message ManagedService {
  // The name of the service. See the [overview](/service-management/overview)
  // for naming requirements.
  string service_name = 2;

  // ID of the project that produces and owns this service.
  string producer_project_id = 3;
}

// The metadata associated with a long running operation resource.
message OperationMetadata {
  // Represents the status of one operation step.
  message Step {
    // The short description of the step.
    string description = 2;

    // The status code.
    Status status = 4;
  }

  // Code describes the status of one operation step.
  enum Status {
    // Unspecifed code.
    STATUS_UNSPECIFIED = 0;

    // The step has completed without errors.
    DONE = 1;

    // The step has not started yet.
    NOT_STARTED = 2;

    // The step is in progress.
    IN_PROGRESS = 3;

    // The step has completed with errors.
    FAILED = 4;

    // The step has completed with cancellation.
    CANCELLED = 5;
  }

  // The full name of the resources that this operation is directly
  // associated with.
  repeated string resource_names = 1;

  // Detailed status information for each step. The order is undetermined.
  repeated Step steps = 2;

  // Percentage of completion of this operation, ranging from 0 to 100.
  int32 progress_percentage = 3;

  // The start time of the operation.
  google.protobuf.Timestamp start_time = 4;
}

// Represents a diagnostic message (error or warning)
message Diagnostic {
  // The kind of diagnostic information possible.
  enum Kind {
    // Warnings and errors
    WARNING = 0;

    // Only errors
    ERROR = 1;
  }

  // File name and line number of the error or warning.
  string location = 1;

  // The kind of diagnostic information provided.
  Kind kind = 2;

  // Message describing the error or warning.
  string message = 3;
}

// Represents a source file which is used to generate the service configuration
// defined by `google.api.Service`.
message ConfigSource {
  // A unique ID for a specific instance of this message, typically assigned
  // by the client for tracking purpose. If empty, the server may choose to
  // generate one instead.
  string id = 5;

  // Set of source configuration files that are used to generate a service
  // configuration (`google.api.Service`).
  repeated ConfigFile files = 2;
}

// Generic specification of a source configuration file
message ConfigFile {
  enum FileType {
    // Unknown file type.
    FILE_TYPE_UNSPECIFIED = 0;

    // YAML-specification of service.
    SERVICE_CONFIG_YAML = 1;

    // OpenAPI specification, serialized in JSON.
    OPEN_API_JSON = 2;

    // OpenAPI specification, serialized in YAML.
    OPEN_API_YAML = 3;

    // FileDescriptorSet, generated by protoc.
    //
    // To generate, use protoc with imports and source info included.
    // For an example test.proto file, the following command would put the value
    // in a new file named out.pb.
    //
    // $protoc --include_imports --include_source_info test.proto -o out.pb
    FILE_DESCRIPTOR_SET_PROTO = 4;
  }

  // The file name of the configuration file (full or relative path).
  string file_path = 1;

  // The bytes that constitute the file.
  bytes file_contents = 3;

  // The type of configuration file this represents.
  FileType file_type = 4;
}

// Represents a service configuration with its name and id.
message ConfigRef {
  // Resource name of a service config. It must have the following
  // format: "services/{service name}/configs/{config id}".
  string name = 1;
}

// Change report associated with a particular service configuration.
//
// It contains a list of ConfigChanges based on the comparison between
// two service configurations.
message ChangeReport {
  // List of changes between two service configurations.
  // The changes will be alphabetically sorted based on the identifier
  // of each change.
  // A ConfigChange identifier is a dot separated path to the configuration.
  // Example: visibility.rules[selector='LibraryService.CreateBook'].restriction
  repeated google.api.ConfigChange config_changes = 1;
}

// A rollout resource that defines how service configuration versions are pushed
// to control plane systems. Typically, you create a new version of the
// service config, and then create a Rollout to push the service config.
message Rollout {
  // Strategy that specifies how Google Service Control should select
  // different
  // versions of service configurations based on traffic percentage.
  //
  // One example of how to gradually rollout a new service configuration using
  // this
  // strategy:
  // Day 1
  //
  //     Rollout {
  //       id: "example.googleapis.com/rollout_20160206"
  //       traffic_percent_strategy {
  //         percentages: {
  //           "example.googleapis.com/20160201": 70.00
  //           "example.googleapis.com/20160206": 30.00
  //         }
  //       }
  //     }
  //
  // Day 2
  //
  //     Rollout {
  //       id: "example.googleapis.com/rollout_20160207"
  //       traffic_percent_strategy: {
  //         percentages: {
  //           "example.googleapis.com/20160206": 100.00
  //         }
  //       }
  //     }
  message TrafficPercentStrategy {
    // Maps service configuration IDs to their corresponding traffic percentage.
    // Key is the service configuration ID, Value is the traffic percentage
    // which must be greater than 0.0 and the sum must equal to 100.0.
    map<string, double> percentages = 1;
  }

  // Strategy used to delete a service. This strategy is a placeholder only
  // used by the system generated rollout to delete a service.
  message DeleteServiceStrategy {

  }

  // Status of a Rollout.
  enum RolloutStatus {
    // No status specified.
    ROLLOUT_STATUS_UNSPECIFIED = 0;

    // The Rollout is in progress.
    IN_PROGRESS = 1;

    // The Rollout has completed successfully.
    SUCCESS = 2;

    // The Rollout has been cancelled. This can happen if you have overlapping
    // Rollout pushes, and the previous ones will be cancelled.
    CANCELLED = 3;

    // The Rollout has failed. It is typically caused by configuration errors.
    FAILED = 4;

    // The Rollout has not started yet and is pending for execution.
    PENDING = 5;
  }

  // Optional unique identifier of this Rollout. Only lower case letters, digits
  //  and '-' are allowed.
  //
  // If not specified by client, the server will generate one. The generated id
  // will have the form of <date><revision number>, where "date" is the create
  // date in ISO 8601 format.  "revision number" is a monotonically increasing
  // positive number that is reset every day for each service.
  // An example of the generated rollout_id is '2016-02-16r1'
  string rollout_id = 1;

  // Creation time of the rollout. Readonly.
  google.protobuf.Timestamp create_time = 2;

  // The user who created the Rollout. Readonly.
  string created_by = 3;

  // The status of this rollout. Readonly. In case of a failed rollout,
  // the system will automatically rollback to the current Rollout
  // version. Readonly.
  RolloutStatus status = 4;

  // Strategy that defines which versions of service configurations should be
  // pushed
  // and how they should be used at runtime.
  oneof strategy {
    // Google Service Control selects service configurations based on
    // traffic percentage.
    TrafficPercentStrategy traffic_percent_strategy = 5;

    // The strategy associated with a rollout to delete a `ManagedService`.
    // Readonly.
    DeleteServiceStrategy delete_service_strategy = 200;
  }

  // The name of the service associated with this Rollout.
  string service_name = 8;
}