google-cloud-spanner 1.14.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/lib/google-cloud-spanner.rb +13 -0
  4. data/lib/google/cloud/spanner.rb +2 -1
  5. data/lib/google/cloud/spanner/admin/database.rb +3 -2
  6. data/lib/google/cloud/spanner/admin/database/v1.rb +3 -2
  7. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client.rb +742 -20
  8. data/lib/google/cloud/spanner/admin/database/v1/database_admin_client_config.json +40 -0
  9. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/field_mask.rb +222 -0
  10. data/lib/google/cloud/spanner/admin/database/v1/doc/google/protobuf/timestamp.rb +113 -0
  11. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/backup.rb +325 -0
  12. data/lib/google/cloud/spanner/admin/database/v1/doc/google/spanner/admin/database/v1/spanner_database_admin.rb +197 -30
  13. data/lib/google/cloud/spanner/admin/instance.rb +1 -1
  14. data/lib/google/cloud/spanner/admin/instance/v1.rb +1 -1
  15. data/lib/google/cloud/spanner/admin/instance/v1/doc/google/spanner/admin/instance/v1/spanner_instance_admin.rb +6 -13
  16. data/lib/google/cloud/spanner/admin/instance/v1/instance_admin_client.rb +8 -5
  17. data/lib/google/cloud/spanner/batch_client.rb +5 -3
  18. data/lib/google/cloud/spanner/batch_snapshot.rb +43 -8
  19. data/lib/google/cloud/spanner/client.rb +57 -8
  20. data/lib/google/cloud/spanner/project.rb +31 -6
  21. data/lib/google/cloud/spanner/results.rb +4 -2
  22. data/lib/google/cloud/spanner/service.rb +3 -1
  23. data/lib/google/cloud/spanner/session.rb +37 -6
  24. data/lib/google/cloud/spanner/snapshot.rb +26 -3
  25. data/lib/google/cloud/spanner/transaction.rb +49 -5
  26. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/mutation.rb +8 -1
  27. data/lib/google/cloud/spanner/v1/doc/google/spanner/v1/spanner.rb +91 -102
  28. data/lib/google/cloud/spanner/v1/spanner_client.rb +112 -136
  29. data/lib/google/cloud/spanner/version.rb +1 -1
  30. data/lib/google/spanner/admin/database/v1/backup_pb.rb +98 -0
  31. data/lib/google/spanner/admin/database/v1/common_pb.rb +28 -0
  32. data/lib/google/spanner/admin/database/v1/spanner_database_admin_pb.rb +53 -0
  33. data/lib/google/spanner/admin/database/v1/spanner_database_admin_services_pb.rb +82 -12
  34. data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +1 -2
  35. data/lib/google/spanner/v1/spanner_pb.rb +5 -0
  36. data/lib/google/spanner/v1/spanner_services_pb.rb +31 -40
  37. metadata +7 -2
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Spanner
19
- VERSION = "1.14.0".freeze
19
+ VERSION = "1.15.0".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -0,0 +1,98 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/spanner/admin/database/v1/backup.proto
3
+
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/field_behavior_pb'
8
+ require 'google/api/resource_pb'
9
+ require 'google/longrunning/operations_pb'
10
+ require 'google/protobuf/field_mask_pb'
11
+ require 'google/protobuf/timestamp_pb'
12
+ require 'google/spanner/admin/database/v1/common_pb'
13
+ require 'google/api/annotations_pb'
14
+ Google::Protobuf::DescriptorPool.generated_pool.build do
15
+ add_message "google.spanner.admin.database.v1.Backup" do
16
+ optional :database, :string, 2
17
+ optional :expire_time, :message, 3, "google.protobuf.Timestamp"
18
+ optional :name, :string, 1
19
+ optional :create_time, :message, 4, "google.protobuf.Timestamp"
20
+ optional :size_bytes, :int64, 5
21
+ optional :state, :enum, 6, "google.spanner.admin.database.v1.Backup.State"
22
+ repeated :referencing_databases, :string, 7
23
+ end
24
+ add_enum "google.spanner.admin.database.v1.Backup.State" do
25
+ value :STATE_UNSPECIFIED, 0
26
+ value :CREATING, 1
27
+ value :READY, 2
28
+ end
29
+ add_message "google.spanner.admin.database.v1.CreateBackupRequest" do
30
+ optional :parent, :string, 1
31
+ optional :backup_id, :string, 2
32
+ optional :backup, :message, 3, "google.spanner.admin.database.v1.Backup"
33
+ end
34
+ add_message "google.spanner.admin.database.v1.CreateBackupMetadata" do
35
+ optional :name, :string, 1
36
+ optional :database, :string, 2
37
+ optional :progress, :message, 3, "google.spanner.admin.database.v1.OperationProgress"
38
+ optional :cancel_time, :message, 4, "google.protobuf.Timestamp"
39
+ end
40
+ add_message "google.spanner.admin.database.v1.UpdateBackupRequest" do
41
+ optional :backup, :message, 1, "google.spanner.admin.database.v1.Backup"
42
+ optional :update_mask, :message, 2, "google.protobuf.FieldMask"
43
+ end
44
+ add_message "google.spanner.admin.database.v1.GetBackupRequest" do
45
+ optional :name, :string, 1
46
+ end
47
+ add_message "google.spanner.admin.database.v1.DeleteBackupRequest" do
48
+ optional :name, :string, 1
49
+ end
50
+ add_message "google.spanner.admin.database.v1.ListBackupsRequest" do
51
+ optional :parent, :string, 1
52
+ optional :filter, :string, 2
53
+ optional :page_size, :int32, 3
54
+ optional :page_token, :string, 4
55
+ end
56
+ add_message "google.spanner.admin.database.v1.ListBackupsResponse" do
57
+ repeated :backups, :message, 1, "google.spanner.admin.database.v1.Backup"
58
+ optional :next_page_token, :string, 2
59
+ end
60
+ add_message "google.spanner.admin.database.v1.ListBackupOperationsRequest" do
61
+ optional :parent, :string, 1
62
+ optional :filter, :string, 2
63
+ optional :page_size, :int32, 3
64
+ optional :page_token, :string, 4
65
+ end
66
+ add_message "google.spanner.admin.database.v1.ListBackupOperationsResponse" do
67
+ repeated :operations, :message, 1, "google.longrunning.Operation"
68
+ optional :next_page_token, :string, 2
69
+ end
70
+ add_message "google.spanner.admin.database.v1.BackupInfo" do
71
+ optional :backup, :string, 1
72
+ optional :create_time, :message, 2, "google.protobuf.Timestamp"
73
+ optional :source_database, :string, 3
74
+ end
75
+ end
76
+
77
+ module Google
78
+ module Spanner
79
+ module Admin
80
+ module Database
81
+ module V1
82
+ Backup = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Backup").msgclass
83
+ Backup::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Backup.State").enummodule
84
+ CreateBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupRequest").msgclass
85
+ CreateBackupMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.CreateBackupMetadata").msgclass
86
+ UpdateBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.UpdateBackupRequest").msgclass
87
+ GetBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetBackupRequest").msgclass
88
+ DeleteBackupRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DeleteBackupRequest").msgclass
89
+ ListBackupsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupsRequest").msgclass
90
+ ListBackupsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupsResponse").msgclass
91
+ ListBackupOperationsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsRequest").msgclass
92
+ ListBackupOperationsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListBackupOperationsResponse").msgclass
93
+ BackupInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.BackupInfo").msgclass
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,28 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/spanner/admin/database/v1/common.proto
3
+
4
+
5
+ require 'google/protobuf'
6
+
7
+ require 'google/api/field_behavior_pb'
8
+ require 'google/protobuf/timestamp_pb'
9
+ require 'google/api/annotations_pb'
10
+ Google::Protobuf::DescriptorPool.generated_pool.build do
11
+ add_message "google.spanner.admin.database.v1.OperationProgress" do
12
+ optional :progress_percent, :int32, 1
13
+ optional :start_time, :message, 2, "google.protobuf.Timestamp"
14
+ optional :end_time, :message, 3, "google.protobuf.Timestamp"
15
+ end
16
+ end
17
+
18
+ module Google
19
+ module Spanner
20
+ module Admin
21
+ module Database
22
+ module V1
23
+ OperationProgress = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OperationProgress").msgclass
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -13,15 +13,26 @@ require 'google/iam/v1/policy_pb'
13
13
  require 'google/longrunning/operations_pb'
