google-cloud-filestore-v1 0.6.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +72 -99
- data/lib/google/cloud/filestore/v1/bindings_override.rb +102 -0
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/client.rb +153 -8
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/operations.rb +28 -6
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/client.rb +156 -7
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/operations.rb +33 -8
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest/service_stub.rb +74 -2
- data/lib/google/cloud/filestore/v1/cloud_filestore_manager/rest.rb +1 -0
- data/lib/google/cloud/filestore/v1/cloud_filestore_service_pb.rb +2 -1
- data/lib/google/cloud/filestore/v1/cloud_filestore_service_services_pb.rb +2 -0
- data/lib/google/cloud/filestore/v1/rest.rb +1 -0
- data/lib/google/cloud/filestore/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/filestore/v1/cloud_filestore_service.rb +42 -1
- metadata +26 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de7de31d204b942cee151560de8d936575c6f72fb72ddfa259c5a682e7b13285
|
4
|
+
data.tar.gz: 75ebb484f1286ac1d75a5905709a769075f9aac610afcbef6f75eca53ac09fec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c450c0d0d9ab34648a1118b4aa06f353254c27e6043624cfcdd4eea0ff0afe3200a7e6e48acde5359c8dcfc9407c7b2ecd29815b32bacc97a4162bdfd632caa6
|
7
|
+
data.tar.gz: e818380f4c9945aa03f9f00b6297c4bf45a67eeddc20750508dab47cdb06d7a6155765c2132218f6c69a866b2c4ba7ee99ac0995d6bcb0309c0ec53238e29990
|
data/AUTHENTICATION.md
CHANGED
@@ -1,149 +1,122 @@
|
|
1
1
|
# Authentication
|
2
2
|
|
3
|
-
|
4
|
-
[
|
5
|
-
|
6
|
-
[Google Cloud Platform environments](#google-cloud-platform-environments) the
|
7
|
-
credentials will be discovered automatically. When running on other
|
8
|
-
environments, the Service Account credentials can be specified by providing the
|
9
|
-
path to the
|
10
|
-
[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
|
11
|
-
for the account (or the JSON itself) in
|
12
|
-
[environment variables](#environment-variables). Additionally, Cloud SDK
|
13
|
-
credentials can also be discovered automatically, but this is only recommended
|
14
|
-
during development.
|
3
|
+
The recommended way to authenticate to the google-cloud-filestore-v1 library is to use
|
4
|
+
[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
|
5
|
+
To review all of your authentication options, see [Credentials lookup](#credential-lookup).
|
15
6
|
|
16
7
|
## Quickstart
|
17
8
|
|
18
|
-
|
19
|
-
|
9
|
+
The following example shows how to set up authentication for a local development
|
10
|
+
environment with your user credentials.
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
```
|
24
|
-
|
25
|
-
3. Initialize the client.
|
12
|
+
**NOTE:** This method is _not_ recommended for running in production. User credentials
|
13
|
+
should be used only during development.
|
26
14
|
|
27
|
-
|
28
|
-
|
15
|
+
1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
|
16
|
+
2. Set up a local ADC file with your user credentials:
|
29
17
|
|
30
|
-
|
18
|
+
```sh
|
19
|
+
gcloud auth application-default login
|
31
20
|
```
|
32
21
|
|
33
|
-
|
34
|
-
|
35
|
-
The google-cloud-filestore-v1 library aims to make authentication
|
36
|
-
as simple as possible, and provides several mechanisms to configure your system
|
37
|
-
without requiring **Service Account Credentials** directly in code.
|
38
|
-
|
39
|
-
**Credentials** are discovered in the following order:
|
40
|
-
|
41
|
-
1. Specify credentials in method arguments
|
42
|
-
2. Specify credentials in configuration
|
43
|
-
3. Discover credentials path in environment variables
|
44
|
-
4. Discover credentials JSON in environment variables
|
45
|
-
5. Discover credentials file in the Cloud SDK's path
|
46
|
-
6. Discover GCP credentials
|
47
|
-
|
48
|
-
### Google Cloud Platform environments
|
22
|
+
3. Write code as if already authenticated.
|
49
23
|
|
50
|
-
|
51
|
-
|
52
|
-
Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
|
53
|
-
Code should be written as if already authenticated.
|
24
|
+
For more information about setting up authentication for a local development environment, see
|
25
|
+
[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
|
54
26
|
|
55
|
-
|
27
|
+
## Credential Lookup
|
56
28
|
|
57
|
-
The
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
**Credentials JSON** file can be stored in the environment variable, or the
|
62
|
-
**Credentials JSON** itself can be stored for environments such as Docker
|
63
|
-
containers where writing files is difficult or not encouraged.
|
29
|
+
The google-cloud-filestore-v1 library provides several mechanisms to configure your system.
|
30
|
+
Generally, using Application Default Credentials to facilitate automatic
|
31
|
+
credentials discovery is the easist method. But if you need to explicitly specify
|
32
|
+
credentials, there are several methods available to you.
|
64
33
|
|
65
|
-
|
66
|
-
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{::Google::Cloud::Filestore::V1::CloudFilestoreManager::Credentials}):
|
34
|
+
Credentials are accepted in the following ways, in the following order or precedence:
|
68
35
|
|
69
|
-
|
70
|
-
|
71
|
-
|
36
|
+
1. Credentials specified in method arguments
|
37
|
+
2. Credentials specified in configuration
|
38
|
+
3. Credentials pointed to or included in environment variables
|
39
|
+
4. Credentials found in local ADC file
|
40
|
+
5. Credentials returned by the metadata server for the attached service account (GCP)
|
72
41
|
|
73
|
-
|
74
|
-
require "google/cloud/filestore/v1"
|
75
|
-
|
76
|
-
ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
|
42
|
+
### Configuration
|
77
43
|
|
78
|
-
client
|
79
|
-
|
44
|
+
You can configure a path to a JSON credentials file, either for an individual client object or
|
45
|
+
globally, for all client objects. The JSON file can contain credentials created for
|
46
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
47
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
48
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
80
49
|
|
81
|
-
|
50
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
51
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
52
|
+
whenever possible.
|
82
53
|
|
83
|
-
|
84
|
-
it in an environment variable. Either on an individual client initialization:
|
54
|
+
To configure a credentials file for an individual client initialization:
|
85
55
|
|
86
56
|
```ruby
|
87
57
|
require "google/cloud/filestore/v1"
|
88
58
|
|
89
59
|
client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new do |config|
|
90
|
-
config.credentials = "path/to/
|
60
|
+
config.credentials = "path/to/credentialfile.json"
|
91
61
|
end
|
92
62
|
```
|
93
63
|
|
94
|
-
|
64
|
+
To configure a credentials file globally for all clients:
|
95
65
|
|
96
66
|
```ruby
|
97
67
|
require "google/cloud/filestore/v1"
|
98
68
|
|
99
69
|
::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.configure do |config|
|
100
|
-
config.credentials = "path/to/
|
70
|
+
config.credentials = "path/to/credentialfile.json"
|
101
71
|
end
|
102
72
|
|
103
73
|
client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
104
74
|
```
|
105
75
|
|
106
|
-
###
|
76
|
+
### Environment Variables
|
107
77
|
|
108
|
-
|
109
|
-
|
110
|
-
|
78
|
+
You can also use an environment variable to provide a JSON credentials file.
|
79
|
+
The environment variable can contain a path to the credentials file or, for
|
80
|
+
environments such as Docker containers where writing files is not encouraged,
|
81
|
+
you can include the credentials file itself.
|
111
82
|
|
112
|
-
|
83
|
+
The JSON file can contain credentials created for
|
84
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
85
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
86
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
113
87
|
|
114
|
-
|
115
|
-
|
116
|
-
|
88
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
89
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
90
|
+
whenever possible.
|
91
|
+
|
92
|
+
The environment variables that google-cloud-filestore-v1
|
93
|
+
checks for credentials are:
|
117
94
|
|
118
|
-
|
119
|
-
*
|
95
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
96
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
120
97
|
|
121
|
-
|
98
|
+
```ruby
|
99
|
+
require "google/cloud/filestore/v1"
|
122
100
|
|
123
|
-
|
124
|
-
connect to the APIs. You will use the **JSON key file** to
|
125
|
-
connect to most services with google-cloud-filestore-v1.
|
101
|
+
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
126
102
|
|
127
|
-
|
128
|
-
|
129
|
-
need a Google Developers service account.
|
103
|
+
client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
104
|
+
```
|
130
105
|
|
131
|
-
|
132
|
-
2. Create a new project or click on an existing project.
|
133
|
-
3. Activate the menu in the upper left and select **APIs & Services**. From
|
134
|
-
here, you will enable the APIs that your application requires.
|
106
|
+
### Local ADC file
|
135
107
|
|
136
|
-
|
108
|
+
You can set up a local ADC file with your user credentials for authentication during
|
109
|
+
development. If credentials are not provided in code or in environment variables,
|
110
|
+
then the local ADC credentials are discovered.
|
137
111
|
|
138
|
-
|
112
|
+
Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
|
139
113
|
|
140
|
-
|
141
|
-
"Service account" to be guided through downloading a new JSON key file.
|
114
|
+
### Google Cloud Platform environments
|
142
115
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
116
|
+
When running on Google Cloud Platform (GCP), including Google Compute Engine
|
117
|
+
(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
|
118
|
+
Functions (GCF) and Cloud Run, credentials are retrieved from the attached
|
119
|
+
service account automatically. Code should be written as if already authenticated.
|
147
120
|
|
148
|
-
|
149
|
-
|
121
|
+
For more information, see
|
122
|
+
[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
|
@@ -0,0 +1,102 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2023 Google LLC
|
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
|
+
# https://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
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "gapic/config"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module Filestore
|
24
|
+
##
|
25
|
+
# @example Loading just the REST part of this package, including all its services, and instantiating a REST client
|
26
|
+
#
|
27
|
+
# require "google/cloud/filestore/v1/rest"
|
28
|
+
# client = ::Google::Cloud::Filestore::V1::CloudFilestoreManager::Rest::Client.new
|
29
|
+
#
|
30
|
+
module V1
|
31
|
+
##
|
32
|
+
# @private
|
33
|
+
# Initialize the mixin bindings configuration
|
34
|
+
#
|
35
|
+
def self.configure
|
36
|
+
@configure ||= begin
|
37
|
+
namespace = ["Google", "Cloud", "Filestore"]
|
38
|
+
parent_config = while namespace.any?
|
39
|
+
parent_name = namespace.join "::"
|
40
|
+
parent_const = const_get parent_name
|
41
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
42
|
+
namespace.pop
|
43
|
+
end
|
44
|
+
|
45
|
+
default_config = Configuration.new parent_config
|
46
|
+
default_config.bindings_override["google.cloud.location.Locations.GetLocation"] = [
|
47
|
+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
|
48
|
+
uri_method: :get,
|
49
|
+
uri_template: "/v1/{name}",
|
50
|
+
matches: [
|
51
|
+
["name", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
|
52
|
+
],
|
53
|
+
body: nil
|
54
|
+
)
|
55
|
+
]
|
56
|
+
default_config.bindings_override["google.cloud.location.Locations.ListLocations"] = [
|
57
|
+
|
58
|
+
Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation(
|
59
|
+
uri_method: :get,
|
60
|
+
uri_template: "/v1/{name}/locations",
|
61
|
+
matches: [
|
62
|
+
["name", %r{^projects/[^/]+/?$}, false]
|
63
|
+
],
|
64
|
+
body: nil
|
65
|
+
)
|
66
|
+
]
|
67
|
+
default_config
|
68
|
+
end
|
69
|
+
yield @configure if block_given?
|
70
|
+
@configure
|
71
|
+
end
|
72
|
+
|
73
|
+
##
|
74
|
+
# @private
|
75
|
+
# Configuration class for the google.cloud.filestore.v1 package.
|
76
|
+
#
|
77
|
+
# This class contains common configuration for all services
|
78
|
+
# of the google.cloud.filestore.v1 package.
|
79
|
+
#
|
80
|
+
# This configuration is for internal use of the client library classes,
|
81
|
+
# and it is not intended that the end-users will read or change it.
|
82
|
+
#
|
83
|
+
class Configuration
|
84
|
+
extend ::Gapic::Config
|
85
|
+
|
86
|
+
# @private
|
87
|
+
# Overrides for http bindings for the RPC of the mixins for this package.
|
88
|
+
# Services in this package should use these when creating clients for the mixin services.
|
89
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
90
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
91
|
+
|
92
|
+
# @private
|
93
|
+
def initialize parent_config = nil
|
94
|
+
@parent_config = parent_config unless parent_config.nil?
|
95
|
+
|
96
|
+
yield self if block_given?
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -18,6 +18,7 @@
|
|
18
18
|
|
19
19
|
require "google/cloud/errors"
|
20
20
|
require "google/cloud/filestore/v1/cloud_filestore_service_pb"
|
21
|
+
require "google/cloud/location"
|
21
22
|
|
22
23
|
module Google
|
23
24
|
module Cloud
|
@@ -48,6 +49,9 @@ module Google
|
|
48
49
|
# * `projects/12345/locations/us-central1/backups/my-backup`
|
49
50
|
#
|
50
51
|
class Client
|
52
|
+
# @private
|
53
|
+
DEFAULT_ENDPOINT_TEMPLATE = "file.$UNIVERSE_DOMAIN$"
|
54
|
+
|
51
55
|
include Paths
|
52
56
|
|
53
57
|
# @private
|
@@ -142,6 +146,15 @@ module Google
|
|
142
146
|
@config
|
143
147
|
end
|
144
148
|
|
149
|
+
##
|
150
|
+
# The effective universe domain
|
151
|
+
#
|
152
|
+
# @return [String]
|
153
|
+
#
|
154
|
+
def universe_domain
|
155
|
+
@cloud_filestore_manager_stub.universe_domain
|
156
|
+
end
|
157
|
+
|
145
158
|
##
|
146
159
|
# Create a new CloudFilestoreManager client object.
|
147
160
|
#
|
@@ -175,8 +188,9 @@ module Google
|
|
175
188
|
credentials = @config.credentials
|
176
189
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
177
190
|
# but only if the default endpoint does not have a region prefix.
|
178
|
-
enable_self_signed_jwt = @config.endpoint
|
179
|
-
|
191
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
192
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
193
|
+
!@config.endpoint.split(".").first.include?("-"))
|
180
194
|
credentials ||= Credentials.default scope: @config.scope,
|
181
195
|
enable_self_signed_jwt: enable_self_signed_jwt
|
182
196
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -189,12 +203,22 @@ module Google
|
|
189
203
|
config.credentials = credentials
|
190
204
|
config.quota_project = @quota_project_id
|
191
205
|
config.endpoint = @config.endpoint
|
206
|
+
config.universe_domain = @config.universe_domain
|
207
|
+
end
|
208
|
+
|
209
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
210
|
+
config.credentials = credentials
|
211
|
+
config.quota_project = @quota_project_id
|
212
|
+
config.endpoint = @config.endpoint
|
213
|
+
config.universe_domain = @config.universe_domain
|
192
214
|
end
|
193
215
|
|
194
216
|
@cloud_filestore_manager_stub = ::Gapic::ServiceStub.new(
|
195
217
|
::Google::Cloud::Filestore::V1::CloudFilestoreManager::Stub,
|
196
|
-
credentials:
|
197
|
-
endpoint:
|
218
|
+
credentials: credentials,
|
219
|
+
endpoint: @config.endpoint,
|
220
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
221
|
+
universe_domain: @config.universe_domain,
|
198
222
|
channel_args: @config.channel_args,
|
199
223
|
interceptors: @config.interceptors,
|
200
224
|
channel_pool_config: @config.channel_pool
|
@@ -208,6 +232,13 @@ module Google
|
|
208
232
|
#
|
209
233
|
attr_reader :operations_client
|
210
234
|
|
235
|
+
##
|
236
|
+
# Get the associated client for mix-in of the Locations.
|
237
|
+
#
|
238
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
239
|
+
#
|
240
|
+
attr_reader :location_client
|
241
|
+
|
211
242
|
# Service calls
|
212
243
|
|
213
244
|
##
|
@@ -709,6 +740,105 @@ module Google
|
|
709
740
|
raise ::Google::Cloud::Error.from_error(e)
|
710
741
|
end
|
711
742
|
|
743
|
+
##
|
744
|
+
# Revert an existing instance's file system to a specified snapshot.
|
745
|
+
#
|
746
|
+
# @overload revert_instance(request, options = nil)
|
747
|
+
# Pass arguments to `revert_instance` via a request object, either of type
|
748
|
+
# {::Google::Cloud::Filestore::V1::RevertInstanceRequest} or an equivalent Hash.
|
749
|
+
#
|
750
|
+
# @param request [::Google::Cloud::Filestore::V1::RevertInstanceRequest, ::Hash]
|
751
|
+
# A request object representing the call parameters. Required. To specify no
|
752
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
753
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
754
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
755
|
+
#
|
756
|
+
# @overload revert_instance(name: nil, target_snapshot_id: nil)
|
757
|
+
# Pass arguments to `revert_instance` via keyword arguments. Note that at
|
758
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
759
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
760
|
+
#
|
761
|
+
# @param name [::String]
|
762
|
+
# Required.
|
763
|
+
# `projects/{project_id}/locations/{location_id}/instances/{instance_id}`.
|
764
|
+
# The resource name of the instance, in the format
|
765
|
+
# @param target_snapshot_id [::String]
|
766
|
+
# Required. The snapshot resource ID, in the format 'my-snapshot', where the
|
767
|
+
# specified ID is the \\{snapshot_id} of the fully qualified name like
|
768
|
+
# `projects/{project_id}/locations/{location_id}/instances/{instance_id}/snapshots/{snapshot_id}`
|
769
|
+
#
|
770
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
771
|
+
# @yieldparam response [::Gapic::Operation]
|
772
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
773
|
+
#
|
774
|
+
# @return [::Gapic::Operation]
|
775
|
+
#
|
776
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
777
|
+
#
|
778
|
+
# @example Basic example
|
779
|
+
# require "google/cloud/filestore/v1"
|
780
|
+
#
|
781
|
+
# # Create a client object. The client can be reused for multiple calls.
|
782
|
+
# client = Google::Cloud::Filestore::V1::CloudFilestoreManager::Client.new
|
783
|
+
#
|
784
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
785
|
+
# request = Google::Cloud::Filestore::V1::RevertInstanceRequest.new
|
786
|
+
#
|
787
|
+
# # Call the revert_instance method.
|
788
|
+
# result = client.revert_instance request
|
789
|
+
#
|
790
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
791
|
+
# # check the status of an operation, cancel it, or wait for results.
|
792
|
+
# # Here is how to wait for a response.
|
793
|
+
# result.wait_until_done! timeout: 60
|
794
|
+
# if result.response?
|
795
|
+
# p result.response
|
796
|
+
# else
|
797
|
+
# puts "No response received."
|
798
|
+
# end
|
799
|
+
#
|
800
|
+
def revert_instance request, options = nil
|
801
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
802
|
+
|
803
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Filestore::V1::RevertInstanceRequest
|
804
|
+
|
805
|
+
# Converts hash and nil to an options object
|
806
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
807
|
+
|
808
|
+
# Customize the options with defaults
|
809
|
+
metadata = @config.rpcs.revert_instance.metadata.to_h
|
810
|
+
|
811
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
812
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
813
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
814
|
+
gapic_version: ::Google::Cloud::Filestore::V1::VERSION
|
815
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
816
|
+
|
817
|
+
header_params = {}
|
818
|
+
if request.name
|
819
|
+
header_params["name"] = request.name
|
820
|
+
end
|
821
|
+
|
822
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
823
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
824
|
+
|
825
|
+
options.apply_defaults timeout: @config.rpcs.revert_instance.timeout,
|
826
|
+
metadata: metadata,
|
827
|
+
retry_policy: @config.rpcs.revert_instance.retry_policy
|
828
|
+
|
829
|
+
options.apply_defaults timeout: @config.timeout,
|
830
|
+
metadata: @config.metadata,
|
831
|
+
retry_policy: @config.retry_policy
|
832
|
+
|
833
|
+
@cloud_filestore_manager_stub.call_rpc :revert_instance, request, options: options do |response, operation|
|
834
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
835
|
+
yield response, operation if block_given?
|
836
|
+
return response
|
837
|
+
end
|
838
|
+
rescue ::GRPC::BadStatus => e
|
839
|
+
raise ::Google::Cloud::Error.from_error(e)
|
840
|
+
end
|
841
|
+
|
712
842
|
##
|
713
843
|
# Deletes an instance.
|
714
844
|
#
|
@@ -1802,9 +1932,9 @@ module Google
|
|
1802
1932
|
# end
|
1803
1933
|
#
|
1804
1934
|
# @!attribute [rw] endpoint
|
1805
|
-
#
|
1806
|
-
#
|
1807
|
-
# @return [::String]
|
1935
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1936
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1937
|
+
# @return [::String,nil]
|
1808
1938
|
# @!attribute [rw] credentials
|
1809
1939
|
# Credentials to send with calls. You may provide any of the following types:
|
1810
1940
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1850,13 +1980,20 @@ module Google
|
|
1850
1980
|
# @!attribute [rw] quota_project
|
1851
1981
|
# A separate project against which to charge quota.
|
1852
1982
|
# @return [::String]
|
1983
|
+
# @!attribute [rw] universe_domain
|
1984
|
+
# The universe domain within which to make requests. This determines the
|
1985
|
+
# default endpoint URL. The default value of nil uses the environment
|
1986
|
+
# universe (usually the default "googleapis.com" universe).
|
1987
|
+
# @return [::String,nil]
|
1853
1988
|
#
|
1854
1989
|
class Configuration
|
1855
1990
|
extend ::Gapic::Config
|
1856
1991
|
|
1992
|
+
# @private
|
1993
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1857
1994
|
DEFAULT_ENDPOINT = "file.googleapis.com"
|
1858
1995
|
|
1859
|
-
config_attr :endpoint,
|
1996
|
+
config_attr :endpoint, nil, ::String, nil
|
1860
1997
|
config_attr :credentials, nil do |value|
|
1861
1998
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1862
1999
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1871,6 +2008,7 @@ module Google
|
|
1871
2008
|
config_attr :metadata, nil, ::Hash, nil
|
1872
2009
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1873
2010
|
config_attr :quota_project, nil, ::String, nil
|
2011
|
+
config_attr :universe_domain, nil, ::String, nil
|
1874
2012
|
|
1875
2013
|
# @private
|
1876
2014
|
def initialize parent_config = nil
|
@@ -1943,6 +2081,11 @@ module Google
|
|
1943
2081
|
#
|
1944
2082
|
attr_reader :restore_instance
|
1945
2083
|
##
|
2084
|
+
# RPC-specific configuration for `revert_instance`
|
2085
|
+
# @return [::Gapic::Config::Method]
|
2086
|
+
#
|
2087
|
+
attr_reader :revert_instance
|
2088
|
+
##
|
1946
2089
|
# RPC-specific configuration for `delete_instance`
|
1947
2090
|
# @return [::Gapic::Config::Method]
|
1948
2091
|
#
|
@@ -2010,6 +2153,8 @@ module Google
|
|
2010
2153
|
@update_instance = ::Gapic::Config::Method.new update_instance_config
|
2011
2154
|
restore_instance_config = parent_rpcs.restore_instance if parent_rpcs.respond_to? :restore_instance
|
2012
2155
|
@restore_instance = ::Gapic::Config::Method.new restore_instance_config
|
2156
|
+
revert_instance_config = parent_rpcs.revert_instance if parent_rpcs.respond_to? :revert_instance
|
2157
|
+
@revert_instance = ::Gapic::Config::Method.new revert_instance_config
|
2013
2158
|
delete_instance_config = parent_rpcs.delete_instance if parent_rpcs.respond_to? :delete_instance
|
2014
2159
|
@delete_instance = ::Gapic::Config::Method.new delete_instance_config
|
2015
2160
|
list_snapshots_config = parent_rpcs.list_snapshots if parent_rpcs.respond_to? :list_snapshots
|