google-cloud-spanner 1.14.0 → 2.0.0

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.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +1 -1
  3. data/CHANGELOG.md +51 -0
  4. data/CONTRIBUTING.md +5 -5
  5. data/TROUBLESHOOTING.md +0 -6
  6. data/lib/google-cloud-spanner.rb +23 -13
  7. data/lib/google/cloud/spanner.rb +8 -9
  8. data/lib/google/cloud/spanner/admin/database/credentials.rb +2 -2
  9. data/lib/google/cloud/spanner/admin/instance/credentials.rb +2 -2
  10. data/lib/google/cloud/spanner/backup.rb +315 -0
  11. data/lib/google/cloud/spanner/backup/job.rb +274 -0
  12. data/lib/google/cloud/spanner/backup/job/list.rb +177 -0
  13. data/lib/google/cloud/spanner/backup/list.rb +169 -0
  14. data/lib/google/cloud/spanner/backup/restore/job.rb +246 -0
  15. data/lib/google/cloud/spanner/batch_client.rb +7 -5
  16. data/lib/google/cloud/spanner/batch_snapshot.rb +49 -16
  17. data/lib/google/cloud/spanner/batch_update.rb +1 -1
  18. data/lib/google/cloud/spanner/client.rb +65 -16
  19. data/lib/google/cloud/spanner/commit.rb +14 -14
  20. data/lib/google/cloud/spanner/convert.rb +7 -7
  21. data/lib/google/cloud/spanner/credentials.rb +2 -2
  22. data/lib/google/cloud/spanner/data.rb +2 -2
  23. data/lib/google/cloud/spanner/database.rb +275 -15
  24. data/lib/google/cloud/spanner/database/backup_info.rb +105 -0
  25. data/lib/google/cloud/spanner/database/job.rb +5 -2
  26. data/lib/google/cloud/spanner/database/job/list.rb +177 -0
  27. data/lib/google/cloud/spanner/database/list.rb +1 -1
  28. data/lib/google/cloud/spanner/database/restore_info.rb +63 -0
  29. data/lib/google/cloud/spanner/fields.rb +8 -8
  30. data/lib/google/cloud/spanner/instance.rb +401 -8
  31. data/lib/google/cloud/spanner/instance/config.rb +1 -1
  32. data/lib/google/cloud/spanner/instance/config/list.rb +1 -1
  33. data/lib/google/cloud/spanner/instance/job.rb +2 -2
  34. data/lib/google/cloud/spanner/instance/list.rb +1 -1
  35. data/lib/google/cloud/spanner/partition.rb +4 -4
  36. data/lib/google/cloud/spanner/policy.rb +2 -2
  37. data/lib/google/cloud/spanner/project.rb +31 -6
  38. data/lib/google/cloud/spanner/results.rb +4 -2
  39. data/lib/google/cloud/spanner/service.rb +231 -240
  40. data/lib/google/cloud/spanner/session.rb +46 -15
  41. data/lib/google/cloud/spanner/snapshot.rb +28 -5
  42. data/lib/google/cloud/spanner/transaction.rb +51 -7
  43. data/lib/google/cloud/spanner/version.rb +1 -1
  44. metadata +28 -104
  45. data/lib/google/cloud/spanner/admin/database.rb +0 -148
  46. data/lib/google/cloud/spanner/admin/database/v1.rb +0 -146
  47. data/lib/google/cloud/spanner/admin/database/v1/credentials.rb +0 -46
  48. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +0 -791
  49. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json +0 -71
  50. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/iam_policy.rb +0 -64
  51. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/options.rb +0 -33
  52. data/lib/google/cloud/spanner/admin/database/v1/doc/google/iam/v1/policy.rb +0 -151
  53. data/lib/google/cloud/spanner/admin/database/v1/doc/google/longrunning/operations.rb +0 -51
  54. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/any.rb +0 -131
  55. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/empty.rb +0 -29
  56. data/lib/google/cloud/spanner/admin/database/v1/doc/google/rpc/status.rb +0 -39
  57. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +0 -201
  58. data/lib/google/cloud/spanner/admin/database/v1/doc/google/type/expr.rb +0 -45
  59. data/lib/google/cloud/spanner/admin/instance.rb +0 -164
  60. data/lib/google/cloud/spanner/admin/instance/v1.rb +0 -162
  61. data/lib/google/cloud/spanner/admin/instance/v1/credentials.rb +0 -46
  62. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/iam_policy.rb +0 -64
  63. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/options.rb +0 -33
  64. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/iam/v1/policy.rb +0 -151
  65. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/longrunning/operations.rb +0 -51
  66. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/any.rb +0 -131
  67. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/empty.rb +0 -29
  68. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/protobuf/field_mask.rb +0 -222
  69. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/rpc/status.rb +0 -39
  70. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +0 -341
  71. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/type/expr.rb +0 -45
  72. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +0 -972
  73. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client_config.json +0 -76
  74. data/lib/google/cloud/spanner/v1.rb +0 -16
  75. data/lib/google/cloud/spanner/v1/credentials.rb +0 -42
  76. data/lib/google/cloud/spanner/v1/doc/google/protobuf/any.rb +0 -131
  77. data/lib/google/cloud/spanner/v1/doc/google/protobuf/duration.rb +0 -91
  78. data/lib/google/cloud/spanner/v1/doc/google/protobuf/empty.rb +0 -29
  79. data/lib/google/cloud/spanner/v1/doc/google/protobuf/struct.rb +0 -74
  80. data/lib/google/cloud/spanner/v1/doc/google/protobuf/timestamp.rb +0 -113
  81. data/lib/google/cloud/spanner/v1/doc/google/rpc/status.rb +0 -39
  82. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/keys.rb +0 -150
  83. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +0 -88
  84. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/query_plan.rb +0 -121
  85. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/result_set.rb +0 -190
  86. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +0 -581
  87. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/transaction.rb +0 -432
  88. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/type.rb +0 -112
  89. data/lib/google/cloud/spanner/v1/spanner_client.rb +0 -1509
  90. data/lib/google/cloud/spanner/v1/spanner_client_config.json +0 -121
  91. data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +0 -88
  92. data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +0 -99
  93. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +0 -125
  94. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +0 -182
  95. data/lib/google/spanner/v1/keys_pb.rb +0 -34
  96. data/lib/google/spanner/v1/mutation_pb.rb +0 -39
  97. data/lib/google/spanner/v1/query_plan_pb.rb +0 -48
  98. data/lib/google/spanner/v1/result_set_pb.rb +0 -48
  99. data/lib/google/spanner/v1/spanner_pb.rb +0 -174
  100. data/lib/google/spanner/v1/spanner_services_pb.rb +0 -188
  101. data/lib/google/spanner/v1/transaction_pb.rb +0 -56
  102. data/lib/google/spanner/v1/type_pb.rb +0 -44