14
14
  require 'google/protobuf/empty_pb'
15
15
  require 'google/protobuf/timestamp_pb'
16
+ require 'google/spanner/admin/database/v1/backup_pb'
17
+ require 'google/spanner/admin/database/v1/common_pb'
16
18
  Google::Protobuf::DescriptorPool.generated_pool.build do
19
+ add_message "google.spanner.admin.database.v1.RestoreInfo" do
20
+ optional :source_type, :enum, 1, "google.spanner.admin.database.v1.RestoreSourceType"
21
+ oneof :source_info do
22
+ optional :backup_info, :message, 2, "google.spanner.admin.database.v1.BackupInfo"
23
+ end
24
+ end
17
25
  add_message "google.spanner.admin.database.v1.Database" do
18
26
  optional :name, :string, 1
19
27
  optional :state, :enum, 2, "google.spanner.admin.database.v1.Database.State"
28
+ optional :create_time, :message, 3, "google.protobuf.Timestamp"
29
+ optional :restore_info, :message, 4, "google.spanner.admin.database.v1.RestoreInfo"
20
30
  end
21
31
  add_enum "google.spanner.admin.database.v1.Database.State" do
22
32
  value :STATE_UNSPECIFIED, 0
23
33
  value :CREATING, 1
24
34
  value :READY, 2
