google-cloud-spanner 1.6.1 → 1.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google-cloud-spanner.rb +5 -4
- data/lib/google/cloud/spanner.rb +2 -346
- data/lib/google/cloud/spanner/admin/database.rb +39 -3
- data/lib/google/cloud/spanner/admin/database/credentials.rb +5 -9
- data/lib/google/cloud/spanner/admin/database/v1.rb +69 -28
- data/lib/google/cloud/spanner/admin/database/v1/credentials.rb +46 -0
- data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +111 -53
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/iam_policy.rb +63 -0
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb +8 -19
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/longrunning/operations.rb +93 -0
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/any.rb +15 -9
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/empty.rb +29 -0
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/rpc/status.rb +2 -1
- data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +2 -12
- data/lib/google/cloud/spanner/admin/instance.rb +39 -3
- data/lib/google/cloud/spanner/admin/instance/credentials.rb +5 -9
- data/lib/google/cloud/spanner/admin/instance/v1.rb +69 -28
- data/lib/google/cloud/spanner/admin/instance/v1/credentials.rb +46 -0
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/iam_policy.rb +63 -0
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb +8 -19
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/longrunning/operations.rb +93 -0
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/any.rb +15 -9
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/empty.rb +29 -0
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/field_mask.rb +8 -1
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/rpc/status.rb +2 -1
- data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +2 -12
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +125 -58
- data/lib/google/cloud/spanner/database/job.rb +1 -0
- data/lib/google/cloud/spanner/instance/job.rb +1 -0
- data/lib/google/cloud/spanner/v1/credentials.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/protobuf/duration.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/protobuf/empty.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/protobuf/struct.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/protobuf/timestamp.rb +9 -6
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb +1 -0
- data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/type.rb +1 -0
- data/lib/google/cloud/spanner/v1/spanner_client.rb +28 -26
- data/lib/google/cloud/spanner/version.rb +1 -1
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +1 -1
- data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +3 -2
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +1 -1
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +3 -2
- data/lib/google/spanner/v1/keys_pb.rb +1 -0
- data/lib/google/spanner/v1/mutation_pb.rb +1 -0
- data/lib/google/spanner/v1/query_plan_pb.rb +1 -0
- data/lib/google/spanner/v1/result_set_pb.rb +1 -0
- data/lib/google/spanner/v1/spanner_pb.rb +1 -0
- data/lib/google/spanner/v1/spanner_services_pb.rb +1 -0
- data/lib/google/spanner/v1/transaction_pb.rb +1 -0
- data/lib/google/spanner/v1/type_pb.rb +1 -0
- metadata +14 -8
- data/lib/google/cloud/spanner/admin/database/v1/doc/overview.rb +0 -58
- data/lib/google/cloud/spanner/admin/instance/v1/doc/overview.rb +0 -58
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
|
15
16
|
module Google
|
16
17
|
module Protobuf
|
17
18
|
# A Timestamp represents a point in time independent of any time zone
|
@@ -72,12 +73,14 @@ module Google
|
|
72
73
|
#
|
73
74
|
# In JSON format, the Timestamp type is encoded as a string in the
|
74
75
|
# [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
|
75
|
-
# format is "{year}
|
76
|
-
# where {year} is always expressed using four digits while {month}, {day},
|
77
|
-
# {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
76
|
+
# format is "\\{year}-\\{month}-\\{day}T\\{hour}:\\{min}:\\{sec}[.\\{frac_sec}]Z"
|
77
|
+
# where \\{year} is always expressed using four digits while \\{month}, \\{day},
|
78
|
+
# \\{hour}, \\{min}, and \\{sec} are zero-padded to two digits each. The fractional
|
78
79
|
# seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
79
80
|
# are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
80
|
-
# is required
|
81
|
+
# is required. A proto3 JSON serializer should always use UTC (as indicated by
|
82
|
+
# "Z") when printing the Timestamp type and a proto3 JSON parser should be
|
83
|
+
# able to accept both UTC and other timezones (as indicated by an offset).
|
81
84
|
#
|
82
85
|
# For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
83
86
|
# 01:30 UTC on January 15, 2017.
|
@@ -88,8 +91,8 @@ module Google
|
|
88
91
|
# to this format using [+strftime+](https://docs.python.org/2/library/time.html#time.strftime)
|
89
92
|
# with the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one
|
90
93
|
# can use the Joda Time's [+ISODateTimeFormat.dateTime()+](
|
91
|
-
# http://joda-time
|
92
|
-
# to obtain a formatter capable of generating timestamps in this format.
|
94
|
+
# http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime--
|
95
|
+
# ) to obtain a formatter capable of generating timestamps in this format.
|
93
96
|
# @!attribute [rw] seconds
|
94
97
|
# @return [Integer]
|
95
98
|
# Represents seconds of UTC time since Unix epoch
|
@@ -19,6 +19,7 @@
|
|
19
19
|
# For the short term, the refresh process will only be runnable by Google
|
20
20
|
# engineers.
|
21
21
|
|
22
|
+
|
22
23
|
require "json"
|
23
24
|
require "pathname"
|
24
25
|
|
@@ -39,6 +40,7 @@ module Google
|
|
39
40
|
# @!attribute [r] spanner_stub
|
40
41
|
# @return [Google::Spanner::V1::Spanner::Stub]
|
41
42
|
class SpannerClient
|
43
|
+
# @private
|
42
44
|
attr_reader :spanner_stub
|
43
45
|
|
44
46
|
# The default address of the service.
|
@@ -316,9 +318,9 @@ module Google
|
|
316
318
|
# @return [Google::Spanner::V1::Session]
|
317
319
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
318
320
|
# @example
|
319
|
-
# require "google/cloud/spanner"
|
321
|
+
# require "google/cloud/spanner/v1"
|
320
322
|
#
|
321
|
-
# spanner_client = Google::Cloud::Spanner.new
|
323
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
322
324
|
# formatted_database = Google::Cloud::Spanner::V1::SpannerClient.database_path("[PROJECT]", "[INSTANCE]", "[DATABASE]")
|
323
325
|
# response = spanner_client.create_session(formatted_database)
|
324
326
|
|
@@ -350,9 +352,9 @@ module Google
|
|
350
352
|
# @return [Google::Spanner::V1::Session]
|
351
353
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
352
354
|
# @example
|
353
|
-
# require "google/cloud/spanner"
|
355
|
+
# require "google/cloud/spanner/v1"
|
354
356
|
#
|
355
|
-
# spanner_client = Google::Cloud::Spanner.new
|
357
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
356
358
|
# formatted_name = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
357
359
|
# response = spanner_client.get_session(formatted_name)
|
358
360
|
|
@@ -401,9 +403,9 @@ module Google
|
|
401
403
|
# object.
|
402
404
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
403
405
|
# @example
|
404
|
-
# require "google/cloud/spanner"
|
406
|
+
# require "google/cloud/spanner/v1"
|
405
407
|
#
|
406
|
-
# spanner_client = Google::Cloud::Spanner.new
|
408
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
407
409
|
# formatted_database = Google::Cloud::Spanner::V1::SpannerClient.database_path("[PROJECT]", "[INSTANCE]", "[DATABASE]")
|
408
410
|
#
|
409
411
|
# # Iterate over all results.
|
@@ -446,9 +448,9 @@ module Google
|
|
446
448
|
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
447
449
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
448
450
|
# @example
|
449
|
-
# require "google/cloud/spanner"
|
451
|
+
# require "google/cloud/spanner/v1"
|
450
452
|
#
|
451
|
-
# spanner_client = Google::Cloud::Spanner.new
|
453
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
452
454
|
# formatted_name = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
453
455
|
# spanner_client.delete_session(formatted_name)
|
454
456
|
|
@@ -538,9 +540,9 @@ module Google
|
|
538
540
|
# @return [Google::Spanner::V1::ResultSet]
|
539
541
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
540
542
|
# @example
|
541
|
-
# require "google/cloud/spanner"
|
543
|
+
# require "google/cloud/spanner/v1"
|
542
544
|
#
|
543
|
-
# spanner_client = Google::Cloud::Spanner.new
|
545
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
544
546
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
545
547
|
#
|
546
548
|
# # TODO: Initialize +sql+:
|
@@ -639,9 +641,9 @@ module Google
|
|
639
641
|
#
|
640
642
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
641
643
|
# @example
|
642
|
-
# require "google/cloud/spanner"
|
644
|
+
# require "google/cloud/spanner/v1"
|
643
645
|
#
|
644
|
-
# spanner_client = Google::Cloud::Spanner.new
|
646
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
645
647
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
646
648
|
#
|
647
649
|
# # TODO: Initialize +sql+:
|
@@ -744,9 +746,9 @@ module Google
|
|
744
746
|
# @return [Google::Spanner::V1::ResultSet]
|
745
747
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
746
748
|
# @example
|
747
|
-
# require "google/cloud/spanner"
|
749
|
+
# require "google/cloud/spanner/v1"
|
748
750
|
#
|
749
|
-
# spanner_client = Google::Cloud::Spanner.new
|
751
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
750
752
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
751
753
|
#
|
752
754
|
# # TODO: Initialize +table+:
|
@@ -847,9 +849,9 @@ module Google
|
|
847
849
|
#
|
848
850
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
849
851
|
# @example
|
850
|
-
# require "google/cloud/spanner"
|
852
|
+
# require "google/cloud/spanner/v1"
|
851
853
|
#
|
852
|
-
# spanner_client = Google::Cloud::Spanner.new
|
854
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
853
855
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
854
856
|
#
|
855
857
|
# # TODO: Initialize +table+:
|
@@ -910,9 +912,9 @@ module Google
|
|
910
912
|
# @return [Google::Spanner::V1::Transaction]
|
911
913
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
912
914
|
# @example
|
913
|
-
# require "google/cloud/spanner"
|
915
|
+
# require "google/cloud/spanner/v1"
|
914
916
|
#
|
915
|
-
# spanner_client = Google::Cloud::Spanner.new
|
917
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
916
918
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
917
919
|
#
|
918
920
|
# # TODO: Initialize +options_+:
|
@@ -972,9 +974,9 @@ module Google
|
|
972
974
|
# @return [Google::Spanner::V1::CommitResponse]
|
973
975
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
974
976
|
# @example
|
975
|
-
# require "google/cloud/spanner"
|
977
|
+
# require "google/cloud/spanner/v1"
|
976
978
|
#
|
977
|
-
# spanner_client = Google::Cloud::Spanner.new
|
979
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
978
980
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
979
981
|
#
|
980
982
|
# # TODO: Initialize +mutations+:
|
@@ -1019,9 +1021,9 @@ module Google
|
|
1019
1021
|
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
1020
1022
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1021
1023
|
# @example
|
1022
|
-
# require "google/cloud/spanner"
|
1024
|
+
# require "google/cloud/spanner/v1"
|
1023
1025
|
#
|
1024
|
-
# spanner_client = Google::Cloud::Spanner.new
|
1026
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
1025
1027
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
1026
1028
|
#
|
1027
1029
|
# # TODO: Initialize +transaction_id+:
|
@@ -1106,9 +1108,9 @@ module Google
|
|
1106
1108
|
# @return [Google::Spanner::V1::PartitionResponse]
|
1107
1109
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1108
1110
|
# @example
|
1109
|
-
# require "google/cloud/spanner"
|
1111
|
+
# require "google/cloud/spanner/v1"
|
1110
1112
|
#
|
1111
|
-
# spanner_client = Google::Cloud::Spanner.new
|
1113
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
1112
1114
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
1113
1115
|
#
|
1114
1116
|
# # TODO: Initialize +sql+:
|
@@ -1184,9 +1186,9 @@ module Google
|
|
1184
1186
|
# @return [Google::Spanner::V1::PartitionResponse]
|
1185
1187
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
1186
1188
|
# @example
|
1187
|
-
# require "google/cloud/spanner"
|
1189
|
+
# require "google/cloud/spanner/v1"
|
1188
1190
|
#
|
1189
|
-
# spanner_client = Google::Cloud::Spanner.new
|
1191
|
+
# spanner_client = Google::Cloud::Spanner::V1::SpannerClient.new
|
1190
1192
|
# formatted_session = Google::Cloud::Spanner::V1::SpannerClient.session_path("[PROJECT]", "[INSTANCE]", "[DATABASE]", "[SESSION]")
|
1191
1193
|
#
|
1192
1194
|
# # TODO: Initialize +table+:
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/spanner/admin/database/v1/spanner_database_admin.proto
|
3
3
|
|
4
|
+
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
7
|
require 'google/api/annotations_pb'
|
7
|
-
require 'google/api/auth_pb'
|
8
8
|
require 'google/iam/v1/iam_policy_pb'
|
9
9
|
require 'google/iam/v1/policy_pb'
|
10
10
|
require 'google/longrunning/operations_pb'
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/spanner/admin/database/v1/spanner_database_admin.proto for package 'google.spanner.admin.database.v1'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2018 Google Inc.
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
11
|
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -16,6 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
+
|
19
20
|
require 'grpc'
|
20
21
|
require 'google/spanner/admin/database/v1/spanner_database_admin_pb'
|
21
22
|
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/spanner/admin/instance/v1/spanner_instance_admin.proto
|
3
3
|
|
4
|
+
|
4
5
|
require 'google/protobuf'
|
5
6
|
|
6
7
|
require 'google/api/annotations_pb'
|
7
|
-
require 'google/api/auth_pb'
|
8
8
|
require 'google/iam/v1/iam_policy_pb'
|
9
9
|
require 'google/iam/v1/policy_pb'
|
10
10
|
require 'google/longrunning/operations_pb'
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/spanner/admin/instance/v1/spanner_instance_admin.proto for package 'google.spanner.admin.instance.v1'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2018 Google Inc.
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
8
8
|
# You may obtain a copy of the License at
|
9
9
|
#
|
10
|
-
#
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
11
11
|
#
|
12
12
|
# Unless required by applicable law or agreed to in writing, software
|
13
13
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
@@ -16,6 +16,7 @@
|
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
18
|
|
19
|
+
|
19
20
|
require 'grpc'
|
20
21
|
require 'google/spanner/admin/instance/v1/spanner_instance_admin_pb'
|
21
22
|
|