google-cloud-spanner 0.21.0

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