35
+ value :READY_OPTIMIZING, 3
25
36
  end
26
37
  add_message "google.spanner.admin.database.v1.ListDatabasesRequest" do
27
38
  optional :parent, :string, 1
@@ -62,6 +73,41 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
62
73
  add_message "google.spanner.admin.database.v1.GetDatabaseDdlResponse" do
63
74
  repeated :statements, :string, 1
64
75
  end
76
+ add_message "google.spanner.admin.database.v1.ListDatabaseOperationsRequest" do
77
+ optional :parent, :string, 1
78
+ optional :filter, :string, 2
79
+ optional :page_size, :int32, 3
80
+ optional :page_token, :string, 4
81
+ end
82
+ add_message "google.spanner.admin.database.v1.ListDatabaseOperationsResponse" do
83
+ repeated :operations, :message, 1, "google.longrunning.Operation"
84
+ optional :next_page_token, :string, 2
85
+ end
86
+ add_message "google.spanner.admin.database.v1.RestoreDatabaseRequest" do
87
+ optional :parent, :string, 1
88
+ optional :database_id, :string, 2
89
+ oneof :source do
90
+ optional :backup, :string, 3
91
+ end
92
+ end
93
+ add_message "google.spanner.admin.database.v1.RestoreDatabaseMetadata" do
94
+ optional :name, :string, 1
95
+ optional :source_type, :enum, 2, "google.spanner.admin.database.v1.RestoreSourceType"
96
+ optional :progress, :message, 4, "google.spanner.admin.database.v1.OperationProgress"
97
+ optional :cancel_time, :message, 5, "google.protobuf.Timestamp"
98
+ optional :optimize_database_operation_name, :string, 6
99
+ oneof :source_info do
100
+ optional :backup_info, :message, 3, "google.spanner.admin.database.v1.BackupInfo"
101
+ end
102
+ end
103
+ add_message "google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata" do
104
+ optional :name, :string, 1
105
+ optional :progress, :message, 2, "google.spanner.admin.database.v1.OperationProgress"
106
+ end
107
+ add_enum "google.spanner.admin.database.v1.RestoreSourceType" do
108
+ value :TYPE_UNSPECIFIED, 0
109
+ value :BACKUP, 1
110
+ end
65
111
  end
66
112
 
67
113
  module Google
@@ -69,6 +115,7 @@ module Google
69
115
  module Admin
70
116
  module Database
71
117
  module V1
118
+ RestoreInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreInfo").msgclass
72
119
  Database = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database").msgclass
73
120
  Database::State = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.Database.State").enummodule
74
121
  ListDatabasesRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabasesRequest").msgclass
@@ -81,6 +128,12 @@ module Google
81
128
  DropDatabaseRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.DropDatabaseRequest").msgclass
82
129
  GetDatabaseDdlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlRequest").msgclass
83
130
  GetDatabaseDdlResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.GetDatabaseDdlResponse").msgclass
131
+ ListDatabaseOperationsRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsRequest").msgclass
132
+ ListDatabaseOperationsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.ListDatabaseOperationsResponse").msgclass
133
+ RestoreDatabaseRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseRequest").msgclass
134
+ RestoreDatabaseMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreDatabaseMetadata").msgclass
135
+ OptimizeRestoredDatabaseMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.OptimizeRestoredDatabaseMetadata").msgclass
136
+ RestoreSourceType = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.admin.database.v1.RestoreSourceType").enummodule
84
137
  end
