Publish resources.proto (#82)
This commit is contained in:
parent
428d15b369
commit
9f403f6d43
|
|
@ -0,0 +1,207 @@
|
|||
// 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.cloud.runtimeconfig.v1beta1;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/rpc/status.proto";
|
||||
|
||||
option java_multiple_files = true;
|
||||
option java_package = "com.google.cloud.runtimeconfig.v1beta1";
|
||||
|
||||
|
||||
// A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig
|
||||
// service. A RuntimeConfig resource consists of metadata and a hierarchy of
|
||||
// variables.
|
||||
message RuntimeConfig {
|
||||
// The resource name of a runtime config. The name must have the format:
|
||||
//
|
||||
// projects/[PROJECT_ID]/configs/[CONFIG_NAME]
|
||||
//
|
||||
// The `[PROJECT_ID]` must be a valid project ID, and `[CONFIG_NAME]` is an
|
||||
// arbitrary name that matches RFC 1035 segment specification. The length of
|
||||
// `[CONFIG_NAME]` must be less than 64 bytes.
|
||||
//
|
||||
// You pick the RuntimeConfig resource name, but the server will validate that
|
||||
// the name adheres to this format. After you create the resource, you cannot
|
||||
// change the resource's name.
|
||||
string name = 1;
|
||||
|
||||
// An optional description of the RuntimeConfig object.
|
||||
// The length of the description must be less than 256 bytes.
|
||||
string description = 2;
|
||||
}
|
||||
|
||||
// Describes a single variable within a RuntimeConfig resource.
|
||||
// The name denotes the hierarchical variable name. For example,
|
||||
// `ports/serving_port` is a valid variable name. The variable value is an
|
||||
// opaque string and only leaf variables can have values (that is, variables
|
||||
// that do not have any child variables).
|
||||
message Variable {
|
||||
// The name of the variable resource, in the format:
|
||||
//
|
||||
// projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]
|
||||
//
|
||||
// The `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a
|
||||
// valid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file system
|
||||
// file path naming.
|
||||
//
|
||||
// The `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes and
|
||||
// dashes. Slashes are used as path element separators and are not part of the
|
||||
// `[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least one
|
||||
// non-slash character. Multiple slashes are coalesced into single slash
|
||||
// character. Each path segment should follow RFC 1035 segment specification.
|
||||
// The length of a `[VARIABLE_NAME]` must be less than 256 bytes.
|
||||
//
|
||||
// Once you create a variable, you cannot change the variable name.
|
||||
string name = 1;
|
||||
|
||||
// The the value of the variable. It can be either a binary or a string
|
||||
// value. Specifying both will cause server to issue an error.
|
||||
oneof contents {
|
||||
// The binary value of the variable. The length of the value must be less
|
||||
// than 4096 bytes. Empty values are also accepted. The value must be
|
||||
// Base64 encoded.
|
||||
// NB: Only one of value and string_value can be set at the same time.
|
||||
bytes value = 2;
|
||||
|
||||
// The textual value of the variable. The length of the value must be less
|
||||
// than 4096 bytes. Empty values are also accepted.
|
||||
// NB: Only one of value and string_value can be set at the same time.
|
||||
string text = 5;
|
||||
}
|
||||
|
||||
// [Output Only] The time of the last variable update.
|
||||
google.protobuf.Timestamp update_time = 3;
|
||||
|
||||
// [Ouput only] The current state of the variable. The variable state indicates
|
||||
// the outcome of the `variables().watch` call and is visible through the
|
||||
// `get` and `list` calls.
|
||||
VariableState state = 4;
|
||||
}
|
||||
|
||||
// The condition that a Waiter resource is waiting for.
|
||||
message EndCondition {
|
||||
// A Cardinality condition for the Waiter resource. A cardinality condition is
|
||||
// met when the number of variables under a specified path prefix reaches a
|
||||
// predefined number. For example, if you set a Cardinality condition where
|
||||
// the `path` is set to `/foo` and the number of paths is set to 2, the
|
||||
// following variables would meet the condition in a RuntimeConfig resource:
|
||||
//
|
||||
// + `/foo/variable1 = "value1"`
|
||||
// + `/foo/variable2 = "value2"`
|
||||
// + `/bar/variable3 = "value3"`
|
||||
//
|
||||
// It would not would not satisify the same condition with the `number` set to
|
||||
// 3, however, because there is only 2 paths that start with `/foo`.
|
||||
// Cardinality conditions are recursive; all subtrees under the specific
|
||||
// path prefix are counted.
|
||||
message Cardinality {
|
||||
// The root of the variable subtree to monitor. For example, `/foo`.
|
||||
string path = 1;
|
||||
|
||||
// The number variables under the `path` that must exist to meet this
|
||||
// condition. Defaults to 1 if not specified.
|
||||
int32 number = 2;
|
||||
}
|
||||
|
||||
// The condition oneof holds the available condition types for this
|
||||
// EndCondition. Currently, the only available type is Cardinality.
|
||||
oneof condition {
|
||||
// The cardinality of the `EndCondition`.
|
||||
Cardinality cardinality = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// A Waiter resource waits for some end condition within a RuntimeConfig resource
|
||||
// to be met before it returns. For example, assume you have a distributed
|
||||
// system where each node writes to a Variable resource indidicating the node's
|
||||
// readiness as part of the startup process.
|
||||
//
|
||||
// You then configure a Waiter resource with the success condition set to wait
|
||||
// until some number of nodes have checked in. Afterwards, your application
|
||||
// runs some arbitrary code after the condition has been met and the waiter
|
||||
// returns successfully.
|
||||
//
|
||||
// Once created, a Waiter resource is immutable.
|
||||
//
|
||||
// To learn more about using waiters, read the
|
||||
// [Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter)
|
||||
// documentation.
|
||||
message Waiter {
|
||||
// The name of the Waiter resource, in the format:
|
||||
//
|
||||
// projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]
|
||||
//
|
||||
// The `[PROJECT_ID]` must be a valid Google Cloud project ID,
|
||||
// the `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the
|
||||
// `[WAITER_NAME]` must match RFC 1035 segment specification, and the length
|
||||
// of `[WAITER_NAME]` must be less than 64 bytes.
|
||||
//
|
||||
// After you create a Waiter resource, you cannot change the resource name.
|
||||
string name = 1;
|
||||
|
||||
// [Required] Specifies the timeout of the waiter in seconds, beginning from
|
||||
// the instant that `waiters().create` method is called. If this time elapses
|
||||
// before the success or failure conditions are met, the waiter fails and sets
|
||||
// the `error` code to `DEADLINE_EXCEEDED`.
|
||||
google.protobuf.Duration timeout = 2;
|
||||
|
||||
// [Optional] The failure condition of this waiter. If this condition is met,
|
||||
// `done` will be set to `true` and the `error` code will be set to `ABORTED`.
|
||||
// The failure condition takes precedence over the success condition. If both
|
||||
// conditions are met, a failure will be indicated. This value is optional; if
|
||||
// no failure condition is set, the only failure scenario will be a timeout.
|
||||
EndCondition failure = 3;
|
||||
|
||||
// [Required] The success condition. If this condition is met, `done` will be
|
||||
// set to `true` and the `error` value will remain unset. The failure condition
|
||||
// takes precedence over the success condition. If both conditions are met, a
|
||||
// failure will be indicated.
|
||||
EndCondition success = 4;
|
||||
|
||||
// [Output Only] The instant at which this Waiter resource was created. Adding
|
||||
// the value of `timeout` to this instant yields the timeout deadline for the
|
||||
// waiter.
|
||||
google.protobuf.Timestamp create_time = 5;
|
||||
|
||||
// [Output Only] If the value is `false`, it means the waiter is still waiting
|
||||
// for one of its conditions to be met.
|
||||
//
|
||||
// If true, the waiter has finished. If the waiter finished due to a timeout
|
||||
// or failure, `error` will be set.
|
||||
bool done = 6;
|
||||
|
||||
// [Output Only] If the waiter ended due to a failure or timeout, this value
|
||||
// will be set.
|
||||
google.rpc.Status error = 7;
|
||||
}
|
||||
|
||||
// The `VariableState` describes the last known state of the variable and is
|
||||
// used during a `variables().watch` call to distinguish the state of the
|
||||
// variable.
|
||||
enum VariableState {
|
||||
// Default variable state.
|
||||
VARIABLE_STATE_UNSPECIFIED = 0;
|
||||
|
||||
// The variable was updated, while `variables().watch` was executing.
|
||||
UPDATED = 1;
|
||||
|
||||
// The variable was deleted, while `variables().watch` was executing.
|
||||
DELETED = 2;
|
||||
}
|
||||
|
|
@ -43,18 +43,18 @@ service RuntimeConfigManager {
|
|||
}
|
||||
|
||||
// Gets information about a RuntimeConfig resource.
|
||||
rpc GetConfig(GetConfigRequest) returns (google.cloud.runtimeconfig.v1beta1.RuntimeConfig) {
|
||||
rpc GetConfig(GetConfigRequest) returns (RuntimeConfig) {
|
||||
option (google.api.http) = { get: "/v1beta1/{name=projects/*/configs/*}" };
|
||||
}
|
||||
|
||||
// Creates a new RuntimeConfig resource. The configuration name must be
|
||||
// unique within project.
|
||||
rpc CreateConfig(CreateConfigRequest) returns (google.cloud.runtimeconfig.v1beta1.RuntimeConfig) {
|
||||
rpc CreateConfig(CreateConfigRequest) returns (RuntimeConfig) {
|
||||
option (google.api.http) = { post: "/v1beta1/{parent=projects/*}/configs" body: "config" };
|
||||
}
|
||||
|
||||
// Updates a RuntimeConfig resource. The configuration must exist beforehand.
|
||||
rpc UpdateConfig(UpdateConfigRequest) returns (google.cloud.runtimeconfig.v1beta1.RuntimeConfig) {
|
||||
rpc UpdateConfig(UpdateConfigRequest) returns (RuntimeConfig) {
|
||||
option (google.api.http) = { put: "/v1beta1/{name=projects/*/configs/*}" body: "config" };
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ service RuntimeConfigManager {
|
|||
}
|
||||
|
||||
// Gets information about a single variable.
|
||||
rpc GetVariable(GetVariableRequest) returns (google.cloud.runtimeconfig.v1beta1.Variable) {
|
||||
rpc GetVariable(GetVariableRequest) returns (Variable) {
|
||||
option (google.api.http) = { get: "/v1beta1/{name=projects/*/configs/*/variables/**}" };
|
||||
}
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ service RuntimeConfigManager {
|
|||
// To learn more about creating a watcher, read the
|
||||
// [Watching a Variable for Changes](/deployment-manager/runtime-configurator/watching-a-variable)
|
||||
// documentation.
|
||||
rpc WatchVariable(WatchVariableRequest) returns (google.cloud.runtimeconfig.v1beta1.Variable) {
|
||||
rpc WatchVariable(WatchVariableRequest) returns (Variable) {
|
||||
option (google.api.http) = { post: "/v1beta1/{name=projects/*/configs/*/variables/**}:watch" body: "*" };
|
||||
}
|
||||
|
||||
|
|
@ -98,12 +98,12 @@ service RuntimeConfigManager {
|
|||
// To learn more about creating a variable, read the
|
||||
// [Setting and Getting Data](/deployment-manager/runtime-configurator/set-and-get-variables)
|
||||
// documentation.
|
||||
rpc CreateVariable(CreateVariableRequest) returns (google.cloud.runtimeconfig.v1beta1.Variable) {
|
||||
rpc CreateVariable(CreateVariableRequest) returns (Variable) {
|
||||
option (google.api.http) = { post: "/v1beta1/{parent=projects/*/configs/*}/variables" body: "variable" };
|
||||
}
|
||||
|
||||
// Updates an existing variable with a new value.
|
||||
rpc UpdateVariable(UpdateVariableRequest) returns (google.cloud.runtimeconfig.v1beta1.Variable) {
|
||||
rpc UpdateVariable(UpdateVariableRequest) returns (Variable) {
|
||||
option (google.api.http) = { put: "/v1beta1/{name=projects/*/configs/*/variables/**}" body: "variable" };
|
||||
}
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ service RuntimeConfigManager {
|
|||
}
|
||||
|
||||
// Gets information about a single waiter.
|
||||
rpc GetWaiter(GetWaiterRequest) returns (google.cloud.runtimeconfig.v1beta1.Waiter) {
|
||||
rpc GetWaiter(GetWaiterRequest) returns (Waiter) {
|
||||
option (google.api.http) = { get: "/v1beta1/{name=projects/*/configs/*/waiters/*}" };
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ message ListConfigsRequest {
|
|||
message ListConfigsResponse {
|
||||
// A list of the configurations in the project. The order of returned
|
||||
// objects is arbitrary; that is, it is not ordered in any particular way.
|
||||
repeated google.cloud.runtimeconfig.v1beta1.RuntimeConfig configs = 1;
|
||||
repeated RuntimeConfig configs = 1;
|
||||
|
||||
// This token allows you to get the next page of results for list requests.
|
||||
// If the number of results is larger than `pageSize`, use the `nextPageToken`
|
||||
|
|
@ -187,7 +187,7 @@ message CreateConfigRequest {
|
|||
string parent = 1;
|
||||
|
||||
// The RuntimeConfig to create.
|
||||
google.cloud.runtimeconfig.v1beta1.RuntimeConfig config = 2;
|
||||
RuntimeConfig config = 2;
|
||||
}
|
||||
|
||||
// Request message for `UpdateConfig()` method.
|
||||
|
|
@ -198,7 +198,7 @@ message UpdateConfigRequest {
|
|||
string name = 1;
|
||||
|
||||
// The config resource to update.
|
||||
google.cloud.runtimeconfig.v1beta1.RuntimeConfig config = 2;
|
||||
RuntimeConfig config = 2;
|
||||
}
|
||||
|
||||
// Request for the `DeleteConfig()` method.
|
||||
|
|
@ -235,7 +235,7 @@ message ListVariablesRequest {
|
|||
message ListVariablesResponse {
|
||||
// A list of variables and their values. The order of returned variable
|
||||
// objects is arbitrary.
|
||||
repeated google.cloud.runtimeconfig.v1beta1.Variable variables = 1;
|
||||
repeated Variable variables = 1;
|
||||
|
||||
// This token allows you to get the next page of results for list requests.
|
||||
// If the number of results is larger than `pageSize`, use the `nextPageToken`
|
||||
|
|
@ -278,7 +278,7 @@ message CreateVariableRequest {
|
|||
string parent = 1;
|
||||
|
||||
// The variable to create.
|
||||
google.cloud.runtimeconfig.v1beta1.Variable variable = 2;
|
||||
Variable variable = 2;
|
||||
}
|
||||
|
||||
// Request for the `UpdateVariable()` method.
|
||||
|
|
@ -289,7 +289,7 @@ message UpdateVariableRequest {
|
|||
string name = 1;
|
||||
|
||||
// The variable to update.
|
||||
google.cloud.runtimeconfig.v1beta1.Variable variable = 2;
|
||||
Variable variable = 2;
|
||||
}
|
||||
|
||||
// Request for the `DeleteVariable()` method.
|
||||
|
|
@ -325,7 +325,7 @@ message ListWaitersRequest {
|
|||
// Order of returned waiter objects is arbitrary.
|
||||
message ListWaitersResponse {
|
||||
// Found waiters in the project.
|
||||
repeated google.cloud.runtimeconfig.v1beta1.Waiter waiters = 1;
|
||||
repeated Waiter waiters = 1;
|
||||
|
||||
// This token allows you to get the next page of results for list requests.
|
||||
// If the number of results is larger than `pageSize`, use the `nextPageToken`
|
||||
|
|
@ -353,7 +353,7 @@ message CreateWaiterRequest {
|
|||
string parent = 1;
|
||||
|
||||
// The Waiter resource to create.
|
||||
google.cloud.runtimeconfig.v1beta1.Waiter waiter = 2;
|
||||
Waiter waiter = 2;
|
||||
}
|
||||
|
||||
// Request for the `DeleteWaiter()` method.
|
||||
|
|
|
|||
Loading…
Reference in New Issue