google-cloud-spanner 2.10.0 → 2.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +25 -0
- data/OVERVIEW.md +69 -50
- data/lib/google/cloud/spanner/admin/database.rb +324 -0
- data/lib/google/cloud/spanner/admin/instance.rb +324 -0
- data/lib/google/cloud/spanner/backup/job/list.rb +7 -0
- data/lib/google/cloud/spanner/backup/job.rb +7 -0
- data/lib/google/cloud/spanner/backup/list.rb +7 -0
- data/lib/google/cloud/spanner/backup/restore/job.rb +7 -0
- data/lib/google/cloud/spanner/backup.rb +14 -0
- data/lib/google/cloud/spanner/database/backup_info.rb +5 -0
- data/lib/google/cloud/spanner/database/job/list.rb +7 -0
- data/lib/google/cloud/spanner/database/job.rb +7 -0
- data/lib/google/cloud/spanner/database/list.rb +7 -0
- data/lib/google/cloud/spanner/database/restore_info.rb +5 -0
- data/lib/google/cloud/spanner/database.rb +13 -0
- data/lib/google/cloud/spanner/instance/config/list.rb +7 -0
- data/lib/google/cloud/spanner/instance/config.rb +7 -0
- data/lib/google/cloud/spanner/instance/job.rb +7 -0
- data/lib/google/cloud/spanner/instance/list.rb +7 -0
- data/lib/google/cloud/spanner/instance.rb +14 -0
- data/lib/google/cloud/spanner/project.rb +35 -0
- data/lib/google/cloud/spanner/service.rb +6 -1
- data/lib/google/cloud/spanner/version.rb +1 -1
- data/lib/google/cloud/spanner.rb +3 -1
- metadata +5 -3
@@ -0,0 +1,324 @@
|
|
1
|
+
# Copyright 2021 Google LLC
|
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
|
+
# https://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 "google-cloud-spanner"
|
16
|
+
require "google/cloud/config"
|
17
|
+
require "gapic/config"
|
18
|
+
|
19
|
+
module Google
|
20
|
+
module Cloud
|
21
|
+
module Spanner
|
22
|
+
module Admin
|
23
|
+
module Instance
|
24
|
+
##
|
25
|
+
# Create a new client object for a InstanceAdmin.
|
26
|
+
#
|
27
|
+
# This returns an instance of
|
28
|
+
# Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client
|
29
|
+
# for version V1 of the API.
|
30
|
+
#
|
31
|
+
# ## About InstanceAdmin
|
32
|
+
#
|
33
|
+
# Google Cloud Spanner Instance Admin Service
|
34
|
+
#
|
35
|
+
# The Cloud Spanner Instance Admin API can be used to create, delete,
|
36
|
+
# modify and list instances. Instances are dedicated Cloud Spanner
|
37
|
+
# serving and storage resources to be used by Cloud Spanner databases.
|
38
|
+
#
|
39
|
+
# For more information on connecting to Google Cloud see the
|
40
|
+
# {file:AUTHENTICATION.md Authentication Guide}.
|
41
|
+
#
|
42
|
+
# @param [String] project_id Project identifier for the Spanner service
|
43
|
+
# you are connecting to. If not present, the default project for the
|
44
|
+
# credentials is used.
|
45
|
+
# @param [String, Hash, Google::Auth::Credentials] credentials The path to
|
46
|
+
# the keyfile as a String, the contents of the keyfile as a Hash, or a
|
47
|
+
# Google::Auth::Credentials object. (See {Spanner::Credentials})
|
48
|
+
# If `emulator_host` is present, this becomes optional and the value is
|
49
|
+
# internally overriden with `:this_channel_is_insecure`.
|
50
|
+
# @param [String, Array<String>] scope The OAuth 2.0 scopes controlling
|
51
|
+
# the set of resources and operations that the connection can access.
|
52
|
+
# See [Using OAuth 2.0 to Access Google
|
53
|
+
# APIs](https://developers.google.com/identity/protocols/OAuth2).
|
54
|
+
#
|
55
|
+
# The default scopes are:
|
56
|
+
#
|
57
|
+
# * `https://www.googleapis.com/auth/spanner`
|
58
|
+
# * `https://www.googleapis.com/auth/spanner.data`
|
59
|
+
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
60
|
+
# @param [String] endpoint Override of the endpoint host name. Optional.
|
61
|
+
# If the param is nil, uses `emulator_host` or the default endpoint.
|
62
|
+
# @param [String] project Alias for the `project_id` argument. Deprecated.
|
63
|
+
# @param [String] keyfile Alias for the `credentials` argument.
|
64
|
+
# Deprecated.
|
65
|
+
# @param [String] emulator_host Spanner emulator host. Optional.
|
66
|
+
# If the param is nil, uses the value of the `emulator_host` config.
|
67
|
+
# @param [String] lib_name Library name. This will be added as a prefix
|
68
|
+
# to the API call tracking header `x-goog-api-client` with provided
|
69
|
+
# lib version for telemetry. Optional. For example prefix looks like
|
70
|
+
# `spanner-activerecord/0.0.1 gccl/1.13.1`. Here,
|
71
|
+
# `spanner-activerecord/0.0.1` is provided custom library name and
|
72
|
+
# version and `gccl/1.13.1` represents the Cloud Spanner Ruby library
|
73
|
+
# with version.
|
74
|
+
# @param [String] lib_version Library version. This will be added as a
|
75
|
+
# prefix to the API call tracking header `x-goog-api-client` with
|
76
|
+
# provided lib name for telemetry. Optional. For example prefix look like
|
77
|
+
# `spanner-activerecord/0.0.1 gccl/1.13.1`. Here,
|
78
|
+
# `spanner-activerecord/0.0.1` is provided custom library name and
|
79
|
+
# version and `gccl/1.13.1` represents the Cloud Spanner Ruby library
|
80
|
+
# with version.
|
81
|
+
#
|
82
|
+
# @return [Admin::Instance::V1::InstanceAdmin::Client] A client object of version V1.
|
83
|
+
#
|
84
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/MethodLength
|
85
|
+
def self.instance_admin project_id: nil,
|
86
|
+
credentials: nil,
|
87
|
+
scope: nil,
|
88
|
+
timeout: nil,
|
89
|
+
endpoint: nil,
|
90
|
+
project: nil,
|
91
|
+
keyfile: nil,
|
92
|
+
emulator_host: nil,
|
93
|
+
lib_name: nil,
|
94
|
+
lib_version: nil
|
95
|
+
project_id ||= project || default_project_id
|
96
|
+
scope ||= configure.scope
|
97
|
+
timeout ||= configure.timeout
|
98
|
+
emulator_host ||= configure.emulator_host
|
99
|
+
endpoint ||= emulator_host || configure.endpoint
|
100
|
+
credentials ||= keyfile
|
101
|
+
lib_name ||= configure.lib_name
|
102
|
+
lib_version ||= configure.lib_version
|
103
|
+
|
104
|
+
if emulator_host
|
105
|
+
credentials = :this_channel_is_insecure
|
106
|
+
else
|
107
|
+
credentials ||= default_credentials scope: scope
|
108
|
+
unless credentials.is_a? Google::Auth::Credentials
|
109
|
+
credentials = Spanner::Credentials.new credentials, scope: scope
|
110
|
+
end
|
111
|
+
|
112
|
+
if credentials.respond_to? :project_id
|
113
|
+
project_id ||= credentials.project_id
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
project_id = project_id.to_s # Always cast to a string
|
118
|
+
raise ArgumentError, "project_id is missing" if project_id.empty?
|
119
|
+
|
120
|
+
configure.quota_project ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
121
|
+
|
122
|
+
Admin::Instance::V1::InstanceAdmin::Client.new do |config|
|
123
|
+
config.credentials = channel endpoint, credentials
|
124
|
+
config.quota_project = configure.quota_project
|
125
|
+
config.timeout = timeout if timeout
|
126
|
+
config.endpoint = endpoint if endpoint
|
127
|
+
config.lib_name = lib_name_with_prefix lib_name, lib_version
|
128
|
+
config.lib_version = Google::Cloud::Spanner::VERSION
|
129
|
+
config.metadata = { "google-cloud-resource-prefix" => "projects/#{project_id}" }
|
130
|
+
end
|
131
|
+
end
|
132
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/AbcSize, Metrics/MethodLength
|
133
|
+
|
134
|
+
##
|
135
|
+
# Configure the Google Cloud Spanner Instance Admin library. This configuration can be
|
136
|
+
# applied globally to all clients.
|
137
|
+
#
|
138
|
+
# @example
|
139
|
+
#
|
140
|
+
# Modify the global config, setting the timeout to 10 seconds for all admin instances.
|
141
|
+
#
|
142
|
+
# require "google/cloud/spanner/admin/instance"
|
143
|
+
#
|
144
|
+
# ::Google::Cloud::Spanner::Admin::Instance.configure do |config|
|
145
|
+
# config.timeout = 10.0
|
146
|
+
# end
|
147
|
+
#
|
148
|
+
# The following configuration parameters are supported:
|
149
|
+
#
|
150
|
+
# * `credentials` (*type:* `String, Hash, Google::Auth::Credentials`) -
|
151
|
+
# The path to the keyfile as a String, the contents of the keyfile as a
|
152
|
+
# Hash, or a Google::Auth::Credentials object.
|
153
|
+
# * `lib_name` (*type:* `String`) -
|
154
|
+
# The library name as recorded in instrumentation and logging.
|
155
|
+
# * `lib_version` (*type:* `String`) -
|
156
|
+
# The library version as recorded in instrumentation and logging.
|
157
|
+
# * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
|
158
|
+
# An array of interceptors that are run before calls are executed.
|
159
|
+
# * `timeout` (*type:* `Numeric`) -
|
160
|
+
# Default timeout in seconds.
|
161
|
+
# * `emulator_host` - (String) Host name of the emulator. Defaults to
|
162
|
+
# `ENV["SPANNER_EMULATOR_HOST"]`.
|
163
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
164
|
+
# Additional gRPC headers to be sent with the call.
|
165
|
+
# * `retry_policy` (*type:* `Hash`) -
|
166
|
+
# The retry policy. The value is a hash with the following keys:
|
167
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
168
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
169
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
170
|
+
# * `:retry_codes` (*type:* `Array<String>`) -
|
171
|
+
# The error codes that should trigger a retry.
|
172
|
+
#
|
173
|
+
# @return [::Google::Cloud::Config] The default configuration used by this library
|
174
|
+
#
|
175
|
+
def self.configure
|
176
|
+
@configure ||= begin
|
177
|
+
namespace = ["Google", "Cloud", "Spanner"]
|
178
|
+
parent_config = while namespace.any?
|
179
|
+
parent_name = namespace.join "::"
|
180
|
+
parent_const = const_get parent_name
|
181
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
182
|
+
namespace.pop
|
183
|
+
end
|
184
|
+
|
185
|
+
default_config = Instance::Configuration.new parent_config
|
186
|
+
default_config
|
187
|
+
end
|
188
|
+
yield @configure if block_given?
|
189
|
+
@configure
|
190
|
+
end
|
191
|
+
|
192
|
+
##
|
193
|
+
# @private Default project.
|
194
|
+
def self.default_project_id
|
195
|
+
Google::Cloud.configure.spanner.project_id ||
|
196
|
+
Google::Cloud.configure.project_id ||
|
197
|
+
Google::Cloud.env.project_id
|
198
|
+
end
|
199
|
+
|
200
|
+
##
|
201
|
+
# @private Default credentials.
|
202
|
+
def self.default_credentials scope: nil
|
203
|
+
Google::Cloud.configure.spanner.credentials ||
|
204
|
+
Google::Cloud.configure.credentials ||
|
205
|
+
Spanner::Credentials.default(scope: scope)
|
206
|
+
end
|
207
|
+
|
208
|
+
##
|
209
|
+
# @private gRPC channel.
|
210
|
+
def self.channel host, credentials
|
211
|
+
require "grpc"
|
212
|
+
GRPC::Core::Channel.new host, chan_args, chan_creds(credentials)
|
213
|
+
end
|
214
|
+
|
215
|
+
##
|
216
|
+
# @private gRPC channel args.
|
217
|
+
def self.chan_args
|
218
|
+
{ "grpc.service_config_disable_resolution" => 1 }
|
219
|
+
end
|
220
|
+
|
221
|
+
##
|
222
|
+
# @private gRPC channel credentials
|
223
|
+
def self.chan_creds credentials
|
224
|
+
return credentials if credentials == :this_channel_is_insecure
|
225
|
+
require "grpc"
|
226
|
+
GRPC::Core::ChannelCredentials.new.compose \
|
227
|
+
GRPC::Core::CallCredentials.new credentials.client.updater_proc
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# @private Spanner client library version with the prefix.
|
232
|
+
def self.lib_name_with_prefix lib_name, lib_version
|
233
|
+
return "gccl" if [nil, "gccl"].include? lib_name
|
234
|
+
|
235
|
+
value = lib_name.dup
|
236
|
+
value << "/#{lib_version}" if lib_version
|
237
|
+
value << " gccl"
|
238
|
+
end
|
239
|
+
|
240
|
+
##
|
241
|
+
# Configuration class for the Spanner Admin Instance.
|
242
|
+
#
|
243
|
+
# This class provides control over timeouts, retry behavior,
|
244
|
+
# query options, and other low-level controls.
|
245
|
+
#
|
246
|
+
# @!attribute [rw] endpoint
|
247
|
+
# The hostname or hostname:port of the service endpoint.
|
248
|
+
# Defaults to `"spanner.googleapis.com"`.
|
249
|
+
# @return [::String]
|
250
|
+
# @!attribute [rw] credentials
|
251
|
+
# Credentials to send with calls. You may provide any of the following types:
|
252
|
+
# * (`String`) The path to a service account key file in JSON format
|
253
|
+
# * (`Hash`) A service account key as a Hash
|
254
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
255
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
256
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
257
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
258
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
259
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
260
|
+
# * (`nil`) indicating no credentials
|
261
|
+
# @return [::Object]
|
262
|
+
# @!attribute [rw] scope
|
263
|
+
# The OAuth scopes
|
264
|
+
# @return [::Array<::String>]
|
265
|
+
# @!attribute [rw] lib_name
|
266
|
+
# The library name as recorded in instrumentation and logging
|
267
|
+
# @return [::String]
|
268
|
+
# @!attribute [rw] lib_version
|
269
|
+
# The library version as recorded in instrumentation and logging
|
270
|
+
# @return [::String]
|
271
|
+
# @!attribute [rw] interceptors
|
272
|
+
# An array of interceptors that are run before calls are executed.
|
273
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
274
|
+
# @!attribute [rw] timeout
|
275
|
+
# The call timeout in seconds.
|
276
|
+
# @return [::Numeric]
|
277
|
+
# @!attribute [rw] metadata
|
278
|
+
# Additional gRPC headers to be sent with the call.
|
279
|
+
# @return [::Hash{::Symbol=>::String}]
|
280
|
+
# @!attribute [rw] retry_policy
|
281
|
+
# The retry policy. The value is a hash with the following keys:
|
282
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
283
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
284
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
285
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
286
|
+
# trigger a retry.
|
287
|
+
# @return [::Hash]
|
288
|
+
# @!attribute [rw] quota_project
|
289
|
+
# A separate project against which to charge quota.
|
290
|
+
# @return [::String]
|
291
|
+
#
|
292
|
+
class Configuration
|
293
|
+
extend ::Gapic::Config
|
294
|
+
|
295
|
+
config_attr :endpoint, "spanner.googleapis.com", ::String
|
296
|
+
config_attr :credentials, nil do |value|
|
297
|
+
allowed = [::String, ::Hash, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
298
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
299
|
+
allowed.any? { |klass| klass === value }
|
300
|
+
end
|
301
|
+
config_attr :project_id, nil, ::String, nil
|
302
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
303
|
+
config_attr :lib_name, nil, ::String, nil
|
304
|
+
config_attr :lib_version, nil, ::String, nil
|
305
|
+
config_attr :interceptors, nil, ::Array, nil
|
306
|
+
config_attr :timeout, nil, ::Numeric, nil
|
307
|
+
config_attr :quota_project, nil, ::String, nil
|
308
|
+
config_attr :emulator_host, nil, ::String, nil
|
309
|
+
config_attr :query_options, nil, ::Hash, nil
|
310
|
+
config_attr :metadata, nil, ::Hash, nil
|
311
|
+
config_attr :retry_policy, nil, ::Hash, nil
|
312
|
+
|
313
|
+
# @private
|
314
|
+
def initialize parent_config = nil
|
315
|
+
@parent_config = parent_config unless parent_config.nil?
|
316
|
+
|
317
|
+
yield self if block_given?
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "delegate"
|
17
20
|
|
@@ -26,6 +29,10 @@ module Google
|
|
26
29
|
# List is a special case Array with additional values for backup
|
27
30
|
# operations.
|
28
31
|
#
|
32
|
+
# @deprecated Use the result of
|
33
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_backup_operations}
|
34
|
+
# instead.
|
35
|
+
#
|
29
36
|
class List < DelegateClass(::Array)
|
30
37
|
# @private
|
31
38
|
# The gRPC Service object.
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/status"
|
17
20
|
require "google/cloud/spanner/backup/job/list"
|
@@ -32,6 +35,10 @@ module Google
|
|
32
35
|
# @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation
|
33
36
|
# Long-running Operation
|
34
37
|
#
|
38
|
+
# @deprecated Use the long-running operation returned by
|
39
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#create_backup}
|
40
|
+
# instead.
|
41
|
+
#
|
35
42
|
# @example
|
36
43
|
# require "google/cloud/spanner"
|
37
44
|
#
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "delegate"
|
17
20
|
|
@@ -25,6 +28,10 @@ module Google
|
|
25
28
|
# Google::Cloud::Spanner::Backup::List is a special case Array with
|
26
29
|
# additional values.
|
27
30
|
#
|
31
|
+
# @deprecated Use the result of
|
32
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_backups}
|
33
|
+
# instead.
|
34
|
+
#
|
28
35
|
class List < DelegateClass(::Array)
|
29
36
|
# @private
|
30
37
|
# The gRPC Service object.
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/status"
|
17
20
|
|
@@ -32,6 +35,10 @@ module Google
|
|
32
35
|
# @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation
|
33
36
|
# Long-running Operation
|
34
37
|
#
|
38
|
+
# @deprecated Use the long-running operation returned by
|
39
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#restore_database}
|
40
|
+
# instead.
|
41
|
+
#
|
35
42
|
# @example
|
36
43
|
# require "google/cloud/spanner"
|
37
44
|
#
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/backup/job"
|
17
20
|
require "google/cloud/spanner/backup/list"
|
@@ -23,12 +26,23 @@ module Google
|
|
23
26
|
##
|
24
27
|
# # Backup
|
25
28
|
#
|
29
|
+
# NOTE: From `google-cloud-spanner/v2.11.0` onwards, new features for
|
30
|
+
# mananging backups will only be available through the
|
31
|
+
# [google-cloud-spanner-admin-database-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-database-v1)
|
32
|
+
# client. See the
|
33
|
+
# [README](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner#google-cloud-spanner)
|
34
|
+
# for further details.
|
35
|
+
#
|
26
36
|
# A backup is a representation of Cloud Spanner database backup.
|
27
37
|
#
|
28
38
|
# See {Google::Cloud::Spanner::Instance#backups},
|
29
39
|
# {Google::Cloud::Spanner::Instance#backup}, and
|
30
40
|
# {Google::Cloud::Spanner::Database#create_backup}.
|
31
41
|
#
|
42
|
+
# @deprecated Use
|
43
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin}
|
44
|
+
# instead.
|
45
|
+
#
|
32
46
|
# @example
|
33
47
|
# require "google/cloud"
|
34
48
|
#
|
@@ -12,11 +12,16 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
module Google
|
17
20
|
module Cloud
|
18
21
|
module Spanner
|
19
22
|
class Database
|
23
|
+
# @deprecated Use
|
24
|
+
# {Google::Cloud::Spanner::Admin::Database::V1::BackupInfo} instead.
|
20
25
|
class BackupInfo
|
21
26
|
##
|
22
27
|
# @private Creates a new Database::BackupInfo instance.
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "delegate"
|
17
20
|
|
@@ -26,6 +29,10 @@ module Google
|
|
26
29
|
# List is a special case Array with additional values for database
|
27
30
|
# operations.
|
28
31
|
#
|
32
|
+
# @deprecated Use the result of
|
33
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_database_operations}
|
34
|
+
# instead.
|
35
|
+
#
|
29
36
|
class List < DelegateClass(::Array)
|
30
37
|
# @private
|
31
38
|
# The gRPC Service object.
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/status"
|
17
20
|
require "google/cloud/spanner/database/job/list"
|
@@ -32,6 +35,10 @@ module Google
|
|
32
35
|
# @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation
|
33
36
|
# Long-running Operation
|
34
37
|
#
|
38
|
+
# @deprecated Use the long-running operation returned by
|
39
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#create_database}
|
40
|
+
# instead.
|
41
|
+
#
|
35
42
|
# @example
|
36
43
|
# require "google/cloud/spanner"
|
37
44
|
#
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "delegate"
|
17
20
|
|
@@ -22,6 +25,10 @@ module Google
|
|
22
25
|
##
|
23
26
|
# Database::List is a special case Array with additional
|
24
27
|
# values.
|
28
|
+
#
|
29
|
+
# @deprecated Use the result of
|
30
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_databases}
|
31
|
+
# instead.
|
25
32
|
class List < DelegateClass(::Array)
|
26
33
|
##
|
27
34
|
# If not empty, indicates that there are more records that match
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/database/backup_info"
|
17
20
|
|
@@ -19,6 +22,8 @@ module Google
|
|
19
22
|
module Cloud
|
20
23
|
module Spanner
|
21
24
|
class Database
|
25
|
+
# @deprecated Use
|
26
|
+
# {Google::Cloud::Spanner::Admin::Database::V1::RestoreInfo} instead.
|
22
27
|
class RestoreInfo
|
23
28
|
##
|
24
29
|
# @private Creates a new Database::RestoreInfo instance.
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/database/job"
|
17
20
|
require "google/cloud/spanner/database/list"
|
@@ -25,6 +28,13 @@ module Google
|
|
25
28
|
##
|
26
29
|
# # Database
|
27
30
|
#
|
31
|
+
# NOTE: From `google-cloud-spanner/v2.11.0` onwards, new features for
|
32
|
+
# mananging databases will only be available through the
|
33
|
+
# [google-cloud-spanner-admin-database-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-database-v1)
|
34
|
+
# client. See the
|
35
|
+
# [README](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner#google-cloud-spanner)
|
36
|
+
# for further details.
|
37
|
+
#
|
28
38
|
# Represents a Cloud Spanner database. To use Cloud Spanner's read and
|
29
39
|
# write operations, you must first create a database. A database belongs
|
30
40
|
# to a {Instance} and contains tables and indexes. You may create multiple
|
@@ -38,6 +48,9 @@ module Google
|
|
38
48
|
# of {Google::Cloud::Spanner::Client}. See
|
39
49
|
# {Google::Cloud::Spanner::Project#client}.
|
40
50
|
#
|
51
|
+
# @deprecated Use
|
52
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin} instead.
|
53
|
+
#
|
41
54
|
# @example
|
42
55
|
# require "google/cloud"
|
43
56
|
#
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "delegate"
|
17
20
|
|
@@ -23,6 +26,10 @@ module Google
|
|
23
26
|
##
|
24
27
|
# Instance::Config::List is a special case Array with additional
|
25
28
|
# values.
|
29
|
+
#
|
30
|
+
# @deprecated Use the result of
|
31
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instance_configs}
|
32
|
+
# instead.
|
26
33
|
class List < DelegateClass(::Array)
|
27
34
|
##
|
28
35
|
# If not empty, indicates that there are more records that match
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/instance/config/list"
|
17
20
|
|
@@ -29,6 +32,10 @@ module Google
|
|
29
32
|
# See {Google::Cloud::Spanner::Project#instance_configs} and
|
30
33
|
# {Google::Cloud::Spanner::Project#instance_config}.
|
31
34
|
#
|
35
|
+
# @deprecated Use
|
36
|
+
# {Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig}
|
37
|
+
# instead.
|
38
|
+
#
|
32
39
|
# @example
|
33
40
|
# require "google/cloud/spanner"
|
34
41
|
#
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "google/cloud/spanner/status"
|
17
20
|
|
@@ -31,6 +34,10 @@ module Google
|
|
31
34
|
# @see https://cloud.google.com/spanner/reference/rpc/google.longrunning#google.longrunning.Operation
|
32
35
|
# Long-running Operation
|
33
36
|
#
|
37
|
+
# @deprecated Use the long-running operation returned by
|
38
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#create_instance}
|
39
|
+
# instead.
|
40
|
+
#
|
34
41
|
# @example
|
35
42
|
# require "google/cloud/spanner"
|
36
43
|
#
|
@@ -12,6 +12,9 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
# DO NOT EDIT: Unless you're fixing a P0/P1 and/or a security issue. This class
|
16
|
+
# is frozen to all new features from `google-cloud-spanner/v2.11.0` onwards.
|
17
|
+
|
15
18
|
|
16
19
|
require "delegate"
|
17
20
|
|
@@ -22,6 +25,10 @@ module Google
|
|
22
25
|
##
|
23
26
|
# Instance::List is a special case Array with additional
|
24
27
|
# values.
|
28
|
+
#
|
29
|
+
# @deprecated Use the result of
|
30
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instances}
|
31
|
+
# instead.
|
25
32
|
class List < DelegateClass(::Array)
|
26
33
|
##
|
27
34
|
# If not empty, indicates that there are more records that match
|