@@ -1,121 +0,0 @@
1
- {
2
- "interfaces": {
3
- "google.spanner.v1.Spanner": {
4
- "retry_codes": {
5
- "idempotent": [
6
- "UNAVAILABLE"
7
- ],
8
- "non_idempotent": [],
9
- "long_running": [
10
- "UNAVAILABLE"
11
- ]
12
- },
13
- "retry_params": {
14
- "default": {
15
- "initial_retry_delay_millis": 250,
16
- "retry_delay_multiplier": 1.3,
17
- "max_retry_delay_millis": 32000,
18
- "initial_rpc_timeout_millis": 360000,
19
- "rpc_timeout_multiplier": 1.0,
20
- "max_rpc_timeout_millis": 360000,
21
- "total_timeout_millis": 3600000
22
- },
23
- "streaming": {
24
- "initial_retry_delay_millis": 250,
25
- "retry_delay_multiplier": 1.3,
26
- "max_retry_delay_millis": 32000,
27
- "initial_rpc_timeout_millis": 360000,
28
- "rpc_timeout_multiplier": 1.0,
29
- "max_rpc_timeout_millis": 360000,
30
- "total_timeout_millis": 3600000
31
- },
32
- "long_running": {
33
- "initial_retry_delay_millis": 250,
34
- "retry_delay_multiplier": 1.3,
35
- "max_retry_delay_millis": 32000,
36
- "initial_rpc_timeout_millis": 3600000,
37
- "rpc_timeout_multiplier": 1.0,
38
- "max_rpc_timeout_millis": 3600000,
39
- "total_timeout_millis": 3600000
40
- }
41
- },
42
- "methods": {
43
- "CreateSession": {
44
- "timeout_millis": 30000,
45
- "retry_codes_name": "idempotent",
46
- "retry_params_name": "default"
47
- },
48
- "BatchCreateSessions": {
49
- "timeout_millis": 60000,
50
- "retry_codes_name": "idempotent",
51
- "retry_params_name": "default"
52
- },
53
- "GetSession": {
54
- "timeout_millis": 30000,
55
- "retry_codes_name": "idempotent",
56
- "retry_params_name": "default"
57
- },
58
- "ListSessions": {
59
- "timeout_millis": 3600000,
60
- "retry_codes_name": "idempotent",
61
- "retry_params_name": "default"
62
- },
63
- "DeleteSession": {
64
- "timeout_millis": 30000,
65
- "retry_codes_name": "idempotent",
66
- "retry_params_name": "default"
67
- },
68
- "ExecuteSql": {
69
- "timeout_millis": 30000,
70
- "retry_codes_name": "idempotent",
71
- "retry_params_name": "default"
72
- },
73
- "ExecuteStreamingSql": {
74
- "timeout_millis": 3600000,
75
- "retry_codes_name": "non_idempotent",
76
- "retry_params_name": "streaming"
77
- },
78
- "ExecuteBatchDml": {
79
- "timeout_millis": 30000,
80
- "retry_codes_name": "idempotent",
81
- "retry_params_name": "default"
82
- },
83
- "Read": {
84
- "timeout_millis": 30000,
85
- "retry_codes_name": "idempotent",
86
- "retry_params_name": "default"
87
- },
88
- "StreamingRead": {
89
- "timeout_millis": 3600000,
90
- "retry_codes_name": "non_idempotent",
91
- "retry_params_name": "streaming"
92
- },
93
- "BeginTransaction": {
94
- "timeout_millis": 30000,
95
- "retry_codes_name": "idempotent",
96
- "retry_params_name": "default"
97
- },
98
- "Commit": {
99
- "timeout_millis": 3600000,
100
- "retry_codes_name": "long_running",
101
- "retry_params_name": "long_running"
102
- },
103
- "Rollback": {
104
- "timeout_millis": 30000,
105
- "retry_codes_name": "idempotent",
106
- "retry_params_name": "default"
107
- },
108
- "PartitionQuery": {
109
- "timeout_millis": 30000,
110
- "retry_codes_name": "idempotent",
111
- "retry_params_name": "default"
112
- },
113
- "PartitionRead": {
114
- "timeout_millis": 30000,
115
- "retry_codes_name": "idempotent",
116
- "retry_params_name": "default"
117
- }
118
- }
119
- }
120
- }
121
- }
@@ -1,88 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/spanner/admin/database/v1/spanner_database_admin.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/api/resource_pb'
11
- require 'google/iam/v1/iam_policy_pb'
12
- require 'google/iam/v1/policy_pb'
13
- require 'google/longrunning/operations_pb'
14
- require 'google/protobuf/empty_pb'
15
- require 'google/protobuf/timestamp_pb'
16
- Google::Protobuf::DescriptorPool.generated_pool.build do
17
- add_message "google.spanner.admin.database.v1.Database" do
18
- optional :name, :string, 1
19
- optional :state, :enum, 2, "google.spanner.admin.database.v1.Database.State"
20
- end
21
- add_enum "google.spanner.admin.database.v1.Database.State" do
22
- value :STATE_UNSPECIFIED, 0
23
- value :CREATING, 1
24
- value :READY, 2
25
- end
26
- add_message "google.spanner.admin.database.v1.ListDatabasesRequest" do
27
- optional :parent, :string, 1
28
- optional :page_size, :int32, 3
29
- optional :page_token, :string, 4
30
- end
31
- add_message "google.spanner.admin.database.v1.ListDatabasesResponse" do
32
- repeated :databases, :message, 1, "google.spanner.admin.database.v1.Database"
33
- optional :next_page_token, :string, 2
34
- end
35
- add_message "google.spanner.admin.database.v1.CreateDatabaseRequest" do
36
- optional :parent, :string, 1
37
- optional :create_statement, :string, 2
38
- repeated :extra_statements, :string, 3
39
- end
40
- add_message "google.spanner.admin.database.v1.CreateDatabaseMetadata" do
41
- optional :database, :string, 1
42
- end
43
- add_message "google.spanner.admin.database.v1.GetDatabaseRequest" do
44
- optional :name, :string, 1
45
- end
46
- add_message "google.spanner.admin.database.v1.UpdateDatabaseDdlRequest" do
47
- optional :database, :string, 1
48
- repeated :statements, :string, 2
49
- optional :operation_id, :string, 3
50
- end
51
- add_message "google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata" do
52
- optional :database, :string, 1
53
- repeated :statements, :string, 2
54
- repeated :commit_timestamps, :message, 3, "google.protobuf.Timestamp"
55
- end
56
- add_message "google.spanner.admin.database.v1.DropDatabaseRequest" do
57
- optional :database, :string, 1
58
- end
59
- add_message "google.spanner.admin.database.v1.GetDatabaseDdlRequest" do
60
- optional :database, :string, 1
61
- end
62
- add_message "google.spanner.admin.database.v1.GetDatabaseDdlResponse" do
63
- repeated :statements, :string, 1
64
- end
65
- end
66
-
67
- module Google
68
- module Spanner
69
- module Admin
70
- module Database
71
- module V1
72
- Database = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database").msgclass
73
- Database::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database.State").enummodule
74
- ListDatabasesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabasesRequest").msgclass
75
- ListDatabasesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabasesResponse").msgclass
76
- CreateDatabaseRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateDatabaseRequest").msgclass
77
- CreateDatabaseMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateDatabaseMetadata").msgclass
78
- GetDatabaseRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseRequest").msgclass
79
- UpdateDatabaseDdlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseDdlRequest").msgclass
80
- UpdateDatabaseDdlMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata").msgclass
81
- DropDatabaseRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DropDatabaseRequest").msgclass
82
- GetDatabaseDdlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlRequest").msgclass
83
- GetDatabaseDdlResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlResponse").msgclass
84
- end
85
- end
86
- end
87
- end
88
- end
@@ -1,99 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/spanner/admin/database/v1/spanner_database_admin.proto for package 'google.spanner.admin.database.v1'
3
- # Original file comments:
4
- # Copyright 2019 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/spanner/admin/database/v1/spanner_database_admin_pb'
23
-
24
- module Google
25
- module Spanner
26
- module Admin
27
- module Database
28
- module V1
29
- module DatabaseAdmin
30
- # Cloud Spanner Database Admin API
31
- #
32
- # The Cloud Spanner Database Admin API can be used to create, drop, and
33
- # list databases. It also enables updating the schema of pre-existing
34
- # databases.
35
- class Service
36
-
37
- include GRPC::GenericService
38
-
39
- self.marshal_class_method = :encode
40
- self.unmarshal_class_method = :decode
41
- self.service_name = 'google.spanner.admin.database.v1.DatabaseAdmin'
42
-
43
- # Lists Cloud Spanner databases.
44
- rpc :ListDatabases, ListDatabasesRequest, ListDatabasesResponse
45
- # Creates a new Cloud Spanner database and starts to prepare it for serving.
46
- # The returned [long-running operation][google.longrunning.Operation] will
47
- # have a name of the format `<database_name>/operations/<operation_id>` and
48
- # can be used to track preparation of the database. The
49
- # [metadata][google.longrunning.Operation.metadata] field type is
50
- # [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata].
51
- # The [response][google.longrunning.Operation.response] field type is
52
- # [Database][google.spanner.admin.database.v1.Database], if successful.
53
- rpc :CreateDatabase, CreateDatabaseRequest, Google::Longrunning::Operation
54
- # Gets the state of a Cloud Spanner database.
55
- rpc :GetDatabase, GetDatabaseRequest, Database
56
- # Updates the schema of a Cloud Spanner database by
57
- # creating/altering/dropping tables, columns, indexes, etc. The returned
58
- # [long-running operation][google.longrunning.Operation] will have a name of
59
- # the format `<database_name>/operations/<operation_id>` and can be used to
60
- # track execution of the schema change(s). The
61
- # [metadata][google.longrunning.Operation.metadata] field type is
62
- # [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
63
- # The operation has no response.
64
- rpc :UpdateDatabaseDdl, UpdateDatabaseDdlRequest, Google::Longrunning::Operation
65
- # Drops (aka deletes) a Cloud Spanner database.
66
- rpc :DropDatabase, DropDatabaseRequest, Google::Protobuf::Empty
67
- # Returns the schema of a Cloud Spanner database as a list of formatted
68
- # DDL statements. This method does not show pending schema updates, those may
69
- # be queried using the [Operations][google.longrunning.Operations] API.
70
- rpc :GetDatabaseDdl, GetDatabaseDdlRequest, GetDatabaseDdlResponse
71
- # Sets the access control policy on a database resource.
72
- # Replaces any existing policy.
73
- #
74
- # Authorization requires `spanner.databases.setIamPolicy`
75
- # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
76
- rpc :SetIamPolicy, Google::Iam::V1::SetIamPolicyRequest, Google::Iam::V1::Policy
77
- # Gets the access control policy for a database resource.
78
- # Returns an empty policy if a database exists but does
79
- # not have a policy set.
80
- #
81
- # Authorization requires `spanner.databases.getIamPolicy` permission on
82
- # [resource][google.iam.v1.GetIamPolicyRequest.resource].
83
- rpc :GetIamPolicy, Google::Iam::V1::GetIamPolicyRequest, Google::Iam::V1::Policy
84
- # Returns permissions that the caller has on the specified database resource.
85
- #
86
- # Attempting this RPC on a non-existent Cloud Spanner database will
87
- # result in a NOT_FOUND error if the user has
88
- # `spanner.databases.list` permission on the containing Cloud
89
- # Spanner instance. Otherwise returns an empty set of permissions.
90
- rpc :TestIamPermissions, Google::Iam::V1::TestIamPermissionsRequest, Google::Iam::V1::TestIamPermissionsResponse
91
- end
92
-
93
- Stub = Service.rpc_stub_class
94
- end
95
- end
96
- end
97
- end
98
- end
99
- end
@@ -1,125 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # source: google/spanner/admin/instance/v1/spanner_instance_admin.proto
3
-
4
-
5
- require 'google/protobuf'
6
-
7
- require 'google/api/annotations_pb'
8
- require 'google/api/client_pb'
9
- require 'google/api/field_behavior_pb'
10
- require 'google/api/resource_pb'
11
- require 'google/iam/v1/iam_policy_pb'
12
- require 'google/iam/v1/policy_pb'
13
- require 'google/longrunning/operations_pb'
14
- require 'google/protobuf/empty_pb'
15
- require 'google/protobuf/field_mask_pb'
16
- require 'google/protobuf/timestamp_pb'
17
- Google::Protobuf::DescriptorPool.generated_pool.build do
18
- add_message "google.spanner.admin.instance.v1.ReplicaInfo" do
19
- optional :location, :string, 1
20
- optional :type, :enum, 2, "google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType"
21
- optional :default_leader_location, :bool, 3
22
- end
23
- add_enum "google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType" do
24
- value :TYPE_UNSPECIFIED, 0
25
- value :READ_WRITE, 1
26
- value :READ_ONLY, 2
27
- value :WITNESS, 3
28
- end
29
- add_message "google.spanner.admin.instance.v1.InstanceConfig" do
30
- optional :name, :string, 1
31
- optional :display_name, :string, 2
32
- repeated :replicas, :message, 3, "google.spanner.admin.instance.v1.ReplicaInfo"
33
- end
34
- add_message "google.spanner.admin.instance.v1.Instance" do
35
- optional :name, :string, 1
36
- optional :config, :string, 2
37
- optional :display_name, :string, 3
38
- optional :node_count, :int32, 5
39
- optional :state, :enum, 6, "google.spanner.admin.instance.v1.Instance.State"
40
- map :labels, :string, :string, 7
41
- repeated :endpoint_uris, :string, 8
42
- end
43
- add_enum "google.spanner.admin.instance.v1.Instance.State" do
44
- value :STATE_UNSPECIFIED, 0
45
- value :CREATING, 1
46
- value :READY, 2
47
- end
48
- add_message "google.spanner.admin.instance.v1.ListInstanceConfigsRequest" do
49
- optional :parent, :string, 1
50
- optional :page_size, :int32, 2
51
- optional :page_token, :string, 3
52
- end
53
- add_message "google.spanner.admin.instance.v1.ListInstanceConfigsResponse" do
54
- repeated :instance_configs, :message, 1, "google.spanner.admin.instance.v1.InstanceConfig"
55
- optional :next_page_token, :string, 2
56
- end
57
- add_message "google.spanner.admin.instance.v1.GetInstanceConfigRequest" do
58
- optional :name, :string, 1
59
- end
60
- add_message "google.spanner.admin.instance.v1.GetInstanceRequest" do
61
- optional :name, :string, 1
62
- optional :field_mask, :message, 2, "google.protobuf.FieldMask"
63
- end
64
- add_message "google.spanner.admin.instance.v1.CreateInstanceRequest" do
65
- optional :parent, :string, 1
66
- optional :instance_id, :string, 2
67
- optional :instance, :message, 3, "google.spanner.admin.instance.v1.Instance"
68
- end
69
- add_message "google.spanner.admin.instance.v1.ListInstancesRequest" do
70
- optional :parent, :string, 1
71
- optional :page_size, :int32, 2
72
- optional :page_token, :string, 3
73
- optional :filter, :string, 4
74
- end
75
- add_message "google.spanner.admin.instance.v1.ListInstancesResponse" do
76
- repeated :instances, :message, 1, "google.spanner.admin.instance.v1.Instance"
77
- optional :next_page_token, :string, 2
78
- end
79
- add_message "google.spanner.admin.instance.v1.UpdateInstanceRequest" do
80
- optional :instance, :message, 1, "google.spanner.admin.instance.v1.Instance"
81
- optional :field_mask, :message, 2, "google.protobuf.FieldMask"
82
- end
83
- add_message "google.spanner.admin.instance.v1.DeleteInstanceRequest" do
84
- optional :name, :string, 1
85
- end
86
- add_message "google.spanner.admin.instance.v1.CreateInstanceMetadata" do
87
- optional :instance, :message, 1, "google.spanner.admin.instance.v1.Instance"
88
- optional :start_time, :message, 2, "google.protobuf.Timestamp"
89
- optional :cancel_time, :message, 3, "google.protobuf.Timestamp"
90
- optional :end_time, :message, 4, "google.protobuf.Timestamp"
91
- end
92
- add_message "google.spanner.admin.instance.v1.UpdateInstanceMetadata" do
93
- optional :instance, :message, 1, "google.spanner.admin.instance.v1.Instance"
94
- optional :start_time, :message, 2, "google.protobuf.Timestamp"
95
- optional :cancel_time, :message, 3, "google.protobuf.Timestamp"
96
- optional :end_time, :message, 4, "google.protobuf.Timestamp"
97
- end
98
- end
99
-
100
- module Google
101
- module Spanner
102
- module Admin
103
- module Instance
104
- module V1
105
- ReplicaInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo").msgclass
106
- ReplicaInfo::ReplicaType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ReplicaInfo.ReplicaType").enummodule
107
- InstanceConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.InstanceConfig").msgclass
108
- Instance = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance").msgclass
109
- Instance::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.Instance.State").enummodule
110
- ListInstanceConfigsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsRequest").msgclass
111
- ListInstanceConfigsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstanceConfigsResponse").msgclass
112
- GetInstanceConfigRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceConfigRequest").msgclass
113
- GetInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.GetInstanceRequest").msgclass
114
- CreateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceRequest").msgclass
115
- ListInstancesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesRequest").msgclass
116
- ListInstancesResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.ListInstancesResponse").msgclass
117
- UpdateInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceRequest").msgclass
118
- DeleteInstanceRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.DeleteInstanceRequest").msgclass
119
- CreateInstanceMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.CreateInstanceMetadata").msgclass
120
- UpdateInstanceMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.instance.v1.UpdateInstanceMetadata").msgclass
121
- end
122
- end
123
- end
124
- end
125
- end
@@ -1,182 +0,0 @@
1
- # Generated by the protocol buffer compiler. DO NOT EDIT!
2
- # Source: google/spanner/admin/instance/v1/spanner_instance_admin.proto for package 'google.spanner.admin.instance.v1'
3
- # Original file comments:
4
- # Copyright 2019 Google LLC.
5
- #
6
- # Licensed under the Apache License, Version 2.0 (the "License");
7
- # you may not use this file except in compliance with the License.
8
- # You may obtain a copy of the License at
9
- #
10
- # http://www.apache.org/licenses/LICENSE-2.0
11
- #
12
- # Unless required by applicable law or agreed to in writing, software
13
- # distributed under the License is distributed on an "AS IS" BASIS,
14
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- # See the License for the specific language governing permissions and
16
- # limitations under the License.
17
- #
18
- #
19
-
20
-
21
- require 'grpc'
22
- require 'google/spanner/admin/instance/v1/spanner_instance_admin_pb'
23
-
24
- module Google
25
- module Spanner
26
- module Admin
27
- module Instance
28
- module V1
29
- module InstanceAdmin
30
- # Cloud Spanner Instance Admin API
31
- #
32
- # The Cloud Spanner Instance Admin API can be used to create, delete,
33
- # modify and list instances. Instances are dedicated Cloud Spanner serving
34
- # and storage resources to be used by Cloud Spanner databases.
35
- #
36
- # Each instance has a "configuration", which dictates where the
37
- # serving resources for the Cloud Spanner instance are located (e.g.,
38
- # US-central, Europe). Configurations are created by Google based on
39
- # resource availability.
40
- #
41
- # Cloud Spanner billing is based on the instances that exist and their
42
- # sizes. After an instance exists, there are no additional
43
- # per-database or per-operation charges for use of the instance
44
- # (though there may be additional network bandwidth charges).
45
- # Instances offer isolation: problems with databases in one instance
46
- # will not affect other instances. However, within an instance
47
- # databases can affect each other. For example, if one database in an
48
- # instance receives a lot of requests and consumes most of the
49
- # instance resources, fewer resources are available for other
50
- # databases in that instance, and their performance may suffer.
51
- class Service
52
-
53
- include GRPC::GenericService
54
-
55
- self.marshal_class_method = :encode
56
- self.unmarshal_class_method = :decode
57
- self.service_name = 'google.spanner.admin.instance.v1.InstanceAdmin'
58
-
59
- # Lists the supported instance configurations for a given project.
60
- rpc :ListInstanceConfigs, ListInstanceConfigsRequest, ListInstanceConfigsResponse
61
- # Gets information about a particular instance configuration.
62
- rpc :GetInstanceConfig, GetInstanceConfigRequest, InstanceConfig
63
- # Lists all instances in the given project.
64
- rpc :ListInstances, ListInstancesRequest, ListInstancesResponse
65
- # Gets information about a particular instance.
66
- rpc :GetInstance, GetInstanceRequest, Instance
67
- # Creates an instance and begins preparing it to begin serving. The
68
- # returned [long-running operation][google.longrunning.Operation]
69
- # can be used to track the progress of preparing the new
70
- # instance. The instance name is assigned by the caller. If the
71
- # named instance already exists, `CreateInstance` returns
72
- # `ALREADY_EXISTS`.
73
- #
74
- # Immediately upon completion of this request:
75
- #
76
- # * The instance is readable via the API, with all requested attributes
77
- # but no allocated resources. Its state is `CREATING`.
78
- #
79
- # Until completion of the returned operation:
80
- #
81
- # * Cancelling the operation renders the instance immediately unreadable
82
- # via the API.
83
- # * The instance can be deleted.
84
- # * All other attempts to modify the instance are rejected.
85
- #
86
- # Upon completion of the returned operation:
87
- #
88
- # * Billing for all successfully-allocated resources begins (some types
89
- # may have lower than the requested levels).
90
- # * Databases can be created in the instance.
91
- # * The instance's allocated resource levels are readable via the API.
92
- # * The instance's state becomes `READY`.
93
- #
94
- # The returned [long-running operation][google.longrunning.Operation] will
95
- # have a name of the format `<instance_name>/operations/<operation_id>` and
96
- # can be used to track creation of the instance. The
97
- # [metadata][google.longrunning.Operation.metadata] field type is
98
- # [CreateInstanceMetadata][google.spanner.admin.instance.v1.CreateInstanceMetadata].
99
- # The [response][google.longrunning.Operation.response] field type is
100
- # [Instance][google.spanner.admin.instance.v1.Instance], if successful.
101
- rpc :CreateInstance, CreateInstanceRequest, Google::Longrunning::Operation
102
- # Updates an instance, and begins allocating or releasing resources
103
- # as requested. The returned [long-running
104
- # operation][google.longrunning.Operation] can be used to track the
105
- # progress of updating the instance. If the named instance does not
106
- # exist, returns `NOT_FOUND`.
107
- #
108
- # Immediately upon completion of this request:
109
- #
110
- # * For resource types for which a decrease in the instance's allocation
111
- # has been requested, billing is based on the newly-requested level.
112
- #
113
- # Until completion of the returned operation:
114
- #
115
- # * Cancelling the operation sets its metadata's
116
- # [cancel_time][google.spanner.admin.instance.v1.UpdateInstanceMetadata.cancel_time], and begins
117
- # restoring resources to their pre-request values. The operation
118
- # is guaranteed to succeed at undoing all resource changes,
119
- # after which point it terminates with a `CANCELLED` status.
120
- # * All other attempts to modify the instance are rejected.
121
- # * Reading the instance via the API continues to give the pre-request
122
- # resource levels.
123
- #
124
- # Upon completion of the returned operation:
125
- #
126
- # * Billing begins for all successfully-allocated resources (some types
127
- # may have lower than the requested levels).
128
- # * All newly-reserved resources are available for serving the instance's
129
- # tables.
130
- # * The instance's new resource levels are readable via the API.
131
- #
132
- # The returned [long-running operation][google.longrunning.Operation] will
133
- # have a name of the format `<instance_name>/operations/<operation_id>` and
134
- # can be used to track the instance modification. The
135
- # [metadata][google.longrunning.Operation.metadata] field type is
136
- # [UpdateInstanceMetadata][google.spanner.admin.instance.v1.UpdateInstanceMetadata].
137
- # The [response][google.longrunning.Operation.response] field type is
138
- # [Instance][google.spanner.admin.instance.v1.Instance], if successful.
139
- #
140
- # Authorization requires `spanner.instances.update` permission on
141
- # resource [name][google.spanner.admin.instance.v1.Instance.name].
142
- rpc :UpdateInstance, UpdateInstanceRequest, Google::Longrunning::Operation
143
- # Deletes an instance.
144
- #
145
- # Immediately upon completion of the request:
146
- #
147
- # * Billing ceases for all of the instance's reserved resources.
148
- #
149
- # Soon afterward:
150
- #
151
- # * The instance and *all of its databases* immediately and
152
- # irrevocably disappear from the API. All data in the databases
153
- # is permanently deleted.
154
- rpc :DeleteInstance, DeleteInstanceRequest, Google::Protobuf::Empty
155
- # Sets the access control policy on an instance resource. Replaces any
156
- # existing policy.
157
- #
158
- # Authorization requires `spanner.instances.setIamPolicy` on
159
- # [resource][google.iam.v1.SetIamPolicyRequest.resource].
160
- rpc :SetIamPolicy, Google::Iam::V1::SetIamPolicyRequest, Google::Iam::V1::Policy
161
- # Gets the access control policy for an instance resource. Returns an empty
162
- # policy if an instance exists but does not have a policy set.
163
- #
164
- # Authorization requires `spanner.instances.getIamPolicy` on
165
- # [resource][google.iam.v1.GetIamPolicyRequest.resource].
166
- rpc :GetIamPolicy, Google::Iam::V1::GetIamPolicyRequest, Google::Iam::V1::Policy
167
- # Returns permissions that the caller has on the specified instance resource.
168
- #
169
- # Attempting this RPC on a non-existent Cloud Spanner instance resource will
170
- # result in a NOT_FOUND error if the user has `spanner.instances.list`
171
- # permission on the containing Google Cloud Project. Otherwise returns an
172
- # empty set of permissions.
173
- rpc :TestIamPermissions, Google::Iam::V1::TestIamPermissionsRequest, Google::Iam::V1::TestIamPermissionsResponse
174
- end
175
-
176
- Stub = Service.rpc_stub_class
177
- end
178
- end
179
- end
180
- end
181
- end
182
- end