85
138
  end
86
139
  end
@@ -1,7 +1,7 @@
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 2019 Google LLC.
4
+ # Copyright 2020 Google LLC
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.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
 
21
20
  require 'grpc'
@@ -31,7 +30,8 @@ module Google
31
30
  #
32
31
  # The Cloud Spanner Database Admin API can be used to create, drop, and
33
32
  # list databases. It also enables updating the schema of pre-existing
34
- # databases.
33
+ # databases. It can be also used to create, delete and list backups for a
34
+ # database and to restore from an existing backup.
35
35
  class Service
36
36
 
37
37
  include GRPC::GenericService
@@ -47,8 +47,8 @@ module Google
47
47
  # have a name of the format `<database_name>/operations/<operation_id>` and
48
48
  # can be used to track preparation of the database. The
49
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
50
+ # [CreateDatabaseMetadata][google.spanner.admin.database.v1.CreateDatabaseMetadata]. The
51
+ # [response][google.longrunning.Operation.response] field type is
52
52
  # [Database][google.spanner.admin.database.v1.Database], if successful.
53
53
  rpc :CreateDatabase, CreateDatabaseRequest, Google::Longrunning::Operation
54
54
  # Gets the state of a Cloud Spanner database.
@@ -59,35 +59,105 @@ module Google
59
59
  # the format `<database_name>/operations/<operation_id>` and can be used to
60
60
  # track execution of the schema change(s). The
61
61
  # [metadata][google.longrunning.Operation.metadata] field type is
62
- # [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata].
63
- # The operation has no response.
62
+ # [UpdateDatabaseDdlMetadata][google.spanner.admin.database.v1.UpdateDatabaseDdlMetadata]. The operation has no response.
64
63
  rpc :UpdateDatabaseDdl, UpdateDatabaseDdlRequest, Google::Longrunning::Operation
65
64
  # Drops (aka deletes) a Cloud Spanner database.
65
+ # Completed backups for the database will be retained according to their
66
+ # `expire_time`.
66
67
  rpc :DropDatabase, DropDatabaseRequest, Google::Protobuf::Empty
67
68
  # Returns the schema of a Cloud Spanner database as a list of formatted
68
69
  # DDL statements. This method does not show pending schema updates, those may
69
70
  # be queried using the [Operations][google.longrunning.Operations] API.
70
71
  rpc :GetDatabaseDdl, GetDatabaseDdlRequest, GetDatabaseDdlResponse
71
- # Sets the access control policy on a database resource.
72
+ # Sets the access control policy on a database or backup resource.
72
73
  # Replaces any existing policy.
73
74
  #
74
75
  # Authorization requires `spanner.databases.setIamPolicy`
75
76
  # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
77
+ # For backups, authorization requires `spanner.backups.setIamPolicy`
78
+ # permission on [resource][google.iam.v1.SetIamPolicyRequest.resource].
76
79
  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
+ # Gets the access control policy for a database or backup resource.
81
+ # Returns an empty policy if a database or backup exists but does not have a
82
+ # policy set.
80
83
  #
81
84
  # Authorization requires `spanner.databases.getIamPolicy` permission on
82
85
  # [resource][google.iam.v1.GetIamPolicyRequest.resource].
86
+ # For backups, authorization requires `spanner.backups.getIamPolicy`
87
+ # permission on [resource][google.iam.v1.GetIamPolicyRequest.resource].
83
88
  rpc :GetIamPolicy, Google::Iam::V1::GetIamPolicyRequest, Google::Iam::V1::Policy
84
- # Returns permissions that the caller has on the specified database resource.
89
+ # Returns permissions that the caller has on the specified database or backup
90
+ # resource.
85
91
  #
86
92
  # Attempting this RPC on a non-existent Cloud Spanner database will
87
93
  # result in a NOT_FOUND error if the user has
88
94
  # `spanner.databases.list` permission on the containing Cloud
89
95
  # Spanner instance. Otherwise returns an empty set of permissions.
96
+ # Calling this method on a backup that does not exist will
97
+ # result in a NOT_FOUND error if the user has
98
+ # `spanner.backups.list` permission on the containing instance.
90
99
  rpc :TestIamPermissions, Google::Iam::V1::TestIamPermissionsRequest, Google::Iam::V1::TestIamPermissionsResponse
