rcloadenv 0.0.1.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +9 -0
- data/CHANGELOG.md +6 -0
- data/README.md +132 -0
- data/bin/rcloadenv +29 -0
- data/lib/rcloadenv.rb +30 -0
- data/lib/rcloadenv/api_client.rb +24 -0
- data/lib/rcloadenv/cli.rb +83 -0
- data/lib/rcloadenv/credentials.rb +28 -0
- data/lib/rcloadenv/google/apis/runtimeconfig_v1beta1.rb +44 -0
- data/lib/rcloadenv/google/apis/runtimeconfig_v1beta1/classes.rb +805 -0
- data/lib/rcloadenv/google/apis/runtimeconfig_v1beta1/representations.rb +280 -0
- data/lib/rcloadenv/google/apis/runtimeconfig_v1beta1/service.rb +903 -0
- data/lib/rcloadenv/loader.rb +158 -0
- data/lib/rcloadenv/version.rb +21 -0
- metadata +173 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7a87297ed8dee36a3aed034991042cd36fca122b
|
4
|
+
data.tar.gz: 1714fafa57d7e35fe6f5a258a5ffd939f7253bce
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 3f8cc786c9a142a0d7381488b9d8282d4507bceb9e9b3c14b0b4e0597f6be5dff2ce2dd4590a4b5b2aad093a37dc34f32479dccf73d28f83ff27edb51ebda12d
|
7
|
+
data.tar.gz: 977c7bb995baa901fb36934b4d5f9ec552047d2778d3e7212c207307760748eae840d77d3ea385d70944b1bce34e56b5b2b5fe7546a4f63368bd8c2d9083a128
|
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
data/README.md
ADDED
@@ -0,0 +1,132 @@
|
|
1
|
+
# Ruby implementation of rcloadenv
|
2
|
+
|
3
|
+
`rcloadenv` is a tool for loading configuration from the [Runtime Config
|
4
|
+
API](https://cloud.google.com/deployment-manager/runtime-configurator/).
|
5
|
+
|
6
|
+
This is a Ruby implementation that may be installed as a Rubygem.
|
7
|
+
|
8
|
+
## Usage
|
9
|
+
|
10
|
+
Install the gem using
|
11
|
+
|
12
|
+
gem install rcloadenv
|
13
|
+
|
14
|
+
Alternately, include "rcloadenv" in your bundle.
|
15
|
+
|
16
|
+
You may then invoke the "rcloadenv" binary. You must pass the name of the
|
17
|
+
runtime config resource, and then the command to execute. For example:
|
18
|
+
|
19
|
+
bundle exec rcloadenv my-config -- bin/rails s
|
20
|
+
|
21
|
+
If `rcloadenv` is run on Google Cloud Platform hosting (such as Google Compute
|
22
|
+
Engine, Container Engine, or App Engine), then it infers the project name and
|
23
|
+
credentials from the hosting environment.
|
24
|
+
|
25
|
+
If you are not running on GCP, you may set the project using the `--project`
|
26
|
+
switch, or by setting the `GOOGLE_CLOUD_PROJECT` environment variable. For
|
27
|
+
example:
|
28
|
+
|
29
|
+
bundle exec rcloadenv --project=my-project my-config -- bin/rails s
|
30
|
+
|
31
|
+
Run `rcloadenv --help` for more information on flags you can set.
|
32
|
+
When not running on GCP, credentials are obtained from
|
33
|
+
[Application Default Credentials](https://developers.google.com/identity/protocols/application-default-credentials)
|
34
|
+
so you can the `GOOGLE_APPLICATION_CREDENTIALS` environment variable or
|
35
|
+
configure `gcloud auth`.
|
36
|
+
|
37
|
+
## Example: Loading the Rails SECRET_KEY in Google App Engine
|
38
|
+
|
39
|
+
This gem is commonly used to provide sensitive information such as API keys or
|
40
|
+
database passwords to a Ruby application deployed to Google Cloud Platform,
|
41
|
+
without exposing them to configuration files checked into source control.
|
42
|
+
|
43
|
+
For example, Rails applications require the environment variable `SECRET_KEY`
|
44
|
+
to be set in the production environment. When deploying a Rails application to
|
45
|
+
Google App Engine, you could set this environment variable in the "app.yaml"
|
46
|
+
configuration file, but that is not recommended because the "app.yaml" file
|
47
|
+
is commonly checked into source control. Instead, you can set the `SECRET_KEY`
|
48
|
+
value securely in the Runtime Config service, and use `rcloadenv` to load it
|
49
|
+
into the Rails app. Here's how.
|
50
|
+
|
51
|
+
1. We will assume that:
|
52
|
+
|
53
|
+
* You have a Ruby on Rails application
|
54
|
+
* You have a Google Cloud App Engine project to deploy it to
|
55
|
+
* You have installed the Google Cloud SDK, have logged in, and have
|
56
|
+
set your project name in the configuration.
|
57
|
+
|
58
|
+
See https://cloud.google.com/ruby for more information on deploying a
|
59
|
+
Ruby application to Google App Engine.
|
60
|
+
|
61
|
+
2. Enable the Runtime Config API for your project using the Google Cloud
|
62
|
+
Console (https://console.cloud.google.com/). To do so, navigate to
|
63
|
+
https://console.cloud.google.com/apis/api/runtimeconfig.googleapis.com/overview
|
64
|
+
choose the correct project and click "Enable".
|
65
|
+
|
66
|
+
3. Use the gcloud command line to create a Runtime Configuration:
|
67
|
+
|
68
|
+
gcloud beta runtime-config configs create my-config
|
69
|
+
|
70
|
+
Choose a name for your configuration and replace `my-config` with that
|
71
|
+
name. Any keys you set in this configuration will be loaded as environment
|
72
|
+
variables in your application.
|
73
|
+
|
74
|
+
Because you will be storing sensitive information in this configuration
|
75
|
+
resource, you may consider restricting access to it. See
|
76
|
+
https://cloud.google.com/deployment-manager/runtime-configurator/access-control
|
77
|
+
for more information. If you do so, make sure any service accounts that
|
78
|
+
run `rcloadenv` retain access to the resource. That includes the App Engine
|
79
|
+
service account (which runs your application in App Engine) and the
|
80
|
+
Cloud Build service account (which performs build steps such as asset
|
81
|
+
precompilation for your application).
|
82
|
+
|
83
|
+
4. Create a secret key
|
84
|
+
|
85
|
+
bundle exec rake secret
|
86
|
+
|
87
|
+
This will generate a random key and print it to the console.
|
88
|
+
|
89
|
+
5. Use the gcloud command line to set the `SECRET_KEY` in your configuration.
|
90
|
+
|
91
|
+
gcloud beta runtime-config configs variables set SECRET_KEY 12345678 \
|
92
|
+
--config-name=my-config
|
93
|
+
|
94
|
+
Replace `my-config` with the name of your configuration, and `12345678`
|
95
|
+
with the secret key that you generated above.
|
96
|
+
|
97
|
+
6. Add the `rcloadenv` gem to your Gemfile, and run `bundle install` to update
|
98
|
+
your bundle.
|
99
|
+
|
100
|
+
7. Now set the entrypoint in your "app.yaml" configuration file to load the
|
101
|
+
Runtime Configuration into environment variables using `rcloadenv`. For
|
102
|
+
example, if entrypoint would normally be:
|
103
|
+
|
104
|
+
bundle exec bin/rails s
|
105
|
+
|
106
|
+
Then change it to:
|
107
|
+
|
108
|
+
bundle exec rcloadenv my-config -- bin/rails s
|
109
|
+
|
110
|
+
Replace `my-config` with the name of your configuration.
|
111
|
+
|
112
|
+
(If you previously set SECRET_KEY in the env_variables section of your
|
113
|
+
app.yaml, remove it. You no longer need it!)
|
114
|
+
|
115
|
+
Now when you deploy and run your application, it should load the
|
116
|
+
SECRET_KEY value from your Runtime Configuration.
|
117
|
+
|
118
|
+
8. If you have set any custom build steps for your application that require
|
119
|
+
this configuration, make sure you update them too. For example, you might
|
120
|
+
use the following to build rails assets:
|
121
|
+
|
122
|
+
bundle exec rcloadenv my-config -- rake assets:precompile
|
123
|
+
|
124
|
+
You may set additional environment variables, such as database names and
|
125
|
+
passwords, in this config as well, whether or not they are sensitive. It's a
|
126
|
+
useful way to manage your application's configuration independent of its
|
127
|
+
source code and config files.
|
128
|
+
|
129
|
+
## More info
|
130
|
+
|
131
|
+
More info can be found in the general cross-language rcloadenv README at
|
132
|
+
https://github.com/GoogleCloudPlatform/rcloadenv
|
data/bin/rcloadenv
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# Copyright 2017 Google Inc.
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
begin
|
18
|
+
require "rcloadenv"
|
19
|
+
rescue LoadError
|
20
|
+
# If the gem is not installed, attempt to use the library from local source
|
21
|
+
# (i.e. for local testing).
|
22
|
+
path = File.dirname ::File.dirname __FILE__
|
23
|
+
path = File.join path, "lib"
|
24
|
+
$:.unshift path
|
25
|
+
require "rcloadenv"
|
26
|
+
end
|
27
|
+
|
28
|
+
cli = RCLoadEnv::CLI.new ARGV
|
29
|
+
cli.run
|
data/lib/rcloadenv.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Copyright 2017 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
|
+
|
16
|
+
require "optparse"
|
17
|
+
|
18
|
+
##
|
19
|
+
# # Ruby implementation of rcloadenv
|
20
|
+
#
|
21
|
+
# See https://github.com/GoogleCloudPlatform/rcloadenv for more information
|
22
|
+
# on this tool.
|
23
|
+
#
|
24
|
+
module RCLoadEnv
|
25
|
+
end
|
26
|
+
|
27
|
+
require "rcloadenv/cli"
|
28
|
+
require "rcloadenv/credentials"
|
29
|
+
require "rcloadenv/loader"
|
30
|
+
require "rcloadenv/version"
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Copyright 2017 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
|
+
|
16
|
+
# As of google-api-client 0.13.1 (July 2017) there isn't a client for
|
17
|
+
# RuntimeConfig V1beta1, but there might be in the future. So first we attempt
|
18
|
+
# to load a client from google-api-client, but if it doesn't exist, we use
|
19
|
+
# a vendored client we generated on 2017-07-19.
|
20
|
+
begin
|
21
|
+
require "google/apis/runtimeconfig_v1beta1"
|
22
|
+
rescue LoadError
|
23
|
+
require "rcloadenv/google/apis/runtimeconfig_v1beta1"
|
24
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# Copyright 2017 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
|
+
|
16
|
+
require "optparse"
|
17
|
+
|
18
|
+
module RCLoadEnv
|
19
|
+
|
20
|
+
##
|
21
|
+
# Implementation of the rcloadenv command line.
|
22
|
+
#
|
23
|
+
class CLI
|
24
|
+
|
25
|
+
##
|
26
|
+
# Create a command line handler.
|
27
|
+
#
|
28
|
+
# @param [Array<String>] args Command-line arguments
|
29
|
+
#
|
30
|
+
def initialize args
|
31
|
+
@project = nil
|
32
|
+
@exclude = []
|
33
|
+
@include = []
|
34
|
+
@override = false
|
35
|
+
@debug = false
|
36
|
+
parser = OptionParser.new do |opts|
|
37
|
+
opts.banner = "Usage: rcloadenv [options] <config-name> -- <command>"
|
38
|
+
opts.on "-p name", "--project=name", "--projectId=name",
|
39
|
+
"Project to read runtime config from" do |p|
|
40
|
+
@project = p
|
41
|
+
end
|
42
|
+
opts.on "-E key1,key2,key3", "--except=key1,key2,key3",
|
43
|
+
"Runtime-config variables to exclude, comma delimited" do |v|
|
44
|
+
@exclude += v.split ","
|
45
|
+
end
|
46
|
+
opts.on "-O key1,key2,key3", "--only=key1,key2,key3",
|
47
|
+
"Runtime-config variables to include, comma delimited" do |v|
|
48
|
+
@include += v.split ","
|
49
|
+
end
|
50
|
+
opts.on "-o", "--override",
|
51
|
+
"Cause config to override existing environment variables" do
|
52
|
+
@override = true
|
53
|
+
end
|
54
|
+
opts.on "-d", "--debug", "Enable debug output" do
|
55
|
+
@debug = true
|
56
|
+
end
|
57
|
+
opts.on "-?", "--help", "Show the help text and exit" do
|
58
|
+
puts parser.help
|
59
|
+
exit
|
60
|
+
end
|
61
|
+
end
|
62
|
+
@command_list = parser.parse args
|
63
|
+
@config_name = @command_list.shift
|
64
|
+
unless @config_name && @command_list.size > 0
|
65
|
+
STDERR.puts "rcloadenv: config name and command are both required."
|
66
|
+
STDERR.puts parser.help
|
67
|
+
exit 1
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
##
|
72
|
+
# Run the command line handler. This method either never returns or throws
|
73
|
+
# an exception.
|
74
|
+
#
|
75
|
+
def run
|
76
|
+
loader = RCLoadEnv::Loader.new @config_name,
|
77
|
+
exclude: @exclude, include: @include, override: @override,
|
78
|
+
project: @project, debug: @debug
|
79
|
+
loader.modify_env ENV
|
80
|
+
exec(*@command_list)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copyright 2017 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
|
+
|
16
|
+
require "rcloadenv/api_client"
|
17
|
+
require "google/cloud/credentials"
|
18
|
+
|
19
|
+
module RCLoadEnv
|
20
|
+
##
|
21
|
+
# @private Represents the OAuth 2.0 signing logic for Runtime Config.
|
22
|
+
#
|
23
|
+
class Credentials < Google::Cloud::Credentials
|
24
|
+
SCOPE = [Google::Apis::RuntimeconfigV1beta1::AUTH_CLOUDRUNTIMECONFIG]
|
25
|
+
PATH_ENV_VARS = %w(GOOGLE_CLOUD_KEYFILE GCLOUD_KEYFILE)
|
26
|
+
JSON_ENV_VARS = %w(GOOGLE_CLOUD_KEYFILE_JSON GCLOUD_KEYFILE_JSON)
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Copyright 2015 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
|
+
# Note this is a vendored copy of this class, generated 2017-07-19 alongside
|
16
|
+
# google-api-client 0.13.1.
|
17
|
+
|
18
|
+
# Vendored location: "rcloadenv/google/apis/runtimeconfig_v1beta1"
|
19
|
+
require 'rcloadenv/google/apis/runtimeconfig_v1beta1/service.rb'
|
20
|
+
require 'rcloadenv/google/apis/runtimeconfig_v1beta1/classes.rb'
|
21
|
+
require 'rcloadenv/google/apis/runtimeconfig_v1beta1/representations.rb'
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Apis
|
25
|
+
# Google Cloud Runtime Configuration API
|
26
|
+
#
|
27
|
+
# The Runtime Configurator allows you to dynamically configure and expose
|
28
|
+
# variables through Google Cloud Platform. In addition, you can also set
|
29
|
+
# Watchers and Waiters that will watch for changes to your data and return based
|
30
|
+
# on certain conditions.
|
31
|
+
#
|
32
|
+
# @see https://cloud.google.com/deployment-manager/runtime-configurator/
|
33
|
+
module RuntimeconfigV1beta1
|
34
|
+
VERSION = 'V1beta1'
|
35
|
+
REVISION = '20170620'
|
36
|
+
|
37
|
+
# View and manage your data across Google Cloud Platform services
|
38
|
+
AUTH_CLOUD_PLATFORM = 'https://www.googleapis.com/auth/cloud-platform'
|
39
|
+
|
40
|
+
# Manage your Google Cloud Platform services' runtime configuration
|
41
|
+
AUTH_CLOUDRUNTIMECONFIG = 'https://www.googleapis.com/auth/cloudruntimeconfig'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,805 @@
|
|
1
|
+
# Copyright 2015 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
|
+
require 'date'
|
16
|
+
require 'google/apis/core/base_service'
|
17
|
+
require 'google/apis/core/json_representation'
|
18
|
+
require 'google/apis/core/hashable'
|
19
|
+
require 'google/apis/errors'
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Apis
|
23
|
+
module RuntimeconfigV1beta1
|
24
|
+
|
25
|
+
# Request message for `SetIamPolicy` method.
|
26
|
+
class SetIamPolicyRequest
|
27
|
+
include Google::Apis::Core::Hashable
|
28
|
+
|
29
|
+
# Defines an Identity and Access Management (IAM) policy. It is used to
|
30
|
+
# specify access control policies for Cloud Platform resources.
|
31
|
+
# A `Policy` consists of a list of `bindings`. A `Binding` binds a list of
|
32
|
+
# `members` to a `role`, where the members can be user accounts, Google groups,
|
33
|
+
# Google domains, and service accounts. A `role` is a named list of permissions
|
34
|
+
# defined by IAM.
|
35
|
+
# **Example**
|
36
|
+
# `
|
37
|
+
# "bindings": [
|
38
|
+
# `
|
39
|
+
# "role": "roles/owner",
|
40
|
+
# "members": [
|
41
|
+
# "user:mike@example.com",
|
42
|
+
# "group:admins@example.com",
|
43
|
+
# "domain:google.com",
|
44
|
+
# "serviceAccount:my-other-app@appspot.gserviceaccount.com",
|
45
|
+
# ]
|
46
|
+
# `,
|
47
|
+
# `
|
48
|
+
# "role": "roles/viewer",
|
49
|
+
# "members": ["user:sean@example.com"]
|
50
|
+
# `
|
51
|
+
# ]
|
52
|
+
# `
|
53
|
+
# For a description of IAM and its features, see the
|
54
|
+
# [IAM developer's guide](https://cloud.google.com/iam).
|
55
|
+
# Corresponds to the JSON property `policy`
|
56
|
+
# @return [Google::Apis::RuntimeconfigV1beta1::Policy]
|
57
|
+
attr_accessor :policy
|
58
|
+
|
59
|
+
def initialize(**args)
|
60
|
+
update!(**args)
|
61
|
+
end
|
62
|
+
|
63
|
+
# Update properties of this object
|
64
|
+
def update!(**args)
|
65
|
+
@policy = args[:policy] if args.key?(:policy)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# The `Status` type defines a logical error model that is suitable for different
|
70
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
71
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
72
|
+
# - Simple to use and understand for most users
|
73
|
+
# - Flexible enough to meet unexpected needs
|
74
|
+
# # Overview
|
75
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
76
|
+
# and error details. The error code should be an enum value of
|
77
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
78
|
+
# error message should be a developer-facing English message that helps
|
79
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
80
|
+
# error message is needed, put the localized message in the error details or
|
81
|
+
# localize it in the client. The optional error details may contain arbitrary
|
82
|
+
# information about the error. There is a predefined set of error detail types
|
83
|
+
# in the package `google.rpc` that can be used for common error conditions.
|
84
|
+
# # Language mapping
|
85
|
+
# The `Status` message is the logical representation of the error model, but it
|
86
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
87
|
+
# exposed in different client libraries and different wire protocols, it can be
|
88
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
89
|
+
# in Java, but more likely mapped to some error codes in C.
|
90
|
+
# # Other uses
|
91
|
+
# The error model and the `Status` message can be used in a variety of
|
92
|
+
# environments, either with or without APIs, to provide a
|
93
|
+
# consistent developer experience across different environments.
|
94
|
+
# Example uses of this error model include:
|
95
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
96
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
97
|
+
# errors.
|
98
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
99
|
+
# have a `Status` message for error reporting.
|
100
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
101
|
+
# `Status` message should be used directly inside batch response, one for
|
102
|
+
# each error sub-response.
|
103
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
104
|
+
# results in its response, the status of those operations should be
|
105
|
+
# represented directly using the `Status` message.
|
106
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
107
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
108
|
+
class Status
|
109
|
+
include Google::Apis::Core::Hashable
|
110
|
+
|
111
|
+
# A list of messages that carry the error details. There will be a
|
112
|
+
# common set of message types for APIs to use.
|
113
|
+
# Corresponds to the JSON property `details`
|
114
|
+
# @return [Array<Hash<String,Object>>]
|
115
|
+
attr_accessor :details
|
116
|
+
|
117
|
+
# The status code, which should be an enum value of google.rpc.Code.
|
118
|
+
# Corresponds to the JSON property `code`
|
119
|
+
# @return [Fixnum]
|
120
|
+
attr_accessor :code
|
121
|
+
|
122
|
+
# A developer-facing error message, which should be in English. Any
|
123
|
+
# user-facing error message should be localized and sent in the
|
124
|
+
# google.rpc.Status.details field, or localized by the client.
|
125
|
+
# Corresponds to the JSON property `message`
|
126
|
+
# @return [String]
|
127
|
+
attr_accessor :message
|
128
|
+
|
129
|
+
def initialize(**args)
|
130
|
+
update!(**args)
|
131
|
+
end
|
132
|
+
|
133
|
+
# Update properties of this object
|
134
|
+
def update!(**args)
|
135
|
+
@details = args[:details] if args.key?(:details)
|
136
|
+
@code = args[:code] if args.key?(:code)
|
137
|
+
@message = args[:message] if args.key?(:message)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
# Associates `members` with a `role`.
|
142
|
+
class Binding
|
143
|
+
include Google::Apis::Core::Hashable
|
144
|
+
|
145
|
+
# Specifies the identities requesting access for a Cloud Platform resource.
|
146
|
+
# `members` can have the following values:
|
147
|
+
# * `allUsers`: A special identifier that represents anyone who is
|
148
|
+
# on the internet; with or without a Google account.
|
149
|
+
# * `allAuthenticatedUsers`: A special identifier that represents anyone
|
150
|
+
# who is authenticated with a Google account or a service account.
|
151
|
+
# * `user:`emailid``: An email address that represents a specific Google
|
152
|
+
# account. For example, `alice@gmail.com` or `joe@example.com`.
|
153
|
+
# * `serviceAccount:`emailid``: An email address that represents a service
|
154
|
+
# account. For example, `my-other-app@appspot.gserviceaccount.com`.
|
155
|
+
# * `group:`emailid``: An email address that represents a Google group.
|
156
|
+
# For example, `admins@example.com`.
|
157
|
+
# * `domain:`domain``: A Google Apps domain name that represents all the
|
158
|
+
# users of that domain. For example, `google.com` or `example.com`.
|
159
|
+
# Corresponds to the JSON property `members`
|
160
|
+
# @return [Array<String>]
|
161
|
+
attr_accessor :members
|
162
|
+
|
163
|
+
# Role that is assigned to `members`.
|
164
|
+
# For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
|
165
|
+
# Required
|
166
|
+
# Corresponds to the JSON property `role`
|
167
|
+
# @return [String]
|
168
|
+
attr_accessor :role
|
169
|
+
|
170
|
+
def initialize(**args)
|
171
|
+
update!(**args)
|
172
|
+
end
|
173
|
+
|
174
|
+
# Update properties of this object
|
175
|
+
def update!(**args)
|
176
|
+
@members = args[:members] if args.key?(:members)
|
177
|
+
@role = args[:role] if args.key?(:role)
|
178
|
+
end
|
179
|
+
end
|
180
|
+
|
181
|
+
# A generic empty message that you can re-use to avoid defining duplicated
|
182
|
+
# empty messages in your APIs. A typical example is to use it as the request
|
183
|
+
# or the response type of an API method. For instance:
|
184
|
+
# service Foo `
|
185
|
+
# rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
186
|
+
# `
|
187
|
+
# The JSON representation for `Empty` is empty JSON object ````.
|
188
|
+
class Empty
|
189
|
+
include Google::Apis::Core::Hashable
|
190
|
+
|
191
|
+
def initialize(**args)
|
192
|
+
update!(**args)
|
193
|
+
end
|
194
|
+
|
195
|
+
# Update properties of this object
|
196
|
+
def update!(**args)
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# A Cardinality condition for the Waiter resource. A cardinality condition is
|
201
|
+
# met when the number of variables under a specified path prefix reaches a
|
202
|
+
# predefined number. For example, if you set a Cardinality condition where
|
203
|
+
# the `path` is set to `/foo` and the number of paths is set to 2, the
|
204
|
+
# following variables would meet the condition in a RuntimeConfig resource:
|
205
|
+
# + `/foo/variable1 = "value1"`
|
206
|
+
# + `/foo/variable2 = "value2"`
|
207
|
+
# + `/bar/variable3 = "value3"`
|
208
|
+
# It would not would not satisify the same condition with the `number` set to
|
209
|
+
# 3, however, because there is only 2 paths that start with `/foo`.
|
210
|
+
# Cardinality conditions are recursive; all subtrees under the specific
|
211
|
+
# path prefix are counted.
|
212
|
+
class Cardinality
|
213
|
+
include Google::Apis::Core::Hashable
|
214
|
+
|
215
|
+
# The number variables under the `path` that must exist to meet this
|
216
|
+
# condition. Defaults to 1 if not specified.
|
217
|
+
# Corresponds to the JSON property `number`
|
218
|
+
# @return [Fixnum]
|
219
|
+
attr_accessor :number
|
220
|
+
|
221
|
+
# The root of the variable subtree to monitor. For example, `/foo`.
|
222
|
+
# Corresponds to the JSON property `path`
|
223
|
+
# @return [String]
|
224
|
+
attr_accessor :path
|
225
|
+
|
226
|
+
def initialize(**args)
|
227
|
+
update!(**args)
|
228
|
+
end
|
229
|
+
|
230
|
+
# Update properties of this object
|
231
|
+
def update!(**args)
|
232
|
+
@number = args[:number] if args.key?(:number)
|
233
|
+
@path = args[:path] if args.key?(:path)
|
234
|
+
end
|
235
|
+
end
|
236
|
+
|
237
|
+
# `ListConfigs()` returns the following response. The order of returned
|
238
|
+
# objects is arbitrary; that is, it is not ordered in any particular way.
|
239
|
+
class ListConfigsResponse
|
240
|
+
include Google::Apis::Core::Hashable
|
241
|
+
|
242
|
+
# A list of the configurations in the project. The order of returned
|
243
|
+
# objects is arbitrary; that is, it is not ordered in any particular way.
|
244
|
+
# Corresponds to the JSON property `configs`
|
245
|
+
# @return [Array<Google::Apis::RuntimeconfigV1beta1::RuntimeConfig>]
|
246
|
+
attr_accessor :configs
|
247
|
+
|
248
|
+
# This token allows you to get the next page of results for list requests.
|
249
|
+
# If the number of results is larger than `pageSize`, use the `nextPageToken`
|
250
|
+
# as a value for the query parameter `pageToken` in the next list request.
|
251
|
+
# Subsequent list requests will have their own `nextPageToken` to continue
|
252
|
+
# paging through the results
|
253
|
+
# Corresponds to the JSON property `nextPageToken`
|
254
|
+
# @return [String]
|
255
|
+
attr_accessor :next_page_token
|
256
|
+
|
257
|
+
def initialize(**args)
|
258
|
+
update!(**args)
|
259
|
+
end
|
260
|
+
|
261
|
+
# Update properties of this object
|
262
|
+
def update!(**args)
|
263
|
+
@configs = args[:configs] if args.key?(:configs)
|
264
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
265
|
+
end
|
266
|
+
end
|
267
|
+
|
268
|
+
# The condition that a Waiter resource is waiting for.
|
269
|
+
class EndCondition
|
270
|
+
include Google::Apis::Core::Hashable
|
271
|
+
|
272
|
+
# A Cardinality condition for the Waiter resource. A cardinality condition is
|
273
|
+
# met when the number of variables under a specified path prefix reaches a
|
274
|
+
# predefined number. For example, if you set a Cardinality condition where
|
275
|
+
# the `path` is set to `/foo` and the number of paths is set to 2, the
|
276
|
+
# following variables would meet the condition in a RuntimeConfig resource:
|
277
|
+
# + `/foo/variable1 = "value1"`
|
278
|
+
# + `/foo/variable2 = "value2"`
|
279
|
+
# + `/bar/variable3 = "value3"`
|
280
|
+
# It would not would not satisify the same condition with the `number` set to
|
281
|
+
# 3, however, because there is only 2 paths that start with `/foo`.
|
282
|
+
# Cardinality conditions are recursive; all subtrees under the specific
|
283
|
+
# path prefix are counted.
|
284
|
+
# Corresponds to the JSON property `cardinality`
|
285
|
+
# @return [Google::Apis::RuntimeconfigV1beta1::Cardinality]
|
286
|
+
attr_accessor :cardinality
|
287
|
+
|
288
|
+
def initialize(**args)
|
289
|
+
update!(**args)
|
290
|
+
end
|
291
|
+
|
292
|
+
# Update properties of this object
|
293
|
+
def update!(**args)
|
294
|
+
@cardinality = args[:cardinality] if args.key?(:cardinality)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
# Response message for `TestIamPermissions` method.
|
299
|
+
class TestIamPermissionsResponse
|
300
|
+
include Google::Apis::Core::Hashable
|
301
|
+
|
302
|
+
# A subset of `TestPermissionsRequest.permissions` that the caller is
|
303
|
+
# allowed.
|
304
|
+
# Corresponds to the JSON property `permissions`
|
305
|
+
# @return [Array<String>]
|
306
|
+
attr_accessor :permissions
|
307
|
+
|
308
|
+
def initialize(**args)
|
309
|
+
update!(**args)
|
310
|
+
end
|
311
|
+
|
312
|
+
# Update properties of this object
|
313
|
+
def update!(**args)
|
314
|
+
@permissions = args[:permissions] if args.key?(:permissions)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
# Response for the `ListVariables()` method.
|
319
|
+
class ListVariablesResponse
|
320
|
+
include Google::Apis::Core::Hashable
|
321
|
+
|
322
|
+
# This token allows you to get the next page of results for list requests.
|
323
|
+
# If the number of results is larger than `pageSize`, use the `nextPageToken`
|
324
|
+
# as a value for the query parameter `pageToken` in the next list request.
|
325
|
+
# Subsequent list requests will have their own `nextPageToken` to continue
|
326
|
+
# paging through the results
|
327
|
+
# Corresponds to the JSON property `nextPageToken`
|
328
|
+
# @return [String]
|
329
|
+
attr_accessor :next_page_token
|
330
|
+
|
331
|
+
# A list of variables and their values. The order of returned variable
|
332
|
+
# objects is arbitrary.
|
333
|
+
# Corresponds to the JSON property `variables`
|
334
|
+
# @return [Array<Google::Apis::RuntimeconfigV1beta1::Variable>]
|
335
|
+
attr_accessor :variables
|
336
|
+
|
337
|
+
def initialize(**args)
|
338
|
+
update!(**args)
|
339
|
+
end
|
340
|
+
|
341
|
+
# Update properties of this object
|
342
|
+
def update!(**args)
|
343
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
344
|
+
@variables = args[:variables] if args.key?(:variables)
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
# A RuntimeConfig resource is the primary resource in the Cloud RuntimeConfig
|
349
|
+
# service. A RuntimeConfig resource consists of metadata and a hierarchy of
|
350
|
+
# variables.
|
351
|
+
class RuntimeConfig
|
352
|
+
include Google::Apis::Core::Hashable
|
353
|
+
|
354
|
+
# The resource name of a runtime config. The name must have the format:
|
355
|
+
# projects/[PROJECT_ID]/configs/[CONFIG_NAME]
|
356
|
+
# The `[PROJECT_ID]` must be a valid project ID, and `[CONFIG_NAME]` is an
|
357
|
+
# arbitrary name that matches RFC 1035 segment specification. The length of
|
358
|
+
# `[CONFIG_NAME]` must be less than 64 bytes.
|
359
|
+
# You pick the RuntimeConfig resource name, but the server will validate that
|
360
|
+
# the name adheres to this format. After you create the resource, you cannot
|
361
|
+
# change the resource's name.
|
362
|
+
# Corresponds to the JSON property `name`
|
363
|
+
# @return [String]
|
364
|
+
attr_accessor :name
|
365
|
+
|
366
|
+
# An optional description of the RuntimeConfig object.
|
367
|
+
# Corresponds to the JSON property `description`
|
368
|
+
# @return [String]
|
369
|
+
attr_accessor :description
|
370
|
+
|
371
|
+
def initialize(**args)
|
372
|
+
update!(**args)
|
373
|
+
end
|
374
|
+
|
375
|
+
# Update properties of this object
|
376
|
+
def update!(**args)
|
377
|
+
@name = args[:name] if args.key?(:name)
|
378
|
+
@description = args[:description] if args.key?(:description)
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
382
|
+
# Request for the `WatchVariable()` method.
|
383
|
+
class WatchVariableRequest
|
384
|
+
include Google::Apis::Core::Hashable
|
385
|
+
|
386
|
+
# If specified, checks the current timestamp of the variable and if the
|
387
|
+
# current timestamp is newer than `newerThan` timestamp, the method returns
|
388
|
+
# immediately.
|
389
|
+
# If not specified or the variable has an older timestamp, the watcher waits
|
390
|
+
# for a the value to change before returning.
|
391
|
+
# Corresponds to the JSON property `newerThan`
|
392
|
+
# @return [String]
|
393
|
+
attr_accessor :newer_than
|
394
|
+
|
395
|
+
def initialize(**args)
|
396
|
+
update!(**args)
|
397
|
+
end
|
398
|
+
|
399
|
+
# Update properties of this object
|
400
|
+
def update!(**args)
|
401
|
+
@newer_than = args[:newer_than] if args.key?(:newer_than)
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
# Response for the `ListWaiters()` method.
|
406
|
+
# Order of returned waiter objects is arbitrary.
|
407
|
+
class ListWaitersResponse
|
408
|
+
include Google::Apis::Core::Hashable
|
409
|
+
|
410
|
+
# This token allows you to get the next page of results for list requests.
|
411
|
+
# If the number of results is larger than `pageSize`, use the `nextPageToken`
|
412
|
+
# as a value for the query parameter `pageToken` in the next list request.
|
413
|
+
# Subsequent list requests will have their own `nextPageToken` to continue
|
414
|
+
# paging through the results
|
415
|
+
# Corresponds to the JSON property `nextPageToken`
|
416
|
+
# @return [String]
|
417
|
+
attr_accessor :next_page_token
|
418
|
+
|
419
|
+
# Found waiters in the project.
|
420
|
+
# Corresponds to the JSON property `waiters`
|
421
|
+
# @return [Array<Google::Apis::RuntimeconfigV1beta1::Waiter>]
|
422
|
+
attr_accessor :waiters
|
423
|
+
|
424
|
+
def initialize(**args)
|
425
|
+
update!(**args)
|
426
|
+
end
|
427
|
+
|
428
|
+
# Update properties of this object
|
429
|
+
def update!(**args)
|
430
|
+
@next_page_token = args[:next_page_token] if args.key?(:next_page_token)
|
431
|
+
@waiters = args[:waiters] if args.key?(:waiters)
|
432
|
+
end
|
433
|
+
end
|
434
|
+
|
435
|
+
# Request message for `TestIamPermissions` method.
|
436
|
+
class TestIamPermissionsRequest
|
437
|
+
include Google::Apis::Core::Hashable
|
438
|
+
|
439
|
+
# The set of permissions to check for the `resource`. Permissions with
|
440
|
+
# wildcards (such as '*' or 'storage.*') are not allowed. For more
|
441
|
+
# information see
|
442
|
+
# [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
|
443
|
+
# Corresponds to the JSON property `permissions`
|
444
|
+
# @return [Array<String>]
|
445
|
+
attr_accessor :permissions
|
446
|
+
|
447
|
+
def initialize(**args)
|
448
|
+
update!(**args)
|
449
|
+
end
|
450
|
+
|
451
|
+
# Update properties of this object
|
452
|
+
def update!(**args)
|
453
|
+
@permissions = args[:permissions] if args.key?(:permissions)
|
454
|
+
end
|
455
|
+
end
|
456
|
+
|
457
|
+
# A Waiter resource waits for some end condition within a RuntimeConfig resource
|
458
|
+
# to be met before it returns. For example, assume you have a distributed
|
459
|
+
# system where each node writes to a Variable resource indidicating the node's
|
460
|
+
# readiness as part of the startup process.
|
461
|
+
# You then configure a Waiter resource with the success condition set to wait
|
462
|
+
# until some number of nodes have checked in. Afterwards, your application
|
463
|
+
# runs some arbitrary code after the condition has been met and the waiter
|
464
|
+
# returns successfully.
|
465
|
+
# Once created, a Waiter resource is immutable.
|
466
|
+
# To learn more about using waiters, read the
|
467
|
+
# [Creating a Waiter](/deployment-manager/runtime-configurator/creating-a-waiter)
|
468
|
+
# documentation.
|
469
|
+
class Waiter
|
470
|
+
include Google::Apis::Core::Hashable
|
471
|
+
|
472
|
+
# The `Status` type defines a logical error model that is suitable for different
|
473
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
474
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
475
|
+
# - Simple to use and understand for most users
|
476
|
+
# - Flexible enough to meet unexpected needs
|
477
|
+
# # Overview
|
478
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
479
|
+
# and error details. The error code should be an enum value of
|
480
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
481
|
+
# error message should be a developer-facing English message that helps
|
482
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
483
|
+
# error message is needed, put the localized message in the error details or
|
484
|
+
# localize it in the client. The optional error details may contain arbitrary
|
485
|
+
# information about the error. There is a predefined set of error detail types
|
486
|
+
# in the package `google.rpc` that can be used for common error conditions.
|
487
|
+
# # Language mapping
|
488
|
+
# The `Status` message is the logical representation of the error model, but it
|
489
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
490
|
+
# exposed in different client libraries and different wire protocols, it can be
|
491
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
492
|
+
# in Java, but more likely mapped to some error codes in C.
|
493
|
+
# # Other uses
|
494
|
+
# The error model and the `Status` message can be used in a variety of
|
495
|
+
# environments, either with or without APIs, to provide a
|
496
|
+
# consistent developer experience across different environments.
|
497
|
+
# Example uses of this error model include:
|
498
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
499
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
500
|
+
# errors.
|
501
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
502
|
+
# have a `Status` message for error reporting.
|
503
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
504
|
+
# `Status` message should be used directly inside batch response, one for
|
505
|
+
# each error sub-response.
|
506
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
507
|
+
# results in its response, the status of those operations should be
|
508
|
+
# represented directly using the `Status` message.
|
509
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
510
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
511
|
+
# Corresponds to the JSON property `error`
|
512
|
+
# @return [Google::Apis::RuntimeconfigV1beta1::Status]
|
513
|
+
attr_accessor :error
|
514
|
+
|
515
|
+
# The condition that a Waiter resource is waiting for.
|
516
|
+
# Corresponds to the JSON property `failure`
|
517
|
+
# @return [Google::Apis::RuntimeconfigV1beta1::EndCondition]
|
518
|
+
attr_accessor :failure
|
519
|
+
|
520
|
+
# The condition that a Waiter resource is waiting for.
|
521
|
+
# Corresponds to the JSON property `success`
|
522
|
+
# @return [Google::Apis::RuntimeconfigV1beta1::EndCondition]
|
523
|
+
attr_accessor :success
|
524
|
+
|
525
|
+
# [Output Only] If the value is `false`, it means the waiter is still waiting
|
526
|
+
# for one of its conditions to be met.
|
527
|
+
# If true, the waiter has finished. If the waiter finished due to a timeout
|
528
|
+
# or failure, `error` will be set.
|
529
|
+
# Corresponds to the JSON property `done`
|
530
|
+
# @return [Boolean]
|
531
|
+
attr_accessor :done
|
532
|
+
alias_method :done?, :done
|
533
|
+
|
534
|
+
# [Output Only] The instant at which this Waiter resource was created. Adding
|
535
|
+
# the value of `timeout` to this instant yields the timeout deadline for the
|
536
|
+
# waiter.
|
537
|
+
# Corresponds to the JSON property `createTime`
|
538
|
+
# @return [String]
|
539
|
+
attr_accessor :create_time
|
540
|
+
|
541
|
+
# [Required] Specifies the timeout of the waiter in seconds, beginning from
|
542
|
+
# the instant that `waiters().create` method is called. If this time elapses
|
543
|
+
# before the success or failure conditions are met, the waiter fails and sets
|
544
|
+
# the `error` code to `DEADLINE_EXCEEDED`.
|
545
|
+
# Corresponds to the JSON property `timeout`
|
546
|
+
# @return [String]
|
547
|
+
attr_accessor :timeout
|
548
|
+
|
549
|
+
# The name of the Waiter resource, in the format:
|
550
|
+
# projects/[PROJECT_ID]/configs/[CONFIG_NAME]/waiters/[WAITER_NAME]
|
551
|
+
# The `[PROJECT_ID]` must be a valid Google Cloud project ID,
|
552
|
+
# the `[CONFIG_NAME]` must be a valid RuntimeConfig resource, the
|
553
|
+
# `[WAITER_NAME]` must match RFC 1035 segment specification, and the length
|
554
|
+
# of `[WAITER_NAME]` must be less than 64 bytes.
|
555
|
+
# After you create a Waiter resource, you cannot change the resource name.
|
556
|
+
# Corresponds to the JSON property `name`
|
557
|
+
# @return [String]
|
558
|
+
attr_accessor :name
|
559
|
+
|
560
|
+
def initialize(**args)
|
561
|
+
update!(**args)
|
562
|
+
end
|
563
|
+
|
564
|
+
# Update properties of this object
|
565
|
+
def update!(**args)
|
566
|
+
@error = args[:error] if args.key?(:error)
|
567
|
+
@failure = args[:failure] if args.key?(:failure)
|
568
|
+
@success = args[:success] if args.key?(:success)
|
569
|
+
@done = args[:done] if args.key?(:done)
|
570
|
+
@create_time = args[:create_time] if args.key?(:create_time)
|
571
|
+
@timeout = args[:timeout] if args.key?(:timeout)
|
572
|
+
@name = args[:name] if args.key?(:name)
|
573
|
+
end
|
574
|
+
end
|
575
|
+
|
576
|
+
# Defines an Identity and Access Management (IAM) policy. It is used to
|
577
|
+
# specify access control policies for Cloud Platform resources.
|
578
|
+
# A `Policy` consists of a list of `bindings`. A `Binding` binds a list of
|
579
|
+
# `members` to a `role`, where the members can be user accounts, Google groups,
|
580
|
+
# Google domains, and service accounts. A `role` is a named list of permissions
|
581
|
+
# defined by IAM.
|
582
|
+
# **Example**
|
583
|
+
# `
|
584
|
+
# "bindings": [
|
585
|
+
# `
|
586
|
+
# "role": "roles/owner",
|
587
|
+
# "members": [
|
588
|
+
# "user:mike@example.com",
|
589
|
+
# "group:admins@example.com",
|
590
|
+
# "domain:google.com",
|
591
|
+
# "serviceAccount:my-other-app@appspot.gserviceaccount.com",
|
592
|
+
# ]
|
593
|
+
# `,
|
594
|
+
# `
|
595
|
+
# "role": "roles/viewer",
|
596
|
+
# "members": ["user:sean@example.com"]
|
597
|
+
# `
|
598
|
+
# ]
|
599
|
+
# `
|
600
|
+
# For a description of IAM and its features, see the
|
601
|
+
# [IAM developer's guide](https://cloud.google.com/iam).
|
602
|
+
class Policy
|
603
|
+
include Google::Apis::Core::Hashable
|
604
|
+
|
605
|
+
# `etag` is used for optimistic concurrency control as a way to help
|
606
|
+
# prevent simultaneous updates of a policy from overwriting each other.
|
607
|
+
# It is strongly suggested that systems make use of the `etag` in the
|
608
|
+
# read-modify-write cycle to perform policy updates in order to avoid race
|
609
|
+
# conditions: An `etag` is returned in the response to `getIamPolicy`, and
|
610
|
+
# systems are expected to put that etag in the request to `setIamPolicy` to
|
611
|
+
# ensure that their change will be applied to the same version of the policy.
|
612
|
+
# If no `etag` is provided in the call to `setIamPolicy`, then the existing
|
613
|
+
# policy is overwritten blindly.
|
614
|
+
# Corresponds to the JSON property `etag`
|
615
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
616
|
+
# @return [String]
|
617
|
+
attr_accessor :etag
|
618
|
+
|
619
|
+
# Version of the `Policy`. The default version is 0.
|
620
|
+
# Corresponds to the JSON property `version`
|
621
|
+
# @return [Fixnum]
|
622
|
+
attr_accessor :version
|
623
|
+
|
624
|
+
# Associates a list of `members` to a `role`.
|
625
|
+
# `bindings` with no members will result in an error.
|
626
|
+
# Corresponds to the JSON property `bindings`
|
627
|
+
# @return [Array<Google::Apis::RuntimeconfigV1beta1::Binding>]
|
628
|
+
attr_accessor :bindings
|
629
|
+
|
630
|
+
def initialize(**args)
|
631
|
+
update!(**args)
|
632
|
+
end
|
633
|
+
|
634
|
+
# Update properties of this object
|
635
|
+
def update!(**args)
|
636
|
+
@etag = args[:etag] if args.key?(:etag)
|
637
|
+
@version = args[:version] if args.key?(:version)
|
638
|
+
@bindings = args[:bindings] if args.key?(:bindings)
|
639
|
+
end
|
640
|
+
end
|
641
|
+
|
642
|
+
# Describes a single variable within a RuntimeConfig resource.
|
643
|
+
# The name denotes the hierarchical variable name. For example,
|
644
|
+
# `ports/serving_port` is a valid variable name. The variable value is an
|
645
|
+
# opaque string and only leaf variables can have values (that is, variables
|
646
|
+
# that do not have any child variables).
|
647
|
+
class Variable
|
648
|
+
include Google::Apis::Core::Hashable
|
649
|
+
|
650
|
+
# The binary value of the variable. The length of the value must be less
|
651
|
+
# than 4096 bytes. Empty values are also accepted. The value must be
|
652
|
+
# base64 encoded. Only one of `value` or `text` can be set.
|
653
|
+
# Corresponds to the JSON property `value`
|
654
|
+
# NOTE: Values are automatically base64 encoded/decoded in the client library.
|
655
|
+
# @return [String]
|
656
|
+
attr_accessor :value
|
657
|
+
|
658
|
+
# [Ouput only] The current state of the variable. The variable state indicates
|
659
|
+
# the outcome of the `variables().watch` call and is visible through the
|
660
|
+
# `get` and `list` calls.
|
661
|
+
# Corresponds to the JSON property `state`
|
662
|
+
# @return [String]
|
663
|
+
attr_accessor :state
|
664
|
+
|
665
|
+
# [Output Only] The time of the last variable update.
|
666
|
+
# Corresponds to the JSON property `updateTime`
|
667
|
+
# @return [String]
|
668
|
+
attr_accessor :update_time
|
669
|
+
|
670
|
+
# The name of the variable resource, in the format:
|
671
|
+
# projects/[PROJECT_ID]/configs/[CONFIG_NAME]/variables/[VARIABLE_NAME]
|
672
|
+
# The `[PROJECT_ID]` must be a valid project ID, `[CONFIG_NAME]` must be a
|
673
|
+
# valid RuntimeConfig reource and `[VARIABLE_NAME]` follows Unix file system
|
674
|
+
# file path naming.
|
675
|
+
# The `[VARIABLE_NAME]` can contain ASCII letters, numbers, slashes and
|
676
|
+
# dashes. Slashes are used as path element separators and are not part of the
|
677
|
+
# `[VARIABLE_NAME]` itself, so `[VARIABLE_NAME]` must contain at least one
|
678
|
+
# non-slash character. Multiple slashes are coalesced into single slash
|
679
|
+
# character. Each path segment should follow RFC 1035 segment specification.
|
680
|
+
# The length of a `[VARIABLE_NAME]` must be less than 256 bytes.
|
681
|
+
# Once you create a variable, you cannot change the variable name.
|
682
|
+
# Corresponds to the JSON property `name`
|
683
|
+
# @return [String]
|
684
|
+
attr_accessor :name
|
685
|
+
|
686
|
+
# The string value of the variable. The length of the value must be less
|
687
|
+
# than 4096 bytes. Empty values are also accepted. For example,
|
688
|
+
# `text: "my text value"`. The string must be valid UTF-8.
|
689
|
+
# Corresponds to the JSON property `text`
|
690
|
+
# @return [String]
|
691
|
+
attr_accessor :text
|
692
|
+
|
693
|
+
def initialize(**args)
|
694
|
+
update!(**args)
|
695
|
+
end
|
696
|
+
|
697
|
+
# Update properties of this object
|
698
|
+
def update!(**args)
|
699
|
+
@value = args[:value] if args.key?(:value)
|
700
|
+
@state = args[:state] if args.key?(:state)
|
701
|
+
@update_time = args[:update_time] if args.key?(:update_time)
|
702
|
+
@name = args[:name] if args.key?(:name)
|
703
|
+
@text = args[:text] if args.key?(:text)
|
704
|
+
end
|
705
|
+
end
|
706
|
+
|
707
|
+
# This resource represents a long-running operation that is the result of a
|
708
|
+
# network API call.
|
709
|
+
class Operation
|
710
|
+
include Google::Apis::Core::Hashable
|
711
|
+
|
712
|
+
# Service-specific metadata associated with the operation. It typically
|
713
|
+
# contains progress information and common metadata such as create time.
|
714
|
+
# Some services might not provide such metadata. Any method that returns a
|
715
|
+
# long-running operation should document the metadata type, if any.
|
716
|
+
# Corresponds to the JSON property `metadata`
|
717
|
+
# @return [Hash<String,Object>]
|
718
|
+
attr_accessor :metadata
|
719
|
+
|
720
|
+
# If the value is `false`, it means the operation is still in progress.
|
721
|
+
# If true, the operation is completed, and either `error` or `response` is
|
722
|
+
# available.
|
723
|
+
# Corresponds to the JSON property `done`
|
724
|
+
# @return [Boolean]
|
725
|
+
attr_accessor :done
|
726
|
+
alias_method :done?, :done
|
727
|
+
|
728
|
+
# The normal response of the operation in case of success. If the original
|
729
|
+
# method returns no data on success, such as `Delete`, the response is
|
730
|
+
# `google.protobuf.Empty`. If the original method is standard
|
731
|
+
# `Get`/`Create`/`Update`, the response should be the resource. For other
|
732
|
+
# methods, the response should have the type `XxxResponse`, where `Xxx`
|
733
|
+
# is the original method name. For example, if the original method name
|
734
|
+
# is `TakeSnapshot()`, the inferred response type is
|
735
|
+
# `TakeSnapshotResponse`.
|
736
|
+
# Corresponds to the JSON property `response`
|
737
|
+
# @return [Hash<String,Object>]
|
738
|
+
attr_accessor :response
|
739
|
+
|
740
|
+
# The server-assigned name, which is only unique within the same service that
|
741
|
+
# originally returns it. If you use the default HTTP mapping, the
|
742
|
+
# `name` should have the format of `operations/some/unique/name`.
|
743
|
+
# Corresponds to the JSON property `name`
|
744
|
+
# @return [String]
|
745
|
+
attr_accessor :name
|
746
|
+
|
747
|
+
# The `Status` type defines a logical error model that is suitable for different
|
748
|
+
# programming environments, including REST APIs and RPC APIs. It is used by
|
749
|
+
# [gRPC](https://github.com/grpc). The error model is designed to be:
|
750
|
+
# - Simple to use and understand for most users
|
751
|
+
# - Flexible enough to meet unexpected needs
|
752
|
+
# # Overview
|
753
|
+
# The `Status` message contains three pieces of data: error code, error message,
|
754
|
+
# and error details. The error code should be an enum value of
|
755
|
+
# google.rpc.Code, but it may accept additional error codes if needed. The
|
756
|
+
# error message should be a developer-facing English message that helps
|
757
|
+
# developers *understand* and *resolve* the error. If a localized user-facing
|
758
|
+
# error message is needed, put the localized message in the error details or
|
759
|
+
# localize it in the client. The optional error details may contain arbitrary
|
760
|
+
# information about the error. There is a predefined set of error detail types
|
761
|
+
# in the package `google.rpc` that can be used for common error conditions.
|
762
|
+
# # Language mapping
|
763
|
+
# The `Status` message is the logical representation of the error model, but it
|
764
|
+
# is not necessarily the actual wire format. When the `Status` message is
|
765
|
+
# exposed in different client libraries and different wire protocols, it can be
|
766
|
+
# mapped differently. For example, it will likely be mapped to some exceptions
|
767
|
+
# in Java, but more likely mapped to some error codes in C.
|
768
|
+
# # Other uses
|
769
|
+
# The error model and the `Status` message can be used in a variety of
|
770
|
+
# environments, either with or without APIs, to provide a
|
771
|
+
# consistent developer experience across different environments.
|
772
|
+
# Example uses of this error model include:
|
773
|
+
# - Partial errors. If a service needs to return partial errors to the client,
|
774
|
+
# it may embed the `Status` in the normal response to indicate the partial
|
775
|
+
# errors.
|
776
|
+
# - Workflow errors. A typical workflow has multiple steps. Each step may
|
777
|
+
# have a `Status` message for error reporting.
|
778
|
+
# - Batch operations. If a client uses batch request and batch response, the
|
779
|
+
# `Status` message should be used directly inside batch response, one for
|
780
|
+
# each error sub-response.
|
781
|
+
# - Asynchronous operations. If an API call embeds asynchronous operation
|
782
|
+
# results in its response, the status of those operations should be
|
783
|
+
# represented directly using the `Status` message.
|
784
|
+
# - Logging. If some API errors are stored in logs, the message `Status` could
|
785
|
+
# be used directly after any stripping needed for security/privacy reasons.
|
786
|
+
# Corresponds to the JSON property `error`
|
787
|
+
# @return [Google::Apis::RuntimeconfigV1beta1::Status]
|
788
|
+
attr_accessor :error
|
789
|
+
|
790
|
+
def initialize(**args)
|
791
|
+
update!(**args)
|
792
|
+
end
|
793
|
+
|
794
|
+
# Update properties of this object
|
795
|
+
def update!(**args)
|
796
|
+
@metadata = args[:metadata] if args.key?(:metadata)
|
797
|
+
@done = args[:done] if args.key?(:done)
|
798
|
+
@response = args[:response] if args.key?(:response)
|
799
|
+
@name = args[:name] if args.key?(:name)
|
800
|
+
@error = args[:error] if args.key?(:error)
|
801
|
+
end
|
802
|
+
end
|
803
|
+
end
|
804
|
+
end
|
805
|
+
end
|