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
@@ -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/job"
|
17
20
|
require "google/cloud/spanner/instance/list"
|
@@ -25,6 +28,13 @@ module Google
|
|
25
28
|
##
|
26
29
|
# # Instance
|
27
30
|
#
|
31
|
+
# NOTE: From `google-cloud-spanner/v2.11.0` onwards, new features for
|
32
|
+
# mananging instances will only be available through the
|
33
|
+
# [google-cloud-spanner-admin-instance-v1](https://github.com/googleapis/google-cloud-ruby/tree/master/google-cloud-spanner-admin-instance-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 instance. Instances are dedicated Cloud
|
29
39
|
# Spanner serving and storage resources to be used by Cloud Spanner
|
30
40
|
# databases. Instances offer isolation: problems with databases in one
|
@@ -38,6 +48,10 @@ module Google
|
|
38
48
|
# {Google::Cloud::Spanner::Project#instance}, and
|
39
49
|
# {Google::Cloud::Spanner::Project#create_instance}.
|
40
50
|
#
|
51
|
+
# @deprecated Use
|
52
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin}
|
53
|
+
# instead.
|
54
|
+
#
|
41
55
|
# @example
|
42
56
|
# require "google/cloud/spanner"
|
43
57
|
#
|
@@ -106,6 +106,10 @@ module Google
|
|
106
106
|
# @return [Array<Google::Cloud::Spanner::Instance>] The list of
|
107
107
|
# instances. (See {Google::Cloud::Spanner::Instance::List})
|
108
108
|
#
|
109
|
+
# @deprecated Use
|
110
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instances}
|
111
|
+
# instead.
|
112
|
+
#
|
109
113
|
# @example
|
110
114
|
# require "google/cloud/spanner"
|
111
115
|
#
|
@@ -140,6 +144,10 @@ module Google
|
|
140
144
|
# @return [Google::Cloud::Spanner::Instance, nil] The instance, or `nil`
|
141
145
|
# if the instance does not exist.
|
142
146
|
#
|
147
|
+
# @deprecated Use
|
148
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#get_instance}
|
149
|
+
# instead.
|
150
|
+
#
|
143
151
|
# @example
|
144
152
|
# require "google/cloud/spanner"
|
145
153
|
#
|
@@ -200,6 +208,10 @@ module Google
|
|
200
208
|
# asynchronous processing of an instance create operation.
|
201
209
|
# @raise [ArgumentError] if both processing_units or nodes are specified.
|
202
210
|
#
|
211
|
+
# @deprecated Use
|
212
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#create_instance}
|
213
|
+
# instead.
|
214
|
+
#
|
203
215
|
# @example
|
204
216
|
# require "google/cloud/spanner"
|
205
217
|
#
|
@@ -266,6 +278,10 @@ module Google
|
|
266
278
|
# instance configurations. (See
|
267
279
|
# {Google::Cloud::Spanner::Instance::Config::List})
|
268
280
|
#
|
281
|
+
# @deprecated Use
|
282
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#list_instance_configs}
|
283
|
+
# instead.
|
284
|
+
#
|
269
285
|
# @example
|
270
286
|
# require "google/cloud/spanner"
|
271
287
|
#
|
@@ -303,6 +319,10 @@ module Google
|
|
303
319
|
# configuration, or `nil` if the instance configuration does not
|
304
320
|
# exist.
|
305
321
|
#
|
322
|
+
# @deprecated Use
|
323
|
+
# {Google::Cloud::Spanner::Admin::Instance#instance_admin Client#get_instance_config}
|
324
|
+
# instead.
|
325
|
+
#
|
306
326
|
# @example
|
307
327
|
# require "google/cloud/spanner"
|
308
328
|
#
|
@@ -335,6 +355,10 @@ module Google
|
|
335
355
|
# @return [Array<Google::Cloud::Spanner::Database>] The list of
|
336
356
|
# databases. (See {Google::Cloud::Spanner::Database::List})
|
337
357
|
#
|
358
|
+
# @deprecated Use
|
359
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#list_databases}
|
360
|
+
# instead.
|
361
|
+
#
|
338
362
|
# @example
|
339
363
|
# require "google/cloud/spanner"
|
340
364
|
#
|
@@ -370,6 +394,10 @@ module Google
|
|
370
394
|
# @return [Google::Cloud::Spanner::Database, nil] The database, or `nil`
|
371
395
|
# if the database does not exist.
|
372
396
|
#
|
397
|
+
# @deprecated Use
|
398
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#get_database}
|
399
|
+
# instead.
|
400
|
+
#
|
373
401
|
# @example
|
374
402
|
# require "google/cloud/spanner"
|
375
403
|
#
|
@@ -417,6 +445,10 @@ module Google
|
|
417
445
|
# @return [Database::Job] The job representing the long-running,
|
418
446
|
# asynchronous processing of a database create operation.
|
419
447
|
#
|
448
|
+
# @deprecated Use
|
449
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#create_database}
|
450
|
+
# instead.
|
451
|
+
#
|
420
452
|
# @example
|
421
453
|
# require "google/cloud/spanner"
|
422
454
|
#
|
@@ -629,6 +661,9 @@ module Google
|
|
629
661
|
raise "Must have active connection to service" unless service
|
630
662
|
end
|
631
663
|
|
664
|
+
# @deprecated Use
|
665
|
+
# {Google::Cloud::Spanner::Admin::Database#database_admin Client#database_path}
|
666
|
+
# instead.
|
632
667
|
def database_path instance_id, database_id
|
633
668
|
Admin::Database::V1::DatabaseAdminClient.database_path(
|
634
669
|
project, instance_id, database_id
|
@@ -34,13 +34,15 @@ module Google
|
|
34
34
|
attr_accessor :host
|
35
35
|
attr_accessor :lib_name
|
36
36
|
attr_accessor :lib_version
|
37
|
+
attr_accessor :quota_project
|
37
38
|
|
38
39
|
##
|
39
40
|
# Creates a new Service instance.
|
40
|
-
def initialize project, credentials,
|
41
|
+
def initialize project, credentials, quota_project: nil,
|
41
42
|
host: nil, timeout: nil, lib_name: nil, lib_version: nil
|
42
43
|
@project = project
|
43
44
|
@credentials = credentials
|
45
|
+
@quota_project = quota_project || (credentials.quota_project_id if credentials.respond_to? :quota_project_id)
|
44
46
|
@host = host
|
45
47
|
@timeout = timeout
|
46
48
|
@lib_name = lib_name
|
@@ -68,6 +70,7 @@ module Google
|
|
68
70
|
@service ||= \
|
69
71
|
V1::Spanner::Client.new do |config|
|
70
72
|
config.credentials = channel
|
73
|
+
config.quota_project = @quota_project
|
71
74
|
config.timeout = timeout if timeout
|
72
75
|
config.endpoint = host if host
|
73
76
|
config.lib_name = lib_name_with_prefix
|
@@ -82,6 +85,7 @@ module Google
|
|
82
85
|
@instances ||= \
|
83
86
|
Admin::Instance::V1::InstanceAdmin::Client.new do |config|
|
84
87
|
config.credentials = channel
|
88
|
+
config.quota_project = @quota_project
|
85
89
|
config.timeout = timeout if timeout
|
86
90
|
config.endpoint = host if host
|
87
91
|
config.lib_name = lib_name_with_prefix
|
@@ -96,6 +100,7 @@ module Google
|
|
96
100
|
@databases ||= \
|
97
101
|
Admin::Database::V1::DatabaseAdmin::Client.new do |config|
|
98
102
|
config.credentials = channel
|
103
|
+
config.quota_project = @quota_project
|
99
104
|
config.timeout = timeout if timeout
|
100
105
|
config.endpoint = host if host
|
101
106
|
config.lib_name = lib_name_with_prefix
|
data/lib/google/cloud/spanner.rb
CHANGED
@@ -120,7 +120,7 @@ module Google
|
|
120
120
|
|
121
121
|
Spanner::Project.new(
|
122
122
|
Spanner::Service.new(
|
123
|
-
project_id, credentials,
|
123
|
+
project_id, credentials, quota_project: configure.quota_project,
|
124
124
|
host: endpoint, timeout: timeout, lib_name: lib_name,
|
125
125
|
lib_version: lib_version
|
126
126
|
),
|
@@ -143,6 +143,8 @@ module Google
|
|
143
143
|
# parameter `keyfile` is considered deprecated, but may also be used.)
|
144
144
|
# * `scope` - (String, Array<String>) The OAuth 2.0 scopes controlling
|
145
145
|
# the set of resources and operations that the connection can access.
|
146
|
+
# * `quota_project` - (String) The project ID for a project that can be
|
147
|
+
# used by client libraries for quota and billing purposes.
|
146
148
|
# * `timeout` - (Integer) Default timeout to use in requests.
|
147
149
|
# * `endpoint` - (String) Override of the endpoint host name, or `nil`
|
148
150
|
# to use the default endpoint.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-spanner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-02-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|
@@ -269,7 +269,9 @@ files:
|
|
269
269
|
- TROUBLESHOOTING.md
|
270
270
|
- lib/google-cloud-spanner.rb
|
271
271
|
- lib/google/cloud/spanner.rb
|
272
|
+
- lib/google/cloud/spanner/admin/database.rb
|
272
273
|
- lib/google/cloud/spanner/admin/database/credentials.rb
|
274
|
+
- lib/google/cloud/spanner/admin/instance.rb
|
273
275
|
- lib/google/cloud/spanner/admin/instance/credentials.rb
|
274
276
|
- lib/google/cloud/spanner/backup.rb
|
275
277
|
- lib/google/cloud/spanner/backup/job.rb
|
@@ -331,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
331
333
|
- !ruby/object:Gem::Version
|
332
334
|
version: '0'
|
333
335
|
requirements: []
|
334
|
-
rubygems_version: 3.
|
336
|
+
rubygems_version: 3.3.5
|
335
337
|
signing_key:
|
336
338
|
specification_version: 4
|
337
339
|
summary: API Client library for Google Cloud Spanner API
|