100
+ # Starts creating a new Cloud Spanner Backup.
101
+ # The returned backup [long-running operation][google.longrunning.Operation]
102
+ # will have a name of the format
103
+ # `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation_id>`
104
+ # and can be used to track creation of the backup. The
105
+ # [metadata][google.longrunning.Operation.metadata] field type is
106
+ # [CreateBackupMetadata][google.spanner.admin.database.v1.CreateBackupMetadata]. The
107
+ # [response][google.longrunning.Operation.response] field type is
108
+ # [Backup][google.spanner.admin.database.v1.Backup], if successful. Cancelling the returned operation will stop the
109
+ # creation and delete the backup.
110
+ # There can be only one pending backup creation per database. Backup creation
111
+ # of different databases can run concurrently.
112
+ rpc :CreateBackup, CreateBackupRequest, Google::Longrunning::Operation
113
+ # Gets metadata on a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
114
+ rpc :GetBackup, GetBackupRequest, Backup
115
+ # Updates a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
116
+ rpc :UpdateBackup, UpdateBackupRequest, Backup
117
+ # Deletes a pending or completed [Backup][google.spanner.admin.database.v1.Backup].
118
+ rpc :DeleteBackup, DeleteBackupRequest, Google::Protobuf::Empty
119
+ # Lists completed and pending backups.
120
+ # Backups returned are ordered by `create_time` in descending order,
121
+ # starting from the most recent `create_time`.
122
+ rpc :ListBackups, ListBackupsRequest, ListBackupsResponse
123
+ # Create a new database by restoring from a completed backup. The new
124
+ # database must be in the same project and in an instance with the same
125
+ # instance configuration as the instance containing
126
+ # the backup. The returned database [long-running
127
+ # operation][google.longrunning.Operation] has a name of the format
128
+ # `projects/<project>/instances/<instance>/databases/<database>/operations/<operation_id>`,
129
+ # and can be used to track the progress of the operation, and to cancel it.
130
+ # The [metadata][google.longrunning.Operation.metadata] field type is
131
+ # [RestoreDatabaseMetadata][google.spanner.admin.database.v1.RestoreDatabaseMetadata].
132
+ # The [response][google.longrunning.Operation.response] type
133
+ # is [Database][google.spanner.admin.database.v1.Database], if
134
+ # successful. Cancelling the returned operation will stop the restore and
135
+ # delete the database.
136
+ # There can be only one database being restored into an instance at a time.
137
+ # Once the restore operation completes, a new restore operation can be
138
+ # initiated, without waiting for the optimize operation associated with the
139
+ # first restore to complete.
140
+ rpc :RestoreDatabase, RestoreDatabaseRequest, Google::Longrunning::Operation
141
+ # Lists database [longrunning-operations][google.longrunning.Operation].
142
+ # A database operation has a name of the form
143
+ # `projects/<project>/instances/<instance>/databases/<database>/operations/<operation>`.
144
+ # The long-running operation
145
+ # [metadata][google.longrunning.Operation.metadata] field type
146
+ # `metadata.type_url` describes the type of the metadata. Operations returned
147
+ # include those that have completed/failed/canceled within the last 7 days,
148
+ # and pending operations.
149
+ rpc :ListDatabaseOperations, ListDatabaseOperationsRequest, ListDatabaseOperationsResponse
150
+ # Lists the backup [long-running operations][google.longrunning.Operation] in
151
+ # the given instance. A backup operation has a name of the form
152
+ # `projects/<project>/instances/<instance>/backups/<backup>/operations/<operation>`.
153
+ # The long-running operation
154
+ # [metadata][google.longrunning.Operation.metadata] field type
155
+ # `metadata.type_url` describes the type of the metadata. Operations returned
156
+ # include those that have completed/failed/canceled within the last 7 days,
157
+ # and pending operations. Operations returned are ordered by
158
+ # `operation.metadata.value.progress.start_time` in descending order starting
159
+ # from the most recently started operation.
160
+ rpc :ListBackupOperations, ListBackupOperationsRequest, ListBackupOperationsResponse
91
161
  end
92
162
 
93
163
  Stub = Service.rpc_stub_class
@@ -1,7 +1,7 @@
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 2019 Google LLC.
4
+ # Copyright 2020 Google LLC
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.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
 
21
20
  require 'grpc'
@@ -62,6 +62,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
62
62
  optional :query_mode, :enum, 7, "google.spanner.v1.ExecuteSqlRequest.QueryMode"
63
63
  optional :partition_token, :bytes, 8
64
64
  optional :seqno, :int64, 9
65
+ optional :query_options, :message, 10, "google.spanner.v1.ExecuteSqlRequest.QueryOptions"
66
+ end
67
+ add_message "google.spanner.v1.ExecuteSqlRequest.QueryOptions" do
68
+ optional :optimizer_version, :string, 1
65
69
  end
66
70
  add_enum "google.spanner.v1.ExecuteSqlRequest.QueryMode" do
67
71
  value :NORMAL, 0
@@ -155,6 +159,7 @@ module Google
155
159
  ListSessionsResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ListSessionsResponse").msgclass
156
160
  DeleteSessionRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.DeleteSessionRequest").msgclass
157
161
  ExecuteSqlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest").msgclass
162
+ ExecuteSqlRequest::QueryOptions = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest.QueryOptions").msgclass
158
163
  ExecuteSqlRequest::QueryMode = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteSqlRequest.QueryMode").enummodule
159
164
  ExecuteBatchDmlRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteBatchDmlRequest").msgclass
160
165
  ExecuteBatchDmlRequest::Statement = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.spanner.v1.ExecuteBatchDmlRequest.Statement").msgclass
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/spanner/v1/spanner.proto for package 'google.spanner.v1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2020 Google LLC
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.
@@ -15,7 +15,6 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
- #
19
18
 
20
19
 
21
20
  require 'grpc'
@@ -50,7 +49,7 @@ module Google
50
49
  #
51
50
  # Active sessions use additional server resources, so it is a good idea to
52
51
  # delete idle and unneeded sessions.
53
- # Aside from explicit deletes, Cloud Spanner can delete sessions for which no
52
+ # Aside from explicit deletes, Cloud Spanner may delete sessions for which no
54
53
  # operations are sent for more than an hour. If a session is deleted,
55
54
  # requests to it return `NOT_FOUND`.
56
55
  #
@@ -79,56 +78,51 @@ module Google
79
78
  #
80
79
  # Operations inside read-write transactions might return `ABORTED`. If
81
80
  # this occurs, the application should restart the transaction from
82
- # the beginning. See [Transaction][google.spanner.v1.Transaction] for more
83
- # details.
81
+ # the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
84
82
  #
85
83
  # Larger result sets can be fetched in streaming fashion by calling
86
- # [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql]
87
- # instead.
84
+ # [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] instead.
88
85
  rpc :ExecuteSql, ExecuteSqlRequest, ResultSet
89
- # Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the
90
- # result set as a stream. Unlike
91
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there is no limit on
92
- # the size of the returned result set. However, no individual row in the
93
- # result set can exceed 100 MiB, and no column value can exceed 10 MiB.
86
+ # Like [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], except returns the result
87
+ # set as a stream. Unlike [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql], there
88
+ # is no limit on the size of the returned result set. However, no
89
+ # individual row in the result set can exceed 100 MiB, and no
90
+ # column value can exceed 10 MiB.
94
91
  rpc :ExecuteStreamingSql, ExecuteSqlRequest, stream(PartialResultSet)
95
92
  # Executes a batch of SQL DML statements. This method allows many statements
96
93
  # to be run with lower latency than submitting them sequentially with
97
94
  # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
98
95
  #
99
96
  # Statements are executed in sequential order. A request can succeed even if
100
- # a statement fails. The
101
- # [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status]
102
- # field in the response provides information about the statement that failed.
103
- # Clients must inspect this field to determine whether an error occurred.
97
+ # a statement fails. The [ExecuteBatchDmlResponse.status][google.spanner.v1.ExecuteBatchDmlResponse.status] field in the
98
+ # response provides information about the statement that failed. Clients must
99
+ # inspect this field to determine whether an error occurred.
104
100
  #
105
101
  # Execution stops after the first failed statement; the remaining statements
106
102
  # are not executed.
107
103
  rpc :ExecuteBatchDml, ExecuteBatchDmlRequest, ExecuteBatchDmlResponse
108
104
  # Reads rows from the database using key lookups and scans, as a
109
105
  # simple key/value style alternative to
110
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be
111
- # used to return a result set larger than 10 MiB; if the read matches more
106
+ # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql]. This method cannot be used to
107
+ # return a result set larger than 10 MiB; if the read matches more
112
108
  # data than that, the read fails with a `FAILED_PRECONDITION`
113
109
  # error.
114
110
  #
115
111
  # Reads inside read-write transactions might return `ABORTED`. If
116
112
  # this occurs, the application should restart the transaction from
117
- # the beginning. See [Transaction][google.spanner.v1.Transaction] for more
118
- # details.
113
+ # the beginning. See [Transaction][google.spanner.v1.Transaction] for more details.
119
114
  #
120
115
  # Larger result sets can be yielded in streaming fashion by calling
121
116
  # [StreamingRead][google.spanner.v1.Spanner.StreamingRead] instead.
122
117
  rpc :Read, ReadRequest, ResultSet
123
- # Like [Read][google.spanner.v1.Spanner.Read], except returns the result set
124
- # as a stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no
125
- # limit on the size of the returned result set. However, no individual row in
118
+ # Like [Read][google.spanner.v1.Spanner.Read], except returns the result set as a
119
+ # stream. Unlike [Read][google.spanner.v1.Spanner.Read], there is no limit on the
120
+ # size of the returned result set. However, no individual row in
126
121
  # the result set can exceed 100 MiB, and no column value can exceed
127
122
  # 10 MiB.
128
123
  rpc :StreamingRead, ReadRequest, stream(PartialResultSet)
129
124
  # Begins a new transaction. This step can often be skipped:
130
- # [Read][google.spanner.v1.Spanner.Read],
131
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
125
+ # [Read][google.spanner.v1.Spanner.Read], [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
132
126
  # [Commit][google.spanner.v1.Spanner.Commit] can begin a new transaction as a
133
127
  # side-effect.
134
128
  rpc :BeginTransaction, BeginTransactionRequest, Transaction
@@ -143,9 +137,8 @@ module Google
143
137
  rpc :Commit, CommitRequest, CommitResponse
144
138
  # Rolls back a transaction, releasing any locks it holds. It is a good
145
139
  # idea to call this for any transaction that includes one or more
146
- # [Read][google.spanner.v1.Spanner.Read] or
147
- # [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and ultimately
148
- # decides not to commit.
140
+ # [Read][google.spanner.v1.Spanner.Read] or [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] requests and
141
+ # ultimately decides not to commit.
149
142
  #
150
143
  # `Rollback` returns `OK` if it successfully aborts the transaction, the
151
144
  # transaction was already aborted, or the transaction is not
@@ -153,11 +146,10 @@ module Google
153
146
  rpc :Rollback, RollbackRequest, Google::Protobuf::Empty
154
147
  # Creates a set of partition tokens that can be used to execute a query
155
148
  # operation in parallel. Each of the returned partition tokens can be used
156
- # by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to
157
- # specify a subset of the query result to read. The same session and
158
- # read-only transaction must be used by the PartitionQueryRequest used to
159
- # create the partition tokens and the ExecuteSqlRequests that use the
160
- # partition tokens.
149
+ # by [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql] to specify a subset
150
+ # of the query result to read. The same session and read-only transaction
151
+ # must be used by the PartitionQueryRequest used to create the
152
+ # partition tokens and the ExecuteSqlRequests that use the partition tokens.
161
153
  #
162
154
  # Partition tokens become invalid when the session used to create them
163
155
  # is deleted, is idle for too long, begins a new transaction, or becomes too
@@ -166,13 +158,12 @@ module Google
166
158
  rpc :PartitionQuery, PartitionQueryRequest, PartitionResponse
167
159
  # Creates a set of partition tokens that can be used to execute a read
168
160
  # operation in parallel. Each of the returned partition tokens can be used
169
- # by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a
170
- # subset of the read result to read. The same session and read-only
171
- # transaction must be used by the PartitionReadRequest used to create the
172
- # partition tokens and the ReadRequests that use the partition tokens. There
173
- # are no ordering guarantees on rows returned among the returned partition
174
- # tokens, or even within each individual StreamingRead call issued with a
175
- # partition_token.
161
+ # by [StreamingRead][google.spanner.v1.Spanner.StreamingRead] to specify a subset of the read
162
+ # result to read. The same session and read-only transaction must be used by
163
+ # the PartitionReadRequest used to create the partition tokens and the
164
+ # ReadRequests that use the partition tokens. There are no ordering
165
+ # guarantees on rows returned among the returned partition tokens, or even
166
+ # within each individual StreamingRead call issued with a partition_token.
176
167
  #
177
168
  # Partition tokens become invalid when the session used to create them
178
169
  # is deleted, is idle for too long, begins a new transaction, or becomes too