google-apis-spanner_v1 0.37.0 → 0.39.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.
@@ -33,6 +33,8 @@ module Google
33
33
  #
34
34
  # @see https://cloud.google.com/spanner/
35
35
  class SpannerService < Google::Apis::Core::BaseService
36
+ DEFAULT_ENDPOINT_TEMPLATE = "https://spanner.$UNIVERSE_DOMAIN$/"
37
+
36
38
  # @return [String]
37
39
  # API key. Your API key identifies your project and provides you with API access,
38
40
  # quota, and reports. Required unless you provide an OAuth 2.0 token.
@@ -44,12 +46,184 @@ module Google
44
46
  attr_accessor :quota_user
45
47
 
46
48
  def initialize
47
- super('https://spanner.googleapis.com/', '',
49
+ super(DEFAULT_ENDPOINT_TEMPLATE, '',
48
50
  client_name: 'google-apis-spanner_v1',
49
51
  client_version: Google::Apis::SpannerV1::GEM_VERSION)
50
52
  @batch_path = 'batch'
51
53
  end
52
54
 
55
+ # Lists the user-managed instance configuration long-running operations in the
56
+ # given project. An instance configuration operation has a name of the form `
57
+ # projects//instanceConfigs//operations/`. The long-running operation metadata
58
+ # field type `metadata.type_url` describes the type of the metadata. Operations
59
+ # returned include those that have completed/failed/canceled within the last 7
60
+ # days, and pending operations. Operations returned are ordered by `operation.
61
+ # metadata.value.start_time` in descending order starting from the most recently
62
+ # started operation.
63
+ # @param [String] parent
64
+ # Required. The project of the instance configuration operations. Values are of
65
+ # the form `projects/`.
66
+ # @param [String] filter
67
+ # An expression that filters the list of returned operations. A filter
68
+ # expression consists of a field name, a comparison operator, and a value for
69
+ # filtering. The value must be a string, a number, or a boolean. The comparison
70
+ # operator must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. Colon `:` is
71
+ # the contains operator. Filter rules are not case sensitive. The following
72
+ # fields in the Operation are eligible for filtering: * `name` - The name of the
73
+ # long-running operation * `done` - False if the operation is in progress, else
74
+ # true. * `metadata.@type` - the type of metadata. For example, the type string
75
+ # for CreateInstanceConfigMetadata is `type.googleapis.com/google.spanner.admin.
76
+ # instance.v1.CreateInstanceConfigMetadata`. * `metadata.` - any field in
77
+ # metadata.value. `metadata.@type` must be specified first, if filtering on
78
+ # metadata fields. * `error` - Error associated with the long-running operation.
79
+ # * `response.@type` - the type of response. * `response.` - any field in
80
+ # response.value. You can combine multiple expressions by enclosing each
81
+ # expression in parentheses. By default, expressions are combined with AND logic.
82
+ # However, you can specify AND, OR, and NOT logic explicitly. Here are a few
83
+ # examples: * `done:true` - The operation is complete. * `(metadata.@type=` \ `
84
+ # type.googleapis.com/google.spanner.admin.instance.v1.
85
+ # CreateInstanceConfigMetadata) AND` \ `(metadata.instance_config.name:custom-
86
+ # config) AND` \ `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND`
87
+ # \ `(error:*)` - Return operations where: * The operation's metadata type is
88
+ # CreateInstanceConfigMetadata. * The instance configuration name contains "
89
+ # custom-config". * The operation started before 2021-03-28T14:50:00Z. * The
90
+ # operation resulted in an error.
91
+ # @param [Fixnum] page_size
92
+ # Number of operations to be returned in the response. If 0 or less, defaults to
93
+ # the server's maximum allowed page size.
94
+ # @param [String] page_token
95
+ # If non-empty, `page_token` should contain a next_page_token from a previous
96
+ # ListInstanceConfigOperationsResponse to the same `parent` and with the same `
97
+ # filter`.
98
+ # @param [String] fields
99
+ # Selector specifying which fields to include in a partial response.
100
+ # @param [String] quota_user
101
+ # Available to use for quota purposes for server-side applications. Can be any
102
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
103
+ # @param [Google::Apis::RequestOptions] options
104
+ # Request-specific options
105
+ #
106
+ # @yield [result, err] Result & error if block supplied
107
+ # @yieldparam result [Google::Apis::SpannerV1::ListInstanceConfigOperationsResponse] parsed result object
108
+ # @yieldparam err [StandardError] error object if request failed
109
+ #
110
+ # @return [Google::Apis::SpannerV1::ListInstanceConfigOperationsResponse]
111
+ #
112
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
113
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
114
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
115
+ def list_project_single_instance_config_operations(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
116
+ command = make_simple_command(:get, 'v1/{+parent}/instanceConfigOperations', options)
117
+ command.response_representation = Google::Apis::SpannerV1::ListInstanceConfigOperationsResponse::Representation
118
+ command.response_class = Google::Apis::SpannerV1::ListInstanceConfigOperationsResponse
119
+ command.params['parent'] = parent unless parent.nil?
120
+ command.query['filter'] = filter unless filter.nil?
121
+ command.query['pageSize'] = page_size unless page_size.nil?
122
+ command.query['pageToken'] = page_token unless page_token.nil?
123
+ command.query['fields'] = fields unless fields.nil?
124
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
125
+ execute_or_queue_command(command, &block)
126
+ end
127
+
128
+ # Creates an instance configuration and begins preparing it to be used. The
129
+ # returned long-running operation can be used to track the progress of preparing
130
+ # the new instance configuration. The instance configuration name is assigned by
131
+ # the caller. If the named instance configuration already exists, `
132
+ # CreateInstanceConfig` returns `ALREADY_EXISTS`. Immediately after the request
133
+ # returns: * The instance configuration is readable via the API, with all
134
+ # requested attributes. The instance configuration's reconciling field is set to
135
+ # true. Its state is `CREATING`. While the operation is pending: * Cancelling
136
+ # the operation renders the instance configuration immediately unreadable via
137
+ # the API. * Except for deleting the creating resource, all other attempts to
138
+ # modify the instance configuration are rejected. Upon completion of the
139
+ # returned operation: * Instances can be created using the instance
140
+ # configuration. * The instance configuration's reconciling field becomes false.
141
+ # Its state becomes `READY`. The returned long-running operation will have a
142
+ # name of the format `/operations/` and can be used to track creation of the
143
+ # instance configuration. The metadata field type is
144
+ # CreateInstanceConfigMetadata. The response field type is InstanceConfig, if
145
+ # successful. Authorization requires `spanner.instanceConfigs.create` permission
146
+ # on the resource parent.
147
+ # @param [String] parent
148
+ # Required. The name of the project in which to create the instance
149
+ # configuration. Values are of the form `projects/`.
150
+ # @param [Google::Apis::SpannerV1::CreateInstanceConfigRequest] create_instance_config_request_object
151
+ # @param [String] fields
152
+ # Selector specifying which fields to include in a partial response.
153
+ # @param [String] quota_user
154
+ # Available to use for quota purposes for server-side applications. Can be any
155
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
156
+ # @param [Google::Apis::RequestOptions] options
157
+ # Request-specific options
158
+ #
159
+ # @yield [result, err] Result & error if block supplied
160
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
161
+ # @yieldparam err [StandardError] error object if request failed
162
+ #
163
+ # @return [Google::Apis::SpannerV1::Operation]
164
+ #
165
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
166
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
167
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
168
+ def create_instance_config(parent, create_instance_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
169
+ command = make_simple_command(:post, 'v1/{+parent}/instanceConfigs', options)
170
+ command.request_representation = Google::Apis::SpannerV1::CreateInstanceConfigRequest::Representation
171
+ command.request_object = create_instance_config_request_object
172
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
173
+ command.response_class = Google::Apis::SpannerV1::Operation
174
+ command.params['parent'] = parent unless parent.nil?
175
+ command.query['fields'] = fields unless fields.nil?
176
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
177
+ execute_or_queue_command(command, &block)
178
+ end
179
+
180
+ # Deletes the instance configuration. Deletion is only allowed when no instances
181
+ # are using the configuration. If any instances are using the configuration,
182
+ # returns `FAILED_PRECONDITION`. Only user-managed configurations can be deleted.
183
+ # Authorization requires `spanner.instanceConfigs.delete` permission on the
184
+ # resource name.
185
+ # @param [String] name
186
+ # Required. The name of the instance configuration to be deleted. Values are of
187
+ # the form `projects//instanceConfigs/`
188
+ # @param [String] etag
189
+ # Used for optimistic concurrency control as a way to help prevent simultaneous
190
+ # deletes of an instance configuration from overwriting each other. If not empty,
191
+ # the API only deletes the instance configuration when the etag provided
192
+ # matches the current status of the requested instance configuration. Otherwise,
193
+ # deletes the instance configuration without checking the current status of the
194
+ # requested instance configuration.
195
+ # @param [Boolean] validate_only
196
+ # An option to validate, but not actually execute, a request, and provide the
197
+ # same response.
198
+ # @param [String] fields
199
+ # Selector specifying which fields to include in a partial response.
200
+ # @param [String] quota_user
201
+ # Available to use for quota purposes for server-side applications. Can be any
202
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
203
+ # @param [Google::Apis::RequestOptions] options
204
+ # Request-specific options
205
+ #
206
+ # @yield [result, err] Result & error if block supplied
207
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
208
+ # @yieldparam err [StandardError] error object if request failed
209
+ #
210
+ # @return [Google::Apis::SpannerV1::Empty]
211
+ #
212
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
213
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
214
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
215
+ def delete_project_instance_config(name, etag: nil, validate_only: nil, fields: nil, quota_user: nil, options: nil, &block)
216
+ command = make_simple_command(:delete, 'v1/{+name}', options)
217
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
218
+ command.response_class = Google::Apis::SpannerV1::Empty
219
+ command.params['name'] = name unless name.nil?
220
+ command.query['etag'] = etag unless etag.nil?
221
+ command.query['validateOnly'] = validate_only unless validate_only.nil?
222
+ command.query['fields'] = fields unless fields.nil?
223
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
224
+ execute_or_queue_command(command, &block)
225
+ end
226
+
53
227
  # Gets information about a particular instance configuration.
54
228
  # @param [String] name
55
229
  # Required. The name of the requested instance configuration. Values are of the
@@ -81,7 +255,8 @@ module Google
81
255
  execute_or_queue_command(command, &block)
82
256
  end
83
257
 
84
- # Lists the supported instance configurations for a given project.
258
+ # Lists the supported instance configurations for a given project. Returns both
259
+ # Google-managed configurations and user-managed configurations.
85
260
  # @param [String] parent
86
261
  # Required. The name of the project for which a list of supported instance
87
262
  # configurations is requested. Values are of the form `projects/`.
@@ -120,14 +295,66 @@ module Google
120
295
  execute_or_queue_command(command, &block)
121
296
  end
122
297
 
298
+ # Updates an instance configuration. The returned long-running operation can be
299
+ # used to track the progress of updating the instance. If the named instance
300
+ # configuration does not exist, returns `NOT_FOUND`. Only user-managed
301
+ # configurations can be updated. Immediately after the request returns: * The
302
+ # instance configuration's reconciling field is set to true. While the operation
303
+ # is pending: * Cancelling the operation sets its metadata's cancel_time. The
304
+ # operation is guaranteed to succeed at undoing all changes, after which point
305
+ # it terminates with a `CANCELLED` status. * All other attempts to modify the
306
+ # instance configuration are rejected. * Reading the instance configuration via
307
+ # the API continues to give the pre-request values. Upon completion of the
308
+ # returned operation: * Creating instances using the instance configuration uses
309
+ # the new values. * The new values of the instance configuration are readable
310
+ # via the API. * The instance configuration's reconciling field becomes false.
311
+ # The returned long-running operation will have a name of the format `/
312
+ # operations/` and can be used to track the instance configuration modification.
313
+ # The metadata field type is UpdateInstanceConfigMetadata. The response field
314
+ # type is InstanceConfig, if successful. Authorization requires `spanner.
315
+ # instanceConfigs.update` permission on the resource name.
316
+ # @param [String] name
317
+ # A unique identifier for the instance configuration. Values are of the form `
318
+ # projects//instanceConfigs/a-z*`. User instance configuration must start with `
319
+ # custom-`.
320
+ # @param [Google::Apis::SpannerV1::UpdateInstanceConfigRequest] update_instance_config_request_object
321
+ # @param [String] fields
322
+ # Selector specifying which fields to include in a partial response.
323
+ # @param [String] quota_user
324
+ # Available to use for quota purposes for server-side applications. Can be any
325
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
326
+ # @param [Google::Apis::RequestOptions] options
327
+ # Request-specific options
328
+ #
329
+ # @yield [result, err] Result & error if block supplied
330
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
331
+ # @yieldparam err [StandardError] error object if request failed
332
+ #
333
+ # @return [Google::Apis::SpannerV1::Operation]
334
+ #
335
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
336
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
337
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
338
+ def patch_project_instance_config(name, update_instance_config_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
339
+ command = make_simple_command(:patch, 'v1/{+name}', options)
340
+ command.request_representation = Google::Apis::SpannerV1::UpdateInstanceConfigRequest::Representation
341
+ command.request_object = update_instance_config_request_object
342
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
343
+ command.response_class = Google::Apis::SpannerV1::Operation
344
+ command.params['name'] = name unless name.nil?
345
+ command.query['fields'] = fields unless fields.nil?
346
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
347
+ execute_or_queue_command(command, &block)
348
+ end
349
+
123
350
  # Starts asynchronous cancellation on a long-running operation. The server makes
124
351
  # a best effort to cancel the operation, but success is not guaranteed. If the
125
352
  # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
126
353
  # Clients can use Operations.GetOperation or other methods to check whether the
127
354
  # cancellation succeeded or whether the operation completed despite cancellation.
128
355
  # On successful cancellation, the operation is not deleted; instead, it becomes
129
- # an operation with an Operation.error value with a google.rpc.Status.code of 1,
130
- # corresponding to `Code.CANCELLED`.
356
+ # an operation with an Operation.error value with a google.rpc.Status.code of `1`
357
+ # , corresponding to `Code.CANCELLED`.
131
358
  # @param [String] name
132
359
  # The name of the operation resource to be cancelled.
133
360
  # @param [String] fields
@@ -222,13 +449,7 @@ module Google
222
449
  end
223
450
 
224
451
  # Lists operations that match the specified filter in the request. If the server
225
- # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
226
- # binding allows API services to override the binding to use different resource
227
- # name schemes, such as `users/*/operations`. To override the binding, API
228
- # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
229
- # service configuration. For backwards compatibility, the default name includes
230
- # the operations collection id, however overriding users must ensure the name
231
- # binding is the parent resource, without the operations collection id.
452
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
232
453
  # @param [String] name
233
454
  # The name of the operation's parent resource.
234
455
  # @param [String] filter
@@ -267,6 +488,147 @@ module Google
267
488
  execute_or_queue_command(command, &block)
268
489
  end
269
490
 
491
+ # Starts asynchronous cancellation on a long-running operation. The server makes
492
+ # a best effort to cancel the operation, but success is not guaranteed. If the
493
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
494
+ # Clients can use Operations.GetOperation or other methods to check whether the
495
+ # cancellation succeeded or whether the operation completed despite cancellation.
496
+ # On successful cancellation, the operation is not deleted; instead, it becomes
497
+ # an operation with an Operation.error value with a google.rpc.Status.code of `1`
498
+ # , corresponding to `Code.CANCELLED`.
499
+ # @param [String] name
500
+ # The name of the operation resource to be cancelled.
501
+ # @param [String] fields
502
+ # Selector specifying which fields to include in a partial response.
503
+ # @param [String] quota_user
504
+ # Available to use for quota purposes for server-side applications. Can be any
505
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
506
+ # @param [Google::Apis::RequestOptions] options
507
+ # Request-specific options
508
+ #
509
+ # @yield [result, err] Result & error if block supplied
510
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
511
+ # @yieldparam err [StandardError] error object if request failed
512
+ #
513
+ # @return [Google::Apis::SpannerV1::Empty]
514
+ #
515
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
516
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
517
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
518
+ def cancel_project_instance_config_ssd_cach_operation(name, fields: nil, quota_user: nil, options: nil, &block)
519
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
520
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
521
+ command.response_class = Google::Apis::SpannerV1::Empty
522
+ command.params['name'] = name unless name.nil?
523
+ command.query['fields'] = fields unless fields.nil?
524
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
525
+ execute_or_queue_command(command, &block)
526
+ end
527
+
528
+ # Deletes a long-running operation. This method indicates that the client is no
529
+ # longer interested in the operation result. It does not cancel the operation.
530
+ # If the server doesn't support this method, it returns `google.rpc.Code.
531
+ # UNIMPLEMENTED`.
532
+ # @param [String] name
533
+ # The name of the operation resource to be deleted.
534
+ # @param [String] fields
535
+ # Selector specifying which fields to include in a partial response.
536
+ # @param [String] quota_user
537
+ # Available to use for quota purposes for server-side applications. Can be any
538
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
539
+ # @param [Google::Apis::RequestOptions] options
540
+ # Request-specific options
541
+ #
542
+ # @yield [result, err] Result & error if block supplied
543
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
544
+ # @yieldparam err [StandardError] error object if request failed
545
+ #
546
+ # @return [Google::Apis::SpannerV1::Empty]
547
+ #
548
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
549
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
550
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
551
+ def delete_project_instance_config_ssd_cach_operation(name, fields: nil, quota_user: nil, options: nil, &block)
552
+ command = make_simple_command(:delete, 'v1/{+name}', options)
553
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
554
+ command.response_class = Google::Apis::SpannerV1::Empty
555
+ command.params['name'] = name unless name.nil?
556
+ command.query['fields'] = fields unless fields.nil?
557
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
558
+ execute_or_queue_command(command, &block)
559
+ end
560
+
561
+ # Gets the latest state of a long-running operation. Clients can use this method
562
+ # to poll the operation result at intervals as recommended by the API service.
563
+ # @param [String] name
564
+ # The name of the operation resource.
565
+ # @param [String] fields
566
+ # Selector specifying which fields to include in a partial response.
567
+ # @param [String] quota_user
568
+ # Available to use for quota purposes for server-side applications. Can be any
569
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
570
+ # @param [Google::Apis::RequestOptions] options
571
+ # Request-specific options
572
+ #
573
+ # @yield [result, err] Result & error if block supplied
574
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
575
+ # @yieldparam err [StandardError] error object if request failed
576
+ #
577
+ # @return [Google::Apis::SpannerV1::Operation]
578
+ #
579
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
580
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
581
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
582
+ def get_project_instance_config_ssd_cach_operation(name, fields: nil, quota_user: nil, options: nil, &block)
583
+ command = make_simple_command(:get, 'v1/{+name}', options)
584
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
585
+ command.response_class = Google::Apis::SpannerV1::Operation
586
+ command.params['name'] = name unless name.nil?
587
+ command.query['fields'] = fields unless fields.nil?
588
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
589
+ execute_or_queue_command(command, &block)
590
+ end
591
+
592
+ # Lists operations that match the specified filter in the request. If the server
593
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
594
+ # @param [String] name
595
+ # The name of the operation's parent resource.
596
+ # @param [String] filter
597
+ # The standard list filter.
598
+ # @param [Fixnum] page_size
599
+ # The standard list page size.
600
+ # @param [String] page_token
601
+ # The standard list page token.
602
+ # @param [String] fields
603
+ # Selector specifying which fields to include in a partial response.
604
+ # @param [String] quota_user
605
+ # Available to use for quota purposes for server-side applications. Can be any
606
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
607
+ # @param [Google::Apis::RequestOptions] options
608
+ # Request-specific options
609
+ #
610
+ # @yield [result, err] Result & error if block supplied
611
+ # @yieldparam result [Google::Apis::SpannerV1::ListOperationsResponse] parsed result object
612
+ # @yieldparam err [StandardError] error object if request failed
613
+ #
614
+ # @return [Google::Apis::SpannerV1::ListOperationsResponse]
615
+ #
616
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
617
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
618
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
619
+ def list_project_instance_config_ssd_cach_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
620
+ command = make_simple_command(:get, 'v1/{+name}', options)
621
+ command.response_representation = Google::Apis::SpannerV1::ListOperationsResponse::Representation
622
+ command.response_class = Google::Apis::SpannerV1::ListOperationsResponse
623
+ command.params['name'] = name unless name.nil?
624
+ command.query['filter'] = filter unless filter.nil?
625
+ command.query['pageSize'] = page_size unless page_size.nil?
626
+ command.query['pageToken'] = page_token unless page_token.nil?
627
+ command.query['fields'] = fields unless fields.nil?
628
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
629
+ execute_or_queue_command(command, &block)
630
+ end
631
+
270
632
  # Creates an instance and begins preparing it to begin serving. The returned
271
633
  # long-running operation can be used to track the progress of preparing the new
272
634
  # instance. The instance name is assigned by the caller. If the named instance
@@ -478,8 +840,69 @@ module Google
478
840
  execute_or_queue_command(command, &block)
479
841
  end
480
842
 
481
- # Updates an instance, and begins allocating or releasing resources as requested.
482
- # The returned long-running operation can be used to track the progress of
843
+ # Moves an instance to the target instance configuration. You can use the
844
+ # returned long-running operation to track the progress of moving the instance. `
845
+ # MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of the
846
+ # following criteria: * Is undergoing a move to a different instance
847
+ # configuration * Has backups * Has an ongoing update * Contains any CMEK-
848
+ # enabled databases * Is a free trial instance While the operation is pending: *
849
+ # All other attempts to modify the instance, including changes to its compute
850
+ # capacity, are rejected. * The following database and backup admin operations
851
+ # are rejected: * `DatabaseAdmin.CreateDatabase` * `DatabaseAdmin.
852
+ # UpdateDatabaseDdl` (disabled if default_leader is specified in the request.) *
853
+ # `DatabaseAdmin.RestoreDatabase` * `DatabaseAdmin.CreateBackup` * `
854
+ # DatabaseAdmin.CopyBackup` * Both the source and target instance configurations
855
+ # are subject to hourly compute and storage charges. * The instance might
856
+ # experience higher read-write latencies and a higher transaction abort rate.
857
+ # However, moving an instance doesn't cause any downtime. The returned long-
858
+ # running operation has a name of the format `/operations/` and can be used to
859
+ # track the move instance operation. The metadata field type is
860
+ # MoveInstanceMetadata. The response field type is Instance, if successful.
861
+ # Cancelling the operation sets its metadata's cancel_time. Cancellation is not
862
+ # immediate because it involves moving any data previously moved to the target
863
+ # instance configuration back to the original instance configuration. You can
864
+ # use this operation to track the progress of the cancellation. Upon successful
865
+ # completion of the cancellation, the operation terminates with `CANCELLED`
866
+ # status. If not cancelled, upon completion of the returned operation: * The
867
+ # instance successfully moves to the target instance configuration. * You are
868
+ # billed for compute and storage in target instance configuration. Authorization
869
+ # requires the `spanner.instances.update` permission on the resource instance.
870
+ # For more details, see [Move an instance](https://cloud.google.com/spanner/docs/
871
+ # move-instance).
872
+ # @param [String] name
873
+ # Required. The instance to move. Values are of the form `projects//instances/`.
874
+ # @param [Google::Apis::SpannerV1::MoveInstanceRequest] move_instance_request_object
875
+ # @param [String] fields
876
+ # Selector specifying which fields to include in a partial response.
877
+ # @param [String] quota_user
878
+ # Available to use for quota purposes for server-side applications. Can be any
879
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
880
+ # @param [Google::Apis::RequestOptions] options
881
+ # Request-specific options
882
+ #
883
+ # @yield [result, err] Result & error if block supplied
884
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
885
+ # @yieldparam err [StandardError] error object if request failed
886
+ #
887
+ # @return [Google::Apis::SpannerV1::Operation]
888
+ #
889
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
890
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
891
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
892
+ def move_instance(name, move_instance_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
893
+ command = make_simple_command(:post, 'v1/{+name}:move', options)
894
+ command.request_representation = Google::Apis::SpannerV1::MoveInstanceRequest::Representation
895
+ command.request_object = move_instance_request_object
896
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
897
+ command.response_class = Google::Apis::SpannerV1::Operation
898
+ command.params['name'] = name unless name.nil?
899
+ command.query['fields'] = fields unless fields.nil?
900
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
901
+ execute_or_queue_command(command, &block)
902
+ end
903
+
904
+ # Updates an instance, and begins allocating or releasing resources as requested.
905
+ # The returned long-running operation can be used to track the progress of
483
906
  # updating the instance. If the named instance does not exist, returns `
484
907
  # NOT_FOUND`. Immediately upon completion of this request: * For resource types
485
908
  # for which a decrease in the instance's allocation has been requested, billing
@@ -702,8 +1125,9 @@ module Google
702
1125
  # operations/` and can be used to track copying of the backup. The operation is
703
1126
  # associated with the destination backup. The metadata field type is
704
1127
  # CopyBackupMetadata. The response field type is Backup, if successful.
705
- # Cancelling the returned operation will stop the copying and delete the backup.
706
- # Concurrent CopyBackup requests can run on the same source backup.
1128
+ # Cancelling the returned operation will stop the copying and delete the
1129
+ # destination backup. Concurrent CopyBackup requests can run on the same source
1130
+ # backup.
707
1131
  # @param [String] parent
708
1132
  # Required. The name of the destination instance that will contain the backup
709
1133
  # copy. Values are of the form: `projects//instances/`.
@@ -760,6 +1184,18 @@ module Google
760
1184
  # Optional. The Cloud KMS key that will be used to protect the backup. This
761
1185
  # field should be set only when encryption_type is `CUSTOMER_MANAGED_ENCRYPTION`.
762
1186
  # Values are of the form `projects//locations//keyRings//cryptoKeys/`.
1187
+ # @param [Array<String>, String] encryption_config_kms_key_names
1188
+ # Optional. Specifies the KMS configuration for the one or more keys used to
1189
+ # protect the backup. Values are of the form `projects//locations//keyRings//
1190
+ # cryptoKeys/`. The keys referenced by `kms_key_names` must fully cover all
1191
+ # regions of the backup's instance configuration. Some examples: * For regional (
1192
+ # single-region) instance configurations, specify a regional location KMS key. *
1193
+ # For multi-region instance configurations of type `GOOGLE_MANAGED`, either
1194
+ # specify a multi-region location KMS key or multiple regional location KMS keys
1195
+ # that cover all regions in the instance configuration. * For an instance
1196
+ # configuration of type `USER_MANAGED`, specify only regional location KMS keys
1197
+ # to cover each region in the instance configuration. Multi-region location KMS
1198
+ # keys aren't supported for `USER_MANAGED` type instance configurations.
763
1199
  # @param [String] fields
764
1200
  # Selector specifying which fields to include in a partial response.
765
1201
  # @param [String] quota_user
@@ -777,7 +1213,7 @@ module Google
777
1213
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
778
1214
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
779
1215
  # @raise [Google::Apis::AuthorizationError] Authorization is required
780
- def create_project_instance_backup(parent, backup_object = nil, backup_id: nil, encryption_config_encryption_type: nil, encryption_config_kms_key_name: nil, fields: nil, quota_user: nil, options: nil, &block)
1216
+ def create_project_instance_backup(parent, backup_object = nil, backup_id: nil, encryption_config_encryption_type: nil, encryption_config_kms_key_name: nil, encryption_config_kms_key_names: nil, fields: nil, quota_user: nil, options: nil, &block)
781
1217
  command = make_simple_command(:post, 'v1/{+parent}/backups', options)
782
1218
  command.request_representation = Google::Apis::SpannerV1::Backup::Representation
783
1219
  command.request_object = backup_object
@@ -787,6 +1223,7 @@ module Google
787
1223
  command.query['backupId'] = backup_id unless backup_id.nil?
788
1224
  command.query['encryptionConfig.encryptionType'] = encryption_config_encryption_type unless encryption_config_encryption_type.nil?
789
1225
  command.query['encryptionConfig.kmsKeyName'] = encryption_config_kms_key_name unless encryption_config_kms_key_name.nil?
1226
+ command.query['encryptionConfig.kmsKeyNames'] = encryption_config_kms_key_names unless encryption_config_kms_key_names.nil?
790
1227
  command.query['fields'] = fields unless fields.nil?
791
1228
  command.query['quotaUser'] = quota_user unless quota_user.nil?
792
1229
  execute_or_queue_command(command, &block)
@@ -858,7 +1295,8 @@ module Google
858
1295
  # empty policy if a database or backup exists but does not have a policy set.
859
1296
  # Authorization requires `spanner.databases.getIamPolicy` permission on resource.
860
1297
  # For backups, authorization requires `spanner.backups.getIamPolicy` permission
861
- # on resource.
1298
+ # on resource. For backup schedules, authorization requires `spanner.
1299
+ # backupSchedules.getIamPolicy` permission on resource.
862
1300
  # @param [String] resource
863
1301
  # REQUIRED: The Cloud Spanner resource for which the policy is being retrieved.
864
1302
  # The format is `projects//instances/` for instance resources and `projects//
@@ -908,17 +1346,19 @@ module Google
908
1346
  # create_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `
909
1347
  # expire_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `
910
1348
  # version_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `
911
- # size_bytes` You can combine multiple expressions by enclosing each expression
912
- # in parentheses. By default, expressions are combined with AND logic, but you
913
- # can specify AND, OR, and NOT logic explicitly. Here are a few examples: * `
914
- # name:Howl` - The backup's name contains the string "howl". * `database:prod` -
915
- # The database's name contains the string "prod". * `state:CREATING` - The
916
- # backup is pending creation. * `state:READY` - The backup is fully created and
917
- # ready for use. * `(name:howl) AND (create_time < \"2018-03-28T14:50:00Z\")` -
918
- # The backup name contains the string "howl" and `create_time` of the backup is
919
- # before 2018-03-28T14:50:00Z. * `expire_time < \"2018-03-28T14:50:00Z\"` - The
920
- # backup `expire_time` is before 2018-03-28T14:50:00Z. * `size_bytes >
921
- # 10000000000` - The backup's size is greater than 10GB
1349
+ # size_bytes` * `backup_schedules` You can combine multiple expressions by
1350
+ # enclosing each expression in parentheses. By default, expressions are combined
1351
+ # with AND logic, but you can specify AND, OR, and NOT logic explicitly. Here
1352
+ # are a few examples: * `name:Howl` - The backup's name contains the string "
1353
+ # howl". * `database:prod` - The database's name contains the string "prod". * `
1354
+ # state:CREATING` - The backup is pending creation. * `state:READY` - The backup
1355
+ # is fully created and ready for use. * `(name:howl) AND (create_time < \"2018-
1356
+ # 03-28T14:50:00Z\")` - The backup name contains the string "howl" and `
1357
+ # create_time` of the backup is before 2018-03-28T14:50:00Z. * `expire_time < \"
1358
+ # 2018-03-28T14:50:00Z\"` - The backup `expire_time` is before 2018-03-28T14:50:
1359
+ # 00Z. * `size_bytes > 10000000000` - The backup's size is greater than 10GB * `
1360
+ # backup_schedules:daily` - The backup is created from a schedule with "daily"
1361
+ # in its name.
922
1362
  # @param [Fixnum] page_size
923
1363
  # Number of backups to be returned in the response. If 0 or less, defaults to
924
1364
  # the server's maximum allowed page size.
@@ -1004,7 +1444,8 @@ module Google
1004
1444
  # Sets the access control policy on a database or backup resource. Replaces any
1005
1445
  # existing policy. Authorization requires `spanner.databases.setIamPolicy`
1006
1446
  # permission on resource. For backups, authorization requires `spanner.backups.
1007
- # setIamPolicy` permission on resource.
1447
+ # setIamPolicy` permission on resource. For backup schedules, authorization
1448
+ # requires `spanner.backupSchedules.setIamPolicy` permission on resource.
1008
1449
  # @param [String] resource
1009
1450
  # REQUIRED: The Cloud Spanner resource for which the policy is being set. The
1010
1451
  # format is `projects//instances/` for instance resources and `projects//
@@ -1045,7 +1486,9 @@ module Google
1045
1486
  # permission on the containing Cloud Spanner instance. Otherwise returns an
1046
1487
  # empty set of permissions. Calling this method on a backup that does not exist
1047
1488
  # will result in a NOT_FOUND error if the user has `spanner.backups.list`
1048
- # permission on the containing instance.
1489
+ # permission on the containing instance. Calling this method on a backup
1490
+ # schedule that does not exist will result in a NOT_FOUND error if the user has `
1491
+ # spanner.backupSchedules.list` permission on the containing database.
1049
1492
  # @param [String] resource
1050
1493
  # REQUIRED: The Cloud Spanner resource for which permissions are being tested.
1051
1494
  # The format is `projects//instances/` for instance resources and `projects//
@@ -1086,8 +1529,8 @@ module Google
1086
1529
  # Clients can use Operations.GetOperation or other methods to check whether the
1087
1530
  # cancellation succeeded or whether the operation completed despite cancellation.
1088
1531
  # On successful cancellation, the operation is not deleted; instead, it becomes
1089
- # an operation with an Operation.error value with a google.rpc.Status.code of 1,
1090
- # corresponding to `Code.CANCELLED`.
1532
+ # an operation with an Operation.error value with a google.rpc.Status.code of `1`
1533
+ # , corresponding to `Code.CANCELLED`.
1091
1534
  # @param [String] name
1092
1535
  # The name of the operation resource to be cancelled.
1093
1536
  # @param [String] fields
@@ -1182,13 +1625,7 @@ module Google
1182
1625
  end
1183
1626
 
1184
1627
  # Lists operations that match the specified filter in the request. If the server
1185
- # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
1186
- # binding allows API services to override the binding to use different resource
1187
- # name schemes, such as `users/*/operations`. To override the binding, API
1188
- # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
1189
- # service configuration. For backwards compatibility, the default name includes
1190
- # the operations collection id, however overriding users must ensure the name
1191
- # binding is the parent resource, without the operations collection id.
1628
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
1192
1629
  # @param [String] name
1193
1630
  # The name of the operation's parent resource.
1194
1631
  # @param [String] filter
@@ -1241,7 +1678,7 @@ module Google
1241
1678
  # filtering. The value must be a string, a number, or a boolean. The comparison
1242
1679
  # operator must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. Colon `:` is
1243
1680
  # the contains operator. Filter rules are not case sensitive. The following
1244
- # fields in the Operation are eligible for filtering: * `name` - The name of the
1681
+ # fields in the operation are eligible for filtering: * `name` - The name of the
1245
1682
  # long-running operation * `done` - False if the operation is in progress, else
1246
1683
  # true. * `metadata.@type` - the type of metadata. For example, the type string
1247
1684
  # for RestoreDatabaseMetadata is `type.googleapis.com/google.spanner.admin.
@@ -1297,7 +1734,81 @@ module Google
1297
1734
  execute_or_queue_command(command, &block)
1298
1735
  end
1299
1736
 
1300
- # Creates a new Cloud Spanner database and starts to prepare it for serving. The
1737
+ # Adds split points to specified tables, indexes of a database.
1738
+ # @param [String] database
1739
+ # Required. The database on whose tables/indexes split points are to be added.
1740
+ # Values are of the form `projects//instances//databases/`.
1741
+ # @param [Google::Apis::SpannerV1::AddSplitPointsRequest] add_split_points_request_object
1742
+ # @param [String] fields
1743
+ # Selector specifying which fields to include in a partial response.
1744
+ # @param [String] quota_user
1745
+ # Available to use for quota purposes for server-side applications. Can be any
1746
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1747
+ # @param [Google::Apis::RequestOptions] options
1748
+ # Request-specific options
1749
+ #
1750
+ # @yield [result, err] Result & error if block supplied
1751
+ # @yieldparam result [Google::Apis::SpannerV1::AddSplitPointsResponse] parsed result object
1752
+ # @yieldparam err [StandardError] error object if request failed
1753
+ #
1754
+ # @return [Google::Apis::SpannerV1::AddSplitPointsResponse]
1755
+ #
1756
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1757
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1758
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1759
+ def add_database_split_points(database, add_split_points_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1760
+ command = make_simple_command(:post, 'v1/{+database}:addSplitPoints', options)
1761
+ command.request_representation = Google::Apis::SpannerV1::AddSplitPointsRequest::Representation
1762
+ command.request_object = add_split_points_request_object
1763
+ command.response_representation = Google::Apis::SpannerV1::AddSplitPointsResponse::Representation
1764
+ command.response_class = Google::Apis::SpannerV1::AddSplitPointsResponse
1765
+ command.params['database'] = database unless database.nil?
1766
+ command.query['fields'] = fields unless fields.nil?
1767
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1768
+ execute_or_queue_command(command, &block)
1769
+ end
1770
+
1771
+ # `ChangeQuorum` is strictly restricted to databases that use dual-region
1772
+ # instance configurations. Initiates a background operation to change the quorum
1773
+ # of a database from dual-region mode to single-region mode or vice versa. The
1774
+ # returned long-running operation has a name of the format `projects//instances//
1775
+ # databases//operations/` and can be used to track execution of the `
1776
+ # ChangeQuorum`. The metadata field type is ChangeQuorumMetadata. Authorization
1777
+ # requires `spanner.databases.changequorum` permission on the resource database.
1778
+ # @param [String] name
1779
+ # Required. Name of the database in which to apply `ChangeQuorum`. Values are of
1780
+ # the form `projects//instances//databases/`.
1781
+ # @param [Google::Apis::SpannerV1::ChangeQuorumRequest] change_quorum_request_object
1782
+ # @param [String] fields
1783
+ # Selector specifying which fields to include in a partial response.
1784
+ # @param [String] quota_user
1785
+ # Available to use for quota purposes for server-side applications. Can be any
1786
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
1787
+ # @param [Google::Apis::RequestOptions] options
1788
+ # Request-specific options
1789
+ #
1790
+ # @yield [result, err] Result & error if block supplied
1791
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
1792
+ # @yieldparam err [StandardError] error object if request failed
1793
+ #
1794
+ # @return [Google::Apis::SpannerV1::Operation]
1795
+ #
1796
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1797
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1798
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
1799
+ def changequorum_project_instance_database(name, change_quorum_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1800
+ command = make_simple_command(:post, 'v1/{+name}:changequorum', options)
1801
+ command.request_representation = Google::Apis::SpannerV1::ChangeQuorumRequest::Representation
1802
+ command.request_object = change_quorum_request_object
1803
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
1804
+ command.response_class = Google::Apis::SpannerV1::Operation
1805
+ command.params['name'] = name unless name.nil?
1806
+ command.query['fields'] = fields unless fields.nil?
1807
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
1808
+ execute_or_queue_command(command, &block)
1809
+ end
1810
+
1811
+ # Creates a new Spanner database and starts to prepare it for serving. The
1301
1812
  # returned long-running operation will have a name of the format `/operations/`
1302
1813
  # and can be used to track preparation of the database. The metadata field type
1303
1814
  # is CreateDatabaseMetadata. The response field type is Database, if successful.
@@ -1435,7 +1946,8 @@ module Google
1435
1946
  # empty policy if a database or backup exists but does not have a policy set.
1436
1947
  # Authorization requires `spanner.databases.getIamPolicy` permission on resource.
1437
1948
  # For backups, authorization requires `spanner.backups.getIamPolicy` permission
1438
- # on resource.
1949
+ # on resource. For backup schedules, authorization requires `spanner.
1950
+ # backupSchedules.getIamPolicy` permission on resource.
1439
1951
  # @param [String] resource
1440
1952
  # REQUIRED: The Cloud Spanner resource for which the policy is being retrieved.
1441
1953
  # The format is `projects//instances/` for instance resources and `projects//
@@ -1554,6 +2066,60 @@ module Google
1554
2066
  execute_or_queue_command(command, &block)
1555
2067
  end
1556
2068
 
2069
+ # Updates a Cloud Spanner database. The returned long-running operation can be
2070
+ # used to track the progress of updating the database. If the named database
2071
+ # does not exist, returns `NOT_FOUND`. While the operation is pending: * The
2072
+ # database's reconciling field is set to true. * Cancelling the operation is
2073
+ # best-effort. If the cancellation succeeds, the operation metadata's
2074
+ # cancel_time is set, the updates are reverted, and the operation terminates
2075
+ # with a `CANCELLED` status. * New UpdateDatabase requests will return a `
2076
+ # FAILED_PRECONDITION` error until the pending operation is done (returns
2077
+ # successfully or with error). * Reading the database via the API continues to
2078
+ # give the pre-request values. Upon completion of the returned operation: * The
2079
+ # new values are in effect and readable via the API. * The database's
2080
+ # reconciling field becomes false. The returned long-running operation will have
2081
+ # a name of the format `projects//instances//databases//operations/` and can be
2082
+ # used to track the database modification. The metadata field type is
2083
+ # UpdateDatabaseMetadata. The response field type is Database, if successful.
2084
+ # @param [String] name
2085
+ # Required. The name of the database. Values are of the form `projects//
2086
+ # instances//databases/`, where `` is as specified in the `CREATE DATABASE`
2087
+ # statement. This name can be passed to other API methods to identify the
2088
+ # database.
2089
+ # @param [Google::Apis::SpannerV1::Database] database_object
2090
+ # @param [String] update_mask
2091
+ # Required. The list of fields to update. Currently, only `
2092
+ # enable_drop_protection` field can be updated.
2093
+ # @param [String] fields
2094
+ # Selector specifying which fields to include in a partial response.
2095
+ # @param [String] quota_user
2096
+ # Available to use for quota purposes for server-side applications. Can be any
2097
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2098
+ # @param [Google::Apis::RequestOptions] options
2099
+ # Request-specific options
2100
+ #
2101
+ # @yield [result, err] Result & error if block supplied
2102
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
2103
+ # @yieldparam err [StandardError] error object if request failed
2104
+ #
2105
+ # @return [Google::Apis::SpannerV1::Operation]
2106
+ #
2107
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2108
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2109
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2110
+ def patch_project_instance_database(name, database_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
2111
+ command = make_simple_command(:patch, 'v1/{+name}', options)
2112
+ command.request_representation = Google::Apis::SpannerV1::Database::Representation
2113
+ command.request_object = database_object
2114
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
2115
+ command.response_class = Google::Apis::SpannerV1::Operation
2116
+ command.params['name'] = name unless name.nil?
2117
+ command.query['updateMask'] = update_mask unless update_mask.nil?
2118
+ command.query['fields'] = fields unless fields.nil?
2119
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2120
+ execute_or_queue_command(command, &block)
2121
+ end
2122
+
1557
2123
  # Create a new database by restoring from a completed backup. The new database
1558
2124
  # must be in the same project and in an instance with the same instance
1559
2125
  # configuration as the instance containing the backup. The returned database
@@ -1604,7 +2170,8 @@ module Google
1604
2170
  # Sets the access control policy on a database or backup resource. Replaces any
1605
2171
  # existing policy. Authorization requires `spanner.databases.setIamPolicy`
1606
2172
  # permission on resource. For backups, authorization requires `spanner.backups.
1607
- # setIamPolicy` permission on resource.
2173
+ # setIamPolicy` permission on resource. For backup schedules, authorization
2174
+ # requires `spanner.backupSchedules.setIamPolicy` permission on resource.
1608
2175
  # @param [String] resource
1609
2176
  # REQUIRED: The Cloud Spanner resource for which the policy is being set. The
1610
2177
  # format is `projects//instances/` for instance resources and `projects//
@@ -1645,7 +2212,9 @@ module Google
1645
2212
  # permission on the containing Cloud Spanner instance. Otherwise returns an
1646
2213
  # empty set of permissions. Calling this method on a backup that does not exist
1647
2214
  # will result in a NOT_FOUND error if the user has `spanner.backups.list`
1648
- # permission on the containing instance.
2215
+ # permission on the containing instance. Calling this method on a backup
2216
+ # schedule that does not exist will result in a NOT_FOUND error if the user has `
2217
+ # spanner.backupSchedules.list` permission on the containing database.
1649
2218
  # @param [String] resource
1650
2219
  # REQUIRED: The Cloud Spanner resource for which permissions are being tested.
1651
2220
  # The format is `projects//instances/` for instance resources and `projects//
@@ -1717,16 +2286,14 @@ module Google
1717
2286
  execute_or_queue_command(command, &block)
1718
2287
  end
1719
2288
 
1720
- # Lists Cloud Spanner database roles.
2289
+ # Creates a new backup schedule.
1721
2290
  # @param [String] parent
1722
- # Required. The database whose roles should be listed. Values are of the form `
1723
- # projects//instances//databases/`.
1724
- # @param [Fixnum] page_size
1725
- # Number of database roles to be returned in the response. If 0 or less,
1726
- # defaults to the server's maximum allowed page size.
1727
- # @param [String] page_token
1728
- # If non-empty, `page_token` should contain a next_page_token from a previous
1729
- # ListDatabaseRolesResponse.
2291
+ # Required. The name of the database that this backup schedule applies to.
2292
+ # @param [Google::Apis::SpannerV1::BackupSchedule] backup_schedule_object
2293
+ # @param [String] backup_schedule_id
2294
+ # Required. The Id to use for the backup schedule. The `backup_schedule_id`
2295
+ # appended to `parent` forms the full backup schedule name of the form `projects/
2296
+ # /instances//databases//backupSchedules/`.
1730
2297
  # @param [String] fields
1731
2298
  # Selector specifying which fields to include in a partial response.
1732
2299
  # @param [String] quota_user
@@ -1736,38 +2303,31 @@ module Google
1736
2303
  # Request-specific options
1737
2304
  #
1738
2305
  # @yield [result, err] Result & error if block supplied
1739
- # @yieldparam result [Google::Apis::SpannerV1::ListDatabaseRolesResponse] parsed result object
2306
+ # @yieldparam result [Google::Apis::SpannerV1::BackupSchedule] parsed result object
1740
2307
  # @yieldparam err [StandardError] error object if request failed
1741
2308
  #
1742
- # @return [Google::Apis::SpannerV1::ListDatabaseRolesResponse]
2309
+ # @return [Google::Apis::SpannerV1::BackupSchedule]
1743
2310
  #
1744
2311
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1745
2312
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1746
2313
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1747
- def list_project_instance_database_database_roles(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1748
- command = make_simple_command(:get, 'v1/{+parent}/databaseRoles', options)
1749
- command.response_representation = Google::Apis::SpannerV1::ListDatabaseRolesResponse::Representation
1750
- command.response_class = Google::Apis::SpannerV1::ListDatabaseRolesResponse
2314
+ def create_project_instance_database_backup_schedule(parent, backup_schedule_object = nil, backup_schedule_id: nil, fields: nil, quota_user: nil, options: nil, &block)
2315
+ command = make_simple_command(:post, 'v1/{+parent}/backupSchedules', options)
2316
+ command.request_representation = Google::Apis::SpannerV1::BackupSchedule::Representation
2317
+ command.request_object = backup_schedule_object
2318
+ command.response_representation = Google::Apis::SpannerV1::BackupSchedule::Representation
2319
+ command.response_class = Google::Apis::SpannerV1::BackupSchedule
1751
2320
  command.params['parent'] = parent unless parent.nil?
1752
- command.query['pageSize'] = page_size unless page_size.nil?
1753
- command.query['pageToken'] = page_token unless page_token.nil?
2321
+ command.query['backupScheduleId'] = backup_schedule_id unless backup_schedule_id.nil?
1754
2322
  command.query['fields'] = fields unless fields.nil?
1755
2323
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1756
2324
  execute_or_queue_command(command, &block)
1757
2325
  end
1758
2326
 
1759
- # Returns permissions that the caller has on the specified database or backup
1760
- # resource. Attempting this RPC on a non-existent Cloud Spanner database will
1761
- # result in a NOT_FOUND error if the user has `spanner.databases.list`
1762
- # permission on the containing Cloud Spanner instance. Otherwise returns an
1763
- # empty set of permissions. Calling this method on a backup that does not exist
1764
- # will result in a NOT_FOUND error if the user has `spanner.backups.list`
1765
- # permission on the containing instance.
1766
- # @param [String] resource
1767
- # REQUIRED: The Cloud Spanner resource for which permissions are being tested.
1768
- # The format is `projects//instances/` for instance resources and `projects//
1769
- # instances//databases/` for database resources.
1770
- # @param [Google::Apis::SpannerV1::TestIamPermissionsRequest] test_iam_permissions_request_object
2327
+ # Deletes a backup schedule.
2328
+ # @param [String] name
2329
+ # Required. The name of the schedule to delete. Values are of the form `projects/
2330
+ # /instances//databases//backupSchedules/`.
1771
2331
  # @param [String] fields
1772
2332
  # Selector specifying which fields to include in a partial response.
1773
2333
  # @param [String] quota_user
@@ -1777,36 +2337,28 @@ module Google
1777
2337
  # Request-specific options
1778
2338
  #
1779
2339
  # @yield [result, err] Result & error if block supplied
1780
- # @yieldparam result [Google::Apis::SpannerV1::TestIamPermissionsResponse] parsed result object
2340
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
1781
2341
  # @yieldparam err [StandardError] error object if request failed
1782
2342
  #
1783
- # @return [Google::Apis::SpannerV1::TestIamPermissionsResponse]
2343
+ # @return [Google::Apis::SpannerV1::Empty]
1784
2344
  #
1785
2345
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1786
2346
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1787
2347
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1788
- def test_database_role_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1789
- command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
1790
- command.request_representation = Google::Apis::SpannerV1::TestIamPermissionsRequest::Representation
1791
- command.request_object = test_iam_permissions_request_object
1792
- command.response_representation = Google::Apis::SpannerV1::TestIamPermissionsResponse::Representation
1793
- command.response_class = Google::Apis::SpannerV1::TestIamPermissionsResponse
1794
- command.params['resource'] = resource unless resource.nil?
2348
+ def delete_project_instance_database_backup_schedule(name, fields: nil, quota_user: nil, options: nil, &block)
2349
+ command = make_simple_command(:delete, 'v1/{+name}', options)
2350
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
2351
+ command.response_class = Google::Apis::SpannerV1::Empty
2352
+ command.params['name'] = name unless name.nil?
1795
2353
  command.query['fields'] = fields unless fields.nil?
1796
2354
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1797
2355
  execute_or_queue_command(command, &block)
1798
2356
  end
1799
2357
 
1800
- # Starts asynchronous cancellation on a long-running operation. The server makes
1801
- # a best effort to cancel the operation, but success is not guaranteed. If the
1802
- # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
1803
- # Clients can use Operations.GetOperation or other methods to check whether the
1804
- # cancellation succeeded or whether the operation completed despite cancellation.
1805
- # On successful cancellation, the operation is not deleted; instead, it becomes
1806
- # an operation with an Operation.error value with a google.rpc.Status.code of 1,
1807
- # corresponding to `Code.CANCELLED`.
2358
+ # Gets backup schedule for the input schedule name.
1808
2359
  # @param [String] name
1809
- # The name of the operation resource to be cancelled.
2360
+ # Required. The name of the schedule to retrieve. Values are of the form `
2361
+ # projects//instances//databases//backupSchedules/`.
1810
2362
  # @param [String] fields
1811
2363
  # Selector specifying which fields to include in a partial response.
1812
2364
  # @param [String] quota_user
@@ -1816,30 +2368,35 @@ module Google
1816
2368
  # Request-specific options
1817
2369
  #
1818
2370
  # @yield [result, err] Result & error if block supplied
1819
- # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
2371
+ # @yieldparam result [Google::Apis::SpannerV1::BackupSchedule] parsed result object
1820
2372
  # @yieldparam err [StandardError] error object if request failed
1821
2373
  #
1822
- # @return [Google::Apis::SpannerV1::Empty]
2374
+ # @return [Google::Apis::SpannerV1::BackupSchedule]
1823
2375
  #
1824
2376
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1825
2377
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1826
2378
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1827
- def cancel_project_instance_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1828
- command = make_simple_command(:post, 'v1/{+name}:cancel', options)
1829
- command.response_representation = Google::Apis::SpannerV1::Empty::Representation
1830
- command.response_class = Google::Apis::SpannerV1::Empty
2379
+ def get_project_instance_database_backup_schedule(name, fields: nil, quota_user: nil, options: nil, &block)
2380
+ command = make_simple_command(:get, 'v1/{+name}', options)
2381
+ command.response_representation = Google::Apis::SpannerV1::BackupSchedule::Representation
2382
+ command.response_class = Google::Apis::SpannerV1::BackupSchedule
1831
2383
  command.params['name'] = name unless name.nil?
1832
2384
  command.query['fields'] = fields unless fields.nil?
1833
2385
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1834
2386
  execute_or_queue_command(command, &block)
1835
2387
  end
1836
2388
 
1837
- # Deletes a long-running operation. This method indicates that the client is no
1838
- # longer interested in the operation result. It does not cancel the operation.
1839
- # If the server doesn't support this method, it returns `google.rpc.Code.
1840
- # UNIMPLEMENTED`.
1841
- # @param [String] name
1842
- # The name of the operation resource to be deleted.
2389
+ # Gets the access control policy for a database or backup resource. Returns an
2390
+ # empty policy if a database or backup exists but does not have a policy set.
2391
+ # Authorization requires `spanner.databases.getIamPolicy` permission on resource.
2392
+ # For backups, authorization requires `spanner.backups.getIamPolicy` permission
2393
+ # on resource. For backup schedules, authorization requires `spanner.
2394
+ # backupSchedules.getIamPolicy` permission on resource.
2395
+ # @param [String] resource
2396
+ # REQUIRED: The Cloud Spanner resource for which the policy is being retrieved.
2397
+ # The format is `projects//instances/` for instance resources and `projects//
2398
+ # instances//databases/` for database resources.
2399
+ # @param [Google::Apis::SpannerV1::GetIamPolicyRequest] get_iam_policy_request_object
1843
2400
  # @param [String] fields
1844
2401
  # Selector specifying which fields to include in a partial response.
1845
2402
  # @param [String] quota_user
@@ -1849,28 +2406,36 @@ module Google
1849
2406
  # Request-specific options
1850
2407
  #
1851
2408
  # @yield [result, err] Result & error if block supplied
1852
- # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
2409
+ # @yieldparam result [Google::Apis::SpannerV1::Policy] parsed result object
1853
2410
  # @yieldparam err [StandardError] error object if request failed
1854
2411
  #
1855
- # @return [Google::Apis::SpannerV1::Empty]
2412
+ # @return [Google::Apis::SpannerV1::Policy]
1856
2413
  #
1857
2414
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1858
2415
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1859
2416
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1860
- def delete_project_instance_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1861
- command = make_simple_command(:delete, 'v1/{+name}', options)
1862
- command.response_representation = Google::Apis::SpannerV1::Empty::Representation
1863
- command.response_class = Google::Apis::SpannerV1::Empty
1864
- command.params['name'] = name unless name.nil?
2417
+ def get_backup_schedule_iam_policy(resource, get_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2418
+ command = make_simple_command(:post, 'v1/{+resource}:getIamPolicy', options)
2419
+ command.request_representation = Google::Apis::SpannerV1::GetIamPolicyRequest::Representation
2420
+ command.request_object = get_iam_policy_request_object
2421
+ command.response_representation = Google::Apis::SpannerV1::Policy::Representation
2422
+ command.response_class = Google::Apis::SpannerV1::Policy
2423
+ command.params['resource'] = resource unless resource.nil?
1865
2424
  command.query['fields'] = fields unless fields.nil?
1866
2425
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1867
2426
  execute_or_queue_command(command, &block)
1868
2427
  end
1869
2428
 
1870
- # Gets the latest state of a long-running operation. Clients can use this method
1871
- # to poll the operation result at intervals as recommended by the API service.
1872
- # @param [String] name
1873
- # The name of the operation resource.
2429
+ # Lists all the backup schedules for the database.
2430
+ # @param [String] parent
2431
+ # Required. Database is the parent resource whose backup schedules should be
2432
+ # listed. Values are of the form projects//instances//databases/
2433
+ # @param [Fixnum] page_size
2434
+ # Optional. Number of backup schedules to be returned in the response. If 0 or
2435
+ # less, defaults to the server's maximum allowed page size.
2436
+ # @param [String] page_token
2437
+ # Optional. If non-empty, `page_token` should contain a next_page_token from a
2438
+ # previous ListBackupSchedulesResponse to the same `parent`.
1874
2439
  # @param [String] fields
1875
2440
  # Selector specifying which fields to include in a partial response.
1876
2441
  # @param [String] quota_user
@@ -1880,40 +2445,39 @@ module Google
1880
2445
  # Request-specific options
1881
2446
  #
1882
2447
  # @yield [result, err] Result & error if block supplied
1883
- # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
2448
+ # @yieldparam result [Google::Apis::SpannerV1::ListBackupSchedulesResponse] parsed result object
1884
2449
  # @yieldparam err [StandardError] error object if request failed
1885
2450
  #
1886
- # @return [Google::Apis::SpannerV1::Operation]
2451
+ # @return [Google::Apis::SpannerV1::ListBackupSchedulesResponse]
1887
2452
  #
1888
2453
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1889
2454
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1890
2455
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1891
- def get_project_instance_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
1892
- command = make_simple_command(:get, 'v1/{+name}', options)
1893
- command.response_representation = Google::Apis::SpannerV1::Operation::Representation
1894
- command.response_class = Google::Apis::SpannerV1::Operation
1895
- command.params['name'] = name unless name.nil?
2456
+ def list_project_instance_database_backup_schedules(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2457
+ command = make_simple_command(:get, 'v1/{+parent}/backupSchedules', options)
2458
+ command.response_representation = Google::Apis::SpannerV1::ListBackupSchedulesResponse::Representation
2459
+ command.response_class = Google::Apis::SpannerV1::ListBackupSchedulesResponse
2460
+ command.params['parent'] = parent unless parent.nil?
2461
+ command.query['pageSize'] = page_size unless page_size.nil?
2462
+ command.query['pageToken'] = page_token unless page_token.nil?
1896
2463
  command.query['fields'] = fields unless fields.nil?
1897
2464
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1898
2465
  execute_or_queue_command(command, &block)
1899
2466
  end
1900
2467
 
1901
- # Lists operations that match the specified filter in the request. If the server
1902
- # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
1903
- # binding allows API services to override the binding to use different resource
1904
- # name schemes, such as `users/*/operations`. To override the binding, API
1905
- # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
1906
- # service configuration. For backwards compatibility, the default name includes
1907
- # the operations collection id, however overriding users must ensure the name
1908
- # binding is the parent resource, without the operations collection id.
2468
+ # Updates a backup schedule.
1909
2469
  # @param [String] name
1910
- # The name of the operation's parent resource.
1911
- # @param [String] filter
1912
- # The standard list filter.
1913
- # @param [Fixnum] page_size
1914
- # The standard list page size.
1915
- # @param [String] page_token
1916
- # The standard list page token.
2470
+ # Identifier. Output only for the CreateBackupSchedule operation. Required for
2471
+ # the UpdateBackupSchedule operation. A globally unique identifier for the
2472
+ # backup schedule which cannot be changed. Values are of the form `projects//
2473
+ # instances//databases//backupSchedules/a-z*[a-z0-9]` The final segment of the
2474
+ # name must be between 2 and 60 characters in length.
2475
+ # @param [Google::Apis::SpannerV1::BackupSchedule] backup_schedule_object
2476
+ # @param [String] update_mask
2477
+ # Required. A mask specifying which fields in the BackupSchedule resource should
2478
+ # be updated. This mask is relative to the BackupSchedule resource, not to the
2479
+ # request message. The field mask must always be specified; this prevents any
2480
+ # future fields from being erased accidentally.
1917
2481
  # @param [String] fields
1918
2482
  # Selector specifying which fields to include in a partial response.
1919
2483
  # @param [String] quota_user
@@ -1923,33 +2487,37 @@ module Google
1923
2487
  # Request-specific options
1924
2488
  #
1925
2489
  # @yield [result, err] Result & error if block supplied
1926
- # @yieldparam result [Google::Apis::SpannerV1::ListOperationsResponse] parsed result object
2490
+ # @yieldparam result [Google::Apis::SpannerV1::BackupSchedule] parsed result object
1927
2491
  # @yieldparam err [StandardError] error object if request failed
1928
2492
  #
1929
- # @return [Google::Apis::SpannerV1::ListOperationsResponse]
2493
+ # @return [Google::Apis::SpannerV1::BackupSchedule]
1930
2494
  #
1931
2495
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1932
2496
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1933
2497
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1934
- def list_project_instance_database_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
1935
- command = make_simple_command(:get, 'v1/{+name}', options)
1936
- command.response_representation = Google::Apis::SpannerV1::ListOperationsResponse::Representation
1937
- command.response_class = Google::Apis::SpannerV1::ListOperationsResponse
2498
+ def patch_project_instance_database_backup_schedule(name, backup_schedule_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
2499
+ command = make_simple_command(:patch, 'v1/{+name}', options)
2500
+ command.request_representation = Google::Apis::SpannerV1::BackupSchedule::Representation
2501
+ command.request_object = backup_schedule_object
2502
+ command.response_representation = Google::Apis::SpannerV1::BackupSchedule::Representation
2503
+ command.response_class = Google::Apis::SpannerV1::BackupSchedule
1938
2504
  command.params['name'] = name unless name.nil?
1939
- command.query['filter'] = filter unless filter.nil?
1940
- command.query['pageSize'] = page_size unless page_size.nil?
1941
- command.query['pageToken'] = page_token unless page_token.nil?
2505
+ command.query['updateMask'] = update_mask unless update_mask.nil?
1942
2506
  command.query['fields'] = fields unless fields.nil?
1943
2507
  command.query['quotaUser'] = quota_user unless quota_user.nil?
1944
2508
  execute_or_queue_command(command, &block)
1945
2509
  end
1946
2510
 
1947
- # Creates multiple new sessions. This API can be used to initialize a session
1948
- # cache on the clients. See https://goo.gl/TgSFN2 for best practices on session
1949
- # cache management.
1950
- # @param [String] database
1951
- # Required. The database in which the new sessions are created.
1952
- # @param [Google::Apis::SpannerV1::BatchCreateSessionsRequest] batch_create_sessions_request_object
2511
+ # Sets the access control policy on a database or backup resource. Replaces any
2512
+ # existing policy. Authorization requires `spanner.databases.setIamPolicy`
2513
+ # permission on resource. For backups, authorization requires `spanner.backups.
2514
+ # setIamPolicy` permission on resource. For backup schedules, authorization
2515
+ # requires `spanner.backupSchedules.setIamPolicy` permission on resource.
2516
+ # @param [String] resource
2517
+ # REQUIRED: The Cloud Spanner resource for which the policy is being set. The
2518
+ # format is `projects//instances/` for instance resources and `projects//
2519
+ # instances//databases/` for databases resources.
2520
+ # @param [Google::Apis::SpannerV1::SetIamPolicyRequest] set_iam_policy_request_object
1953
2521
  # @param [String] fields
1954
2522
  # Selector specifying which fields to include in a partial response.
1955
2523
  # @param [String] quota_user
@@ -1959,19 +2527,390 @@ module Google
1959
2527
  # Request-specific options
1960
2528
  #
1961
2529
  # @yield [result, err] Result & error if block supplied
1962
- # @yieldparam result [Google::Apis::SpannerV1::BatchCreateSessionsResponse] parsed result object
2530
+ # @yieldparam result [Google::Apis::SpannerV1::Policy] parsed result object
1963
2531
  # @yieldparam err [StandardError] error object if request failed
1964
2532
  #
1965
- # @return [Google::Apis::SpannerV1::BatchCreateSessionsResponse]
2533
+ # @return [Google::Apis::SpannerV1::Policy]
1966
2534
  #
1967
2535
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
1968
2536
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
1969
2537
  # @raise [Google::Apis::AuthorizationError] Authorization is required
1970
- def batch_create_sessions(database, batch_create_sessions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
1971
- command = make_simple_command(:post, 'v1/{+database}/sessions:batchCreate', options)
1972
- command.request_representation = Google::Apis::SpannerV1::BatchCreateSessionsRequest::Representation
1973
- command.request_object = batch_create_sessions_request_object
1974
- command.response_representation = Google::Apis::SpannerV1::BatchCreateSessionsResponse::Representation
2538
+ def set_backup_schedule_iam_policy(resource, set_iam_policy_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2539
+ command = make_simple_command(:post, 'v1/{+resource}:setIamPolicy', options)
2540
+ command.request_representation = Google::Apis::SpannerV1::SetIamPolicyRequest::Representation
2541
+ command.request_object = set_iam_policy_request_object
2542
+ command.response_representation = Google::Apis::SpannerV1::Policy::Representation
2543
+ command.response_class = Google::Apis::SpannerV1::Policy
2544
+ command.params['resource'] = resource unless resource.nil?
2545
+ command.query['fields'] = fields unless fields.nil?
2546
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2547
+ execute_or_queue_command(command, &block)
2548
+ end
2549
+
2550
+ # Returns permissions that the caller has on the specified database or backup
2551
+ # resource. Attempting this RPC on a non-existent Cloud Spanner database will
2552
+ # result in a NOT_FOUND error if the user has `spanner.databases.list`
2553
+ # permission on the containing Cloud Spanner instance. Otherwise returns an
2554
+ # empty set of permissions. Calling this method on a backup that does not exist
2555
+ # will result in a NOT_FOUND error if the user has `spanner.backups.list`
2556
+ # permission on the containing instance. Calling this method on a backup
2557
+ # schedule that does not exist will result in a NOT_FOUND error if the user has `
2558
+ # spanner.backupSchedules.list` permission on the containing database.
2559
+ # @param [String] resource
2560
+ # REQUIRED: The Cloud Spanner resource for which permissions are being tested.
2561
+ # The format is `projects//instances/` for instance resources and `projects//
2562
+ # instances//databases/` for database resources.
2563
+ # @param [Google::Apis::SpannerV1::TestIamPermissionsRequest] test_iam_permissions_request_object
2564
+ # @param [String] fields
2565
+ # Selector specifying which fields to include in a partial response.
2566
+ # @param [String] quota_user
2567
+ # Available to use for quota purposes for server-side applications. Can be any
2568
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2569
+ # @param [Google::Apis::RequestOptions] options
2570
+ # Request-specific options
2571
+ #
2572
+ # @yield [result, err] Result & error if block supplied
2573
+ # @yieldparam result [Google::Apis::SpannerV1::TestIamPermissionsResponse] parsed result object
2574
+ # @yieldparam err [StandardError] error object if request failed
2575
+ #
2576
+ # @return [Google::Apis::SpannerV1::TestIamPermissionsResponse]
2577
+ #
2578
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2579
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2580
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2581
+ def test_backup_schedule_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2582
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
2583
+ command.request_representation = Google::Apis::SpannerV1::TestIamPermissionsRequest::Representation
2584
+ command.request_object = test_iam_permissions_request_object
2585
+ command.response_representation = Google::Apis::SpannerV1::TestIamPermissionsResponse::Representation
2586
+ command.response_class = Google::Apis::SpannerV1::TestIamPermissionsResponse
2587
+ command.params['resource'] = resource unless resource.nil?
2588
+ command.query['fields'] = fields unless fields.nil?
2589
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2590
+ execute_or_queue_command(command, &block)
2591
+ end
2592
+
2593
+ # Lists Cloud Spanner database roles.
2594
+ # @param [String] parent
2595
+ # Required. The database whose roles should be listed. Values are of the form `
2596
+ # projects//instances//databases/`.
2597
+ # @param [Fixnum] page_size
2598
+ # Number of database roles to be returned in the response. If 0 or less,
2599
+ # defaults to the server's maximum allowed page size.
2600
+ # @param [String] page_token
2601
+ # If non-empty, `page_token` should contain a next_page_token from a previous
2602
+ # ListDatabaseRolesResponse.
2603
+ # @param [String] fields
2604
+ # Selector specifying which fields to include in a partial response.
2605
+ # @param [String] quota_user
2606
+ # Available to use for quota purposes for server-side applications. Can be any
2607
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2608
+ # @param [Google::Apis::RequestOptions] options
2609
+ # Request-specific options
2610
+ #
2611
+ # @yield [result, err] Result & error if block supplied
2612
+ # @yieldparam result [Google::Apis::SpannerV1::ListDatabaseRolesResponse] parsed result object
2613
+ # @yieldparam err [StandardError] error object if request failed
2614
+ #
2615
+ # @return [Google::Apis::SpannerV1::ListDatabaseRolesResponse]
2616
+ #
2617
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2618
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2619
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2620
+ def list_project_instance_database_database_roles(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2621
+ command = make_simple_command(:get, 'v1/{+parent}/databaseRoles', options)
2622
+ command.response_representation = Google::Apis::SpannerV1::ListDatabaseRolesResponse::Representation
2623
+ command.response_class = Google::Apis::SpannerV1::ListDatabaseRolesResponse
2624
+ command.params['parent'] = parent unless parent.nil?
2625
+ command.query['pageSize'] = page_size unless page_size.nil?
2626
+ command.query['pageToken'] = page_token unless page_token.nil?
2627
+ command.query['fields'] = fields unless fields.nil?
2628
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2629
+ execute_or_queue_command(command, &block)
2630
+ end
2631
+
2632
+ # Returns permissions that the caller has on the specified database or backup
2633
+ # resource. Attempting this RPC on a non-existent Cloud Spanner database will
2634
+ # result in a NOT_FOUND error if the user has `spanner.databases.list`
2635
+ # permission on the containing Cloud Spanner instance. Otherwise returns an
2636
+ # empty set of permissions. Calling this method on a backup that does not exist
2637
+ # will result in a NOT_FOUND error if the user has `spanner.backups.list`
2638
+ # permission on the containing instance. Calling this method on a backup
2639
+ # schedule that does not exist will result in a NOT_FOUND error if the user has `
2640
+ # spanner.backupSchedules.list` permission on the containing database.
2641
+ # @param [String] resource
2642
+ # REQUIRED: The Cloud Spanner resource for which permissions are being tested.
2643
+ # The format is `projects//instances/` for instance resources and `projects//
2644
+ # instances//databases/` for database resources.
2645
+ # @param [Google::Apis::SpannerV1::TestIamPermissionsRequest] test_iam_permissions_request_object
2646
+ # @param [String] fields
2647
+ # Selector specifying which fields to include in a partial response.
2648
+ # @param [String] quota_user
2649
+ # Available to use for quota purposes for server-side applications. Can be any
2650
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2651
+ # @param [Google::Apis::RequestOptions] options
2652
+ # Request-specific options
2653
+ #
2654
+ # @yield [result, err] Result & error if block supplied
2655
+ # @yieldparam result [Google::Apis::SpannerV1::TestIamPermissionsResponse] parsed result object
2656
+ # @yieldparam err [StandardError] error object if request failed
2657
+ #
2658
+ # @return [Google::Apis::SpannerV1::TestIamPermissionsResponse]
2659
+ #
2660
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2661
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2662
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2663
+ def test_database_role_iam_permissions(resource, test_iam_permissions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2664
+ command = make_simple_command(:post, 'v1/{+resource}:testIamPermissions', options)
2665
+ command.request_representation = Google::Apis::SpannerV1::TestIamPermissionsRequest::Representation
2666
+ command.request_object = test_iam_permissions_request_object
2667
+ command.response_representation = Google::Apis::SpannerV1::TestIamPermissionsResponse::Representation
2668
+ command.response_class = Google::Apis::SpannerV1::TestIamPermissionsResponse
2669
+ command.params['resource'] = resource unless resource.nil?
2670
+ command.query['fields'] = fields unless fields.nil?
2671
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2672
+ execute_or_queue_command(command, &block)
2673
+ end
2674
+
2675
+ # Starts asynchronous cancellation on a long-running operation. The server makes
2676
+ # a best effort to cancel the operation, but success is not guaranteed. If the
2677
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
2678
+ # Clients can use Operations.GetOperation or other methods to check whether the
2679
+ # cancellation succeeded or whether the operation completed despite cancellation.
2680
+ # On successful cancellation, the operation is not deleted; instead, it becomes
2681
+ # an operation with an Operation.error value with a google.rpc.Status.code of `1`
2682
+ # , corresponding to `Code.CANCELLED`.
2683
+ # @param [String] name
2684
+ # The name of the operation resource to be cancelled.
2685
+ # @param [String] fields
2686
+ # Selector specifying which fields to include in a partial response.
2687
+ # @param [String] quota_user
2688
+ # Available to use for quota purposes for server-side applications. Can be any
2689
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2690
+ # @param [Google::Apis::RequestOptions] options
2691
+ # Request-specific options
2692
+ #
2693
+ # @yield [result, err] Result & error if block supplied
2694
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
2695
+ # @yieldparam err [StandardError] error object if request failed
2696
+ #
2697
+ # @return [Google::Apis::SpannerV1::Empty]
2698
+ #
2699
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2700
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2701
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2702
+ def cancel_project_instance_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
2703
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
2704
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
2705
+ command.response_class = Google::Apis::SpannerV1::Empty
2706
+ command.params['name'] = name unless name.nil?
2707
+ command.query['fields'] = fields unless fields.nil?
2708
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2709
+ execute_or_queue_command(command, &block)
2710
+ end
2711
+
2712
+ # Deletes a long-running operation. This method indicates that the client is no
2713
+ # longer interested in the operation result. It does not cancel the operation.
2714
+ # If the server doesn't support this method, it returns `google.rpc.Code.
2715
+ # UNIMPLEMENTED`.
2716
+ # @param [String] name
2717
+ # The name of the operation resource to be deleted.
2718
+ # @param [String] fields
2719
+ # Selector specifying which fields to include in a partial response.
2720
+ # @param [String] quota_user
2721
+ # Available to use for quota purposes for server-side applications. Can be any
2722
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2723
+ # @param [Google::Apis::RequestOptions] options
2724
+ # Request-specific options
2725
+ #
2726
+ # @yield [result, err] Result & error if block supplied
2727
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
2728
+ # @yieldparam err [StandardError] error object if request failed
2729
+ #
2730
+ # @return [Google::Apis::SpannerV1::Empty]
2731
+ #
2732
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2733
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2734
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2735
+ def delete_project_instance_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
2736
+ command = make_simple_command(:delete, 'v1/{+name}', options)
2737
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
2738
+ command.response_class = Google::Apis::SpannerV1::Empty
2739
+ command.params['name'] = name unless name.nil?
2740
+ command.query['fields'] = fields unless fields.nil?
2741
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2742
+ execute_or_queue_command(command, &block)
2743
+ end
2744
+
2745
+ # Gets the latest state of a long-running operation. Clients can use this method
2746
+ # to poll the operation result at intervals as recommended by the API service.
2747
+ # @param [String] name
2748
+ # The name of the operation resource.
2749
+ # @param [String] fields
2750
+ # Selector specifying which fields to include in a partial response.
2751
+ # @param [String] quota_user
2752
+ # Available to use for quota purposes for server-side applications. Can be any
2753
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2754
+ # @param [Google::Apis::RequestOptions] options
2755
+ # Request-specific options
2756
+ #
2757
+ # @yield [result, err] Result & error if block supplied
2758
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
2759
+ # @yieldparam err [StandardError] error object if request failed
2760
+ #
2761
+ # @return [Google::Apis::SpannerV1::Operation]
2762
+ #
2763
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2764
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2765
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2766
+ def get_project_instance_database_operation(name, fields: nil, quota_user: nil, options: nil, &block)
2767
+ command = make_simple_command(:get, 'v1/{+name}', options)
2768
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
2769
+ command.response_class = Google::Apis::SpannerV1::Operation
2770
+ command.params['name'] = name unless name.nil?
2771
+ command.query['fields'] = fields unless fields.nil?
2772
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2773
+ execute_or_queue_command(command, &block)
2774
+ end
2775
+
2776
+ # Lists operations that match the specified filter in the request. If the server
2777
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
2778
+ # @param [String] name
2779
+ # The name of the operation's parent resource.
2780
+ # @param [String] filter
2781
+ # The standard list filter.
2782
+ # @param [Fixnum] page_size
2783
+ # The standard list page size.
2784
+ # @param [String] page_token
2785
+ # The standard list page token.
2786
+ # @param [String] fields
2787
+ # Selector specifying which fields to include in a partial response.
2788
+ # @param [String] quota_user
2789
+ # Available to use for quota purposes for server-side applications. Can be any
2790
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2791
+ # @param [Google::Apis::RequestOptions] options
2792
+ # Request-specific options
2793
+ #
2794
+ # @yield [result, err] Result & error if block supplied
2795
+ # @yieldparam result [Google::Apis::SpannerV1::ListOperationsResponse] parsed result object
2796
+ # @yieldparam err [StandardError] error object if request failed
2797
+ #
2798
+ # @return [Google::Apis::SpannerV1::ListOperationsResponse]
2799
+ #
2800
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2801
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2802
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2803
+ def list_project_instance_database_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2804
+ command = make_simple_command(:get, 'v1/{+name}', options)
2805
+ command.response_representation = Google::Apis::SpannerV1::ListOperationsResponse::Representation
2806
+ command.response_class = Google::Apis::SpannerV1::ListOperationsResponse
2807
+ command.params['name'] = name unless name.nil?
2808
+ command.query['filter'] = filter unless filter.nil?
2809
+ command.query['pageSize'] = page_size unless page_size.nil?
2810
+ command.query['pageToken'] = page_token unless page_token.nil?
2811
+ command.query['fields'] = fields unless fields.nil?
2812
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2813
+ execute_or_queue_command(command, &block)
2814
+ end
2815
+
2816
+ # Handles a single message from the client and returns the result as a stream.
2817
+ # The server will interpret the message frame and respond with message frames to
2818
+ # the client.
2819
+ # @param [String] name
2820
+ # Required. The database session in which the adapter request is processed.
2821
+ # @param [Google::Apis::SpannerV1::AdaptMessageRequest] adapt_message_request_object
2822
+ # @param [String] fields
2823
+ # Selector specifying which fields to include in a partial response.
2824
+ # @param [String] quota_user
2825
+ # Available to use for quota purposes for server-side applications. Can be any
2826
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2827
+ # @param [Google::Apis::RequestOptions] options
2828
+ # Request-specific options
2829
+ #
2830
+ # @yield [result, err] Result & error if block supplied
2831
+ # @yieldparam result [Google::Apis::SpannerV1::AdaptMessageResponse] parsed result object
2832
+ # @yieldparam err [StandardError] error object if request failed
2833
+ #
2834
+ # @return [Google::Apis::SpannerV1::AdaptMessageResponse]
2835
+ #
2836
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2837
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2838
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2839
+ def adapt_session_message(name, adapt_message_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2840
+ command = make_simple_command(:post, 'v1/{+name}:adaptMessage', options)
2841
+ command.request_representation = Google::Apis::SpannerV1::AdaptMessageRequest::Representation
2842
+ command.request_object = adapt_message_request_object
2843
+ command.response_representation = Google::Apis::SpannerV1::AdaptMessageResponse::Representation
2844
+ command.response_class = Google::Apis::SpannerV1::AdaptMessageResponse
2845
+ command.params['name'] = name unless name.nil?
2846
+ command.query['fields'] = fields unless fields.nil?
2847
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2848
+ execute_or_queue_command(command, &block)
2849
+ end
2850
+
2851
+ # Creates a new session to be used for requests made by the adapter. A session
2852
+ # identifies a specific incarnation of a database resource and is meant to be
2853
+ # reused across many `AdaptMessage` calls.
2854
+ # @param [String] parent
2855
+ # Required. The database in which the new session is created.
2856
+ # @param [Google::Apis::SpannerV1::AdapterSession] adapter_session_object
2857
+ # @param [String] fields
2858
+ # Selector specifying which fields to include in a partial response.
2859
+ # @param [String] quota_user
2860
+ # Available to use for quota purposes for server-side applications. Can be any
2861
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2862
+ # @param [Google::Apis::RequestOptions] options
2863
+ # Request-specific options
2864
+ #
2865
+ # @yield [result, err] Result & error if block supplied
2866
+ # @yieldparam result [Google::Apis::SpannerV1::AdapterSession] parsed result object
2867
+ # @yieldparam err [StandardError] error object if request failed
2868
+ #
2869
+ # @return [Google::Apis::SpannerV1::AdapterSession]
2870
+ #
2871
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2872
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2873
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2874
+ def adapter_project_instance_database_session(parent, adapter_session_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2875
+ command = make_simple_command(:post, 'v1/{+parent}/sessions:adapter', options)
2876
+ command.request_representation = Google::Apis::SpannerV1::AdapterSession::Representation
2877
+ command.request_object = adapter_session_object
2878
+ command.response_representation = Google::Apis::SpannerV1::AdapterSession::Representation
2879
+ command.response_class = Google::Apis::SpannerV1::AdapterSession
2880
+ command.params['parent'] = parent unless parent.nil?
2881
+ command.query['fields'] = fields unless fields.nil?
2882
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2883
+ execute_or_queue_command(command, &block)
2884
+ end
2885
+
2886
+ # Creates multiple new sessions. This API can be used to initialize a session
2887
+ # cache on the clients. See https://goo.gl/TgSFN2 for best practices on session
2888
+ # cache management.
2889
+ # @param [String] database
2890
+ # Required. The database in which the new sessions are created.
2891
+ # @param [Google::Apis::SpannerV1::BatchCreateSessionsRequest] batch_create_sessions_request_object
2892
+ # @param [String] fields
2893
+ # Selector specifying which fields to include in a partial response.
2894
+ # @param [String] quota_user
2895
+ # Available to use for quota purposes for server-side applications. Can be any
2896
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2897
+ # @param [Google::Apis::RequestOptions] options
2898
+ # Request-specific options
2899
+ #
2900
+ # @yield [result, err] Result & error if block supplied
2901
+ # @yieldparam result [Google::Apis::SpannerV1::BatchCreateSessionsResponse] parsed result object
2902
+ # @yieldparam err [StandardError] error object if request failed
2903
+ #
2904
+ # @return [Google::Apis::SpannerV1::BatchCreateSessionsResponse]
2905
+ #
2906
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2907
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2908
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2909
+ def batch_create_sessions(database, batch_create_sessions_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2910
+ command = make_simple_command(:post, 'v1/{+database}/sessions:batchCreate', options)
2911
+ command.request_representation = Google::Apis::SpannerV1::BatchCreateSessionsRequest::Representation
2912
+ command.request_object = batch_create_sessions_request_object
2913
+ command.response_representation = Google::Apis::SpannerV1::BatchCreateSessionsResponse::Representation
1975
2914
  command.response_class = Google::Apis::SpannerV1::BatchCreateSessionsResponse
1976
2915
  command.params['database'] = database unless database.nil?
1977
2916
  command.query['fields'] = fields unless fields.nil?
@@ -1979,11 +2918,407 @@ module Google
1979
2918
  execute_or_queue_command(command, &block)
1980
2919
  end
1981
2920
 
1982
- # Begins a new transaction. This step can often be skipped: Read, ExecuteSql and
1983
- # Commit can begin a new transaction as a side-effect.
2921
+ # Batches the supplied mutation groups in a collection of efficient transactions.
2922
+ # All mutations in a group are committed atomically. However, mutations across
2923
+ # groups can be committed non-atomically in an unspecified order and thus, they
2924
+ # must be independent of each other. Partial failure is possible, i.e., some
2925
+ # groups may have been committed successfully, while some may have failed. The
2926
+ # results of individual batches are streamed into the response as the batches
2927
+ # are applied. BatchWrite requests are not replay protected, meaning that each
2928
+ # mutation group may be applied more than once. Replays of non-idempotent
2929
+ # mutations may have undesirable effects. For example, replays of an insert
2930
+ # mutation may produce an already exists error or if you use generated or commit
2931
+ # timestamp-based keys, it may result in additional rows being added to the
2932
+ # mutation's table. We recommend structuring your mutation groups to be
2933
+ # idempotent to avoid this issue.
2934
+ # @param [String] session
2935
+ # Required. The session in which the batch request is to be run.
2936
+ # @param [Google::Apis::SpannerV1::BatchWriteRequest] batch_write_request_object
2937
+ # @param [String] fields
2938
+ # Selector specifying which fields to include in a partial response.
2939
+ # @param [String] quota_user
2940
+ # Available to use for quota purposes for server-side applications. Can be any
2941
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2942
+ # @param [Google::Apis::RequestOptions] options
2943
+ # Request-specific options
2944
+ #
2945
+ # @yield [result, err] Result & error if block supplied
2946
+ # @yieldparam result [Google::Apis::SpannerV1::BatchWriteResponse] parsed result object
2947
+ # @yieldparam err [StandardError] error object if request failed
2948
+ #
2949
+ # @return [Google::Apis::SpannerV1::BatchWriteResponse]
2950
+ #
2951
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2952
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2953
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2954
+ def batch_session_write(session, batch_write_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2955
+ command = make_simple_command(:post, 'v1/{+session}:batchWrite', options)
2956
+ command.request_representation = Google::Apis::SpannerV1::BatchWriteRequest::Representation
2957
+ command.request_object = batch_write_request_object
2958
+ command.response_representation = Google::Apis::SpannerV1::BatchWriteResponse::Representation
2959
+ command.response_class = Google::Apis::SpannerV1::BatchWriteResponse
2960
+ command.params['session'] = session unless session.nil?
2961
+ command.query['fields'] = fields unless fields.nil?
2962
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2963
+ execute_or_queue_command(command, &block)
2964
+ end
2965
+
2966
+ # Begins a new transaction. This step can often be skipped: Read, ExecuteSql and
2967
+ # Commit can begin a new transaction as a side-effect.
2968
+ # @param [String] session
2969
+ # Required. The session in which the transaction runs.
2970
+ # @param [Google::Apis::SpannerV1::BeginTransactionRequest] begin_transaction_request_object
2971
+ # @param [String] fields
2972
+ # Selector specifying which fields to include in a partial response.
2973
+ # @param [String] quota_user
2974
+ # Available to use for quota purposes for server-side applications. Can be any
2975
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
2976
+ # @param [Google::Apis::RequestOptions] options
2977
+ # Request-specific options
2978
+ #
2979
+ # @yield [result, err] Result & error if block supplied
2980
+ # @yieldparam result [Google::Apis::SpannerV1::Transaction] parsed result object
2981
+ # @yieldparam err [StandardError] error object if request failed
2982
+ #
2983
+ # @return [Google::Apis::SpannerV1::Transaction]
2984
+ #
2985
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2986
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2987
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
2988
+ def begin_session_transaction(session, begin_transaction_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2989
+ command = make_simple_command(:post, 'v1/{+session}:beginTransaction', options)
2990
+ command.request_representation = Google::Apis::SpannerV1::BeginTransactionRequest::Representation
2991
+ command.request_object = begin_transaction_request_object
2992
+ command.response_representation = Google::Apis::SpannerV1::Transaction::Representation
2993
+ command.response_class = Google::Apis::SpannerV1::Transaction
2994
+ command.params['session'] = session unless session.nil?
2995
+ command.query['fields'] = fields unless fields.nil?
2996
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
2997
+ execute_or_queue_command(command, &block)
2998
+ end
2999
+
3000
+ # Commits a transaction. The request includes the mutations to be applied to
3001
+ # rows in the database. `Commit` might return an `ABORTED` error. This can occur
3002
+ # at any time; commonly, the cause is conflicts with concurrent transactions.
3003
+ # However, it can also happen for a variety of other reasons. If `Commit`
3004
+ # returns `ABORTED`, the caller should re-attempt the transaction from the
3005
+ # beginning, re-using the same session. On very rare occasions, `Commit` might
3006
+ # return `UNKNOWN`. This can happen, for example, if the client job experiences
3007
+ # a 1+ hour networking failure. At that point, Cloud Spanner has lost track of
3008
+ # the transaction outcome and we recommend that you perform another read from
3009
+ # the database to see the state of things as they are now.
3010
+ # @param [String] session
3011
+ # Required. The session in which the transaction to be committed is running.
3012
+ # @param [Google::Apis::SpannerV1::CommitRequest] commit_request_object
3013
+ # @param [String] fields
3014
+ # Selector specifying which fields to include in a partial response.
3015
+ # @param [String] quota_user
3016
+ # Available to use for quota purposes for server-side applications. Can be any
3017
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3018
+ # @param [Google::Apis::RequestOptions] options
3019
+ # Request-specific options
3020
+ #
3021
+ # @yield [result, err] Result & error if block supplied
3022
+ # @yieldparam result [Google::Apis::SpannerV1::CommitResponse] parsed result object
3023
+ # @yieldparam err [StandardError] error object if request failed
3024
+ #
3025
+ # @return [Google::Apis::SpannerV1::CommitResponse]
3026
+ #
3027
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3028
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3029
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3030
+ def commit_session(session, commit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3031
+ command = make_simple_command(:post, 'v1/{+session}:commit', options)
3032
+ command.request_representation = Google::Apis::SpannerV1::CommitRequest::Representation
3033
+ command.request_object = commit_request_object
3034
+ command.response_representation = Google::Apis::SpannerV1::CommitResponse::Representation
3035
+ command.response_class = Google::Apis::SpannerV1::CommitResponse
3036
+ command.params['session'] = session unless session.nil?
3037
+ command.query['fields'] = fields unless fields.nil?
3038
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3039
+ execute_or_queue_command(command, &block)
3040
+ end
3041
+
3042
+ # Creates a new session. A session can be used to perform transactions that read
3043
+ # and/or modify data in a Cloud Spanner database. Sessions are meant to be
3044
+ # reused for many consecutive transactions. Sessions can only execute one
3045
+ # transaction at a time. To execute multiple concurrent read-write/write-only
3046
+ # transactions, create multiple sessions. Note that standalone reads and queries
3047
+ # use a transaction internally, and count toward the one transaction limit.
3048
+ # Active sessions use additional server resources, so it is a good idea to
3049
+ # delete idle and unneeded sessions. Aside from explicit deletes, Cloud Spanner
3050
+ # may delete sessions for which no operations are sent for more than an hour. If
3051
+ # a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can be
3052
+ # kept alive by sending a trivial SQL query periodically, e.g., `"SELECT 1"`.
3053
+ # @param [String] database
3054
+ # Required. The database in which the new session is created.
3055
+ # @param [Google::Apis::SpannerV1::CreateSessionRequest] create_session_request_object
3056
+ # @param [String] fields
3057
+ # Selector specifying which fields to include in a partial response.
3058
+ # @param [String] quota_user
3059
+ # Available to use for quota purposes for server-side applications. Can be any
3060
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3061
+ # @param [Google::Apis::RequestOptions] options
3062
+ # Request-specific options
3063
+ #
3064
+ # @yield [result, err] Result & error if block supplied
3065
+ # @yieldparam result [Google::Apis::SpannerV1::Session] parsed result object
3066
+ # @yieldparam err [StandardError] error object if request failed
3067
+ #
3068
+ # @return [Google::Apis::SpannerV1::Session]
3069
+ #
3070
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3071
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3072
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3073
+ def create_project_instance_database_session(database, create_session_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3074
+ command = make_simple_command(:post, 'v1/{+database}/sessions', options)
3075
+ command.request_representation = Google::Apis::SpannerV1::CreateSessionRequest::Representation
3076
+ command.request_object = create_session_request_object
3077
+ command.response_representation = Google::Apis::SpannerV1::Session::Representation
3078
+ command.response_class = Google::Apis::SpannerV1::Session
3079
+ command.params['database'] = database unless database.nil?
3080
+ command.query['fields'] = fields unless fields.nil?
3081
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3082
+ execute_or_queue_command(command, &block)
3083
+ end
3084
+
3085
+ # Ends a session, releasing server resources associated with it. This will
3086
+ # asynchronously trigger cancellation of any operations that are running with
3087
+ # this session.
3088
+ # @param [String] name
3089
+ # Required. The name of the session to delete.
3090
+ # @param [String] fields
3091
+ # Selector specifying which fields to include in a partial response.
3092
+ # @param [String] quota_user
3093
+ # Available to use for quota purposes for server-side applications. Can be any
3094
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3095
+ # @param [Google::Apis::RequestOptions] options
3096
+ # Request-specific options
3097
+ #
3098
+ # @yield [result, err] Result & error if block supplied
3099
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
3100
+ # @yieldparam err [StandardError] error object if request failed
3101
+ #
3102
+ # @return [Google::Apis::SpannerV1::Empty]
3103
+ #
3104
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3105
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3106
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3107
+ def delete_project_instance_database_session(name, fields: nil, quota_user: nil, options: nil, &block)
3108
+ command = make_simple_command(:delete, 'v1/{+name}', options)
3109
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
3110
+ command.response_class = Google::Apis::SpannerV1::Empty
3111
+ command.params['name'] = name unless name.nil?
3112
+ command.query['fields'] = fields unless fields.nil?
3113
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3114
+ execute_or_queue_command(command, &block)
3115
+ end
3116
+
3117
+ # Executes a batch of SQL DML statements. This method allows many statements to
3118
+ # be run with lower latency than submitting them sequentially with ExecuteSql.
3119
+ # Statements are executed in sequential order. A request can succeed even if a
3120
+ # statement fails. The ExecuteBatchDmlResponse.status field in the response
3121
+ # provides information about the statement that failed. Clients must inspect
3122
+ # this field to determine whether an error occurred. Execution stops after the
3123
+ # first failed statement; the remaining statements are not executed.
3124
+ # @param [String] session
3125
+ # Required. The session in which the DML statements should be performed.
3126
+ # @param [Google::Apis::SpannerV1::ExecuteBatchDmlRequest] execute_batch_dml_request_object
3127
+ # @param [String] fields
3128
+ # Selector specifying which fields to include in a partial response.
3129
+ # @param [String] quota_user
3130
+ # Available to use for quota purposes for server-side applications. Can be any
3131
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3132
+ # @param [Google::Apis::RequestOptions] options
3133
+ # Request-specific options
3134
+ #
3135
+ # @yield [result, err] Result & error if block supplied
3136
+ # @yieldparam result [Google::Apis::SpannerV1::ExecuteBatchDmlResponse] parsed result object
3137
+ # @yieldparam err [StandardError] error object if request failed
3138
+ #
3139
+ # @return [Google::Apis::SpannerV1::ExecuteBatchDmlResponse]
3140
+ #
3141
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3142
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3143
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3144
+ def execute_session_batch_dml(session, execute_batch_dml_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3145
+ command = make_simple_command(:post, 'v1/{+session}:executeBatchDml', options)
3146
+ command.request_representation = Google::Apis::SpannerV1::ExecuteBatchDmlRequest::Representation
3147
+ command.request_object = execute_batch_dml_request_object
3148
+ command.response_representation = Google::Apis::SpannerV1::ExecuteBatchDmlResponse::Representation
3149
+ command.response_class = Google::Apis::SpannerV1::ExecuteBatchDmlResponse
3150
+ command.params['session'] = session unless session.nil?
3151
+ command.query['fields'] = fields unless fields.nil?
3152
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3153
+ execute_or_queue_command(command, &block)
3154
+ end
3155
+
3156
+ # Executes an SQL statement, returning all results in a single reply. This
3157
+ # method cannot be used to return a result set larger than 10 MiB; if the query
3158
+ # yields more data than that, the query fails with a `FAILED_PRECONDITION` error.
3159
+ # Operations inside read-write transactions might return `ABORTED`. If this
3160
+ # occurs, the application should restart the transaction from the beginning. See
3161
+ # Transaction for more details. Larger result sets can be fetched in streaming
3162
+ # fashion by calling ExecuteStreamingSql instead. The query string can be SQL or
3163
+ # [Graph Query Language (GQL)](https://cloud.google.com/spanner/docs/reference/
3164
+ # standard-sql/graph-intro).
3165
+ # @param [String] session
3166
+ # Required. The session in which the SQL query should be performed.
3167
+ # @param [Google::Apis::SpannerV1::ExecuteSqlRequest] execute_sql_request_object
3168
+ # @param [String] fields
3169
+ # Selector specifying which fields to include in a partial response.
3170
+ # @param [String] quota_user
3171
+ # Available to use for quota purposes for server-side applications. Can be any
3172
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3173
+ # @param [Google::Apis::RequestOptions] options
3174
+ # Request-specific options
3175
+ #
3176
+ # @yield [result, err] Result & error if block supplied
3177
+ # @yieldparam result [Google::Apis::SpannerV1::ResultSet] parsed result object
3178
+ # @yieldparam err [StandardError] error object if request failed
3179
+ #
3180
+ # @return [Google::Apis::SpannerV1::ResultSet]
3181
+ #
3182
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3183
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3184
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3185
+ def execute_session_sql(session, execute_sql_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3186
+ command = make_simple_command(:post, 'v1/{+session}:executeSql', options)
3187
+ command.request_representation = Google::Apis::SpannerV1::ExecuteSqlRequest::Representation
3188
+ command.request_object = execute_sql_request_object
3189
+ command.response_representation = Google::Apis::SpannerV1::ResultSet::Representation
3190
+ command.response_class = Google::Apis::SpannerV1::ResultSet
3191
+ command.params['session'] = session unless session.nil?
3192
+ command.query['fields'] = fields unless fields.nil?
3193
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3194
+ execute_or_queue_command(command, &block)
3195
+ end
3196
+
3197
+ # Like ExecuteSql, except returns the result set as a stream. Unlike ExecuteSql,
3198
+ # there is no limit on the size of the returned result set. However, no
3199
+ # individual row in the result set can exceed 100 MiB, and no column value can
3200
+ # exceed 10 MiB. The query string can be SQL or [Graph Query Language (GQL)](
3201
+ # https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro).
3202
+ # @param [String] session
3203
+ # Required. The session in which the SQL query should be performed.
3204
+ # @param [Google::Apis::SpannerV1::ExecuteSqlRequest] execute_sql_request_object
3205
+ # @param [String] fields
3206
+ # Selector specifying which fields to include in a partial response.
3207
+ # @param [String] quota_user
3208
+ # Available to use for quota purposes for server-side applications. Can be any
3209
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3210
+ # @param [Google::Apis::RequestOptions] options
3211
+ # Request-specific options
3212
+ #
3213
+ # @yield [result, err] Result & error if block supplied
3214
+ # @yieldparam result [Google::Apis::SpannerV1::PartialResultSet] parsed result object
3215
+ # @yieldparam err [StandardError] error object if request failed
3216
+ #
3217
+ # @return [Google::Apis::SpannerV1::PartialResultSet]
3218
+ #
3219
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3220
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3221
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3222
+ def execute_project_instance_database_session_streaming_sql(session, execute_sql_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3223
+ command = make_simple_command(:post, 'v1/{+session}:executeStreamingSql', options)
3224
+ command.request_representation = Google::Apis::SpannerV1::ExecuteSqlRequest::Representation
3225
+ command.request_object = execute_sql_request_object
3226
+ command.response_representation = Google::Apis::SpannerV1::PartialResultSet::Representation
3227
+ command.response_class = Google::Apis::SpannerV1::PartialResultSet
3228
+ command.params['session'] = session unless session.nil?
3229
+ command.query['fields'] = fields unless fields.nil?
3230
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3231
+ execute_or_queue_command(command, &block)
3232
+ end
3233
+
3234
+ # Gets a session. Returns `NOT_FOUND` if the session does not exist. This is
3235
+ # mainly useful for determining whether a session is still alive.
3236
+ # @param [String] name
3237
+ # Required. The name of the session to retrieve.
3238
+ # @param [String] fields
3239
+ # Selector specifying which fields to include in a partial response.
3240
+ # @param [String] quota_user
3241
+ # Available to use for quota purposes for server-side applications. Can be any
3242
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3243
+ # @param [Google::Apis::RequestOptions] options
3244
+ # Request-specific options
3245
+ #
3246
+ # @yield [result, err] Result & error if block supplied
3247
+ # @yieldparam result [Google::Apis::SpannerV1::Session] parsed result object
3248
+ # @yieldparam err [StandardError] error object if request failed
3249
+ #
3250
+ # @return [Google::Apis::SpannerV1::Session]
3251
+ #
3252
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3253
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3254
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3255
+ def get_project_instance_database_session(name, fields: nil, quota_user: nil, options: nil, &block)
3256
+ command = make_simple_command(:get, 'v1/{+name}', options)
3257
+ command.response_representation = Google::Apis::SpannerV1::Session::Representation
3258
+ command.response_class = Google::Apis::SpannerV1::Session
3259
+ command.params['name'] = name unless name.nil?
3260
+ command.query['fields'] = fields unless fields.nil?
3261
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3262
+ execute_or_queue_command(command, &block)
3263
+ end
3264
+
3265
+ # Lists all sessions in a given database.
3266
+ # @param [String] database
3267
+ # Required. The database in which to list sessions.
3268
+ # @param [String] filter
3269
+ # An expression for filtering the results of the request. Filter rules are case
3270
+ # insensitive. The fields eligible for filtering are: * `labels.key` where key
3271
+ # is the name of a label Some examples of using filters are: * `labels.env:*` -->
3272
+ # The session has the label "env". * `labels.env:dev` --> The session has the
3273
+ # label "env" and the value of the label contains the string "dev".
3274
+ # @param [Fixnum] page_size
3275
+ # Number of sessions to be returned in the response. If 0 or less, defaults to
3276
+ # the server's maximum allowed page size.
3277
+ # @param [String] page_token
3278
+ # If non-empty, `page_token` should contain a next_page_token from a previous
3279
+ # ListSessionsResponse.
3280
+ # @param [String] fields
3281
+ # Selector specifying which fields to include in a partial response.
3282
+ # @param [String] quota_user
3283
+ # Available to use for quota purposes for server-side applications. Can be any
3284
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3285
+ # @param [Google::Apis::RequestOptions] options
3286
+ # Request-specific options
3287
+ #
3288
+ # @yield [result, err] Result & error if block supplied
3289
+ # @yieldparam result [Google::Apis::SpannerV1::ListSessionsResponse] parsed result object
3290
+ # @yieldparam err [StandardError] error object if request failed
3291
+ #
3292
+ # @return [Google::Apis::SpannerV1::ListSessionsResponse]
3293
+ #
3294
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3295
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3296
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3297
+ def list_project_instance_database_sessions(database, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
3298
+ command = make_simple_command(:get, 'v1/{+database}/sessions', options)
3299
+ command.response_representation = Google::Apis::SpannerV1::ListSessionsResponse::Representation
3300
+ command.response_class = Google::Apis::SpannerV1::ListSessionsResponse
3301
+ command.params['database'] = database unless database.nil?
3302
+ command.query['filter'] = filter unless filter.nil?
3303
+ command.query['pageSize'] = page_size unless page_size.nil?
3304
+ command.query['pageToken'] = page_token unless page_token.nil?
3305
+ command.query['fields'] = fields unless fields.nil?
3306
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3307
+ execute_or_queue_command(command, &block)
3308
+ end
3309
+
3310
+ # Creates a set of partition tokens that can be used to execute a query
3311
+ # operation in parallel. Each of the returned partition tokens can be used by
3312
+ # ExecuteStreamingSql to specify a subset of the query result to read. The same
3313
+ # session and read-only transaction must be used by the PartitionQueryRequest
3314
+ # used to create the partition tokens and the ExecuteSqlRequests that use the
3315
+ # partition tokens. Partition tokens become invalid when the session used to
3316
+ # create them is deleted, is idle for too long, begins a new transaction, or
3317
+ # becomes too old. When any of these happen, it is not possible to resume the
3318
+ # query, and the whole operation must be restarted from the beginning.
1984
3319
  # @param [String] session
1985
- # Required. The session in which the transaction runs.
1986
- # @param [Google::Apis::SpannerV1::BeginTransactionRequest] begin_transaction_request_object
3320
+ # Required. The session used to create the partitions.
3321
+ # @param [Google::Apis::SpannerV1::PartitionQueryRequest] partition_query_request_object
1987
3322
  # @param [String] fields
1988
3323
  # Selector specifying which fields to include in a partial response.
1989
3324
  # @param [String] quota_user
@@ -1993,39 +3328,40 @@ module Google
1993
3328
  # Request-specific options
1994
3329
  #
1995
3330
  # @yield [result, err] Result & error if block supplied
1996
- # @yieldparam result [Google::Apis::SpannerV1::Transaction] parsed result object
3331
+ # @yieldparam result [Google::Apis::SpannerV1::PartitionResponse] parsed result object
1997
3332
  # @yieldparam err [StandardError] error object if request failed
1998
3333
  #
1999
- # @return [Google::Apis::SpannerV1::Transaction]
3334
+ # @return [Google::Apis::SpannerV1::PartitionResponse]
2000
3335
  #
2001
3336
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2002
3337
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2003
3338
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2004
- def begin_session_transaction(session, begin_transaction_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2005
- command = make_simple_command(:post, 'v1/{+session}:beginTransaction', options)
2006
- command.request_representation = Google::Apis::SpannerV1::BeginTransactionRequest::Representation
2007
- command.request_object = begin_transaction_request_object
2008
- command.response_representation = Google::Apis::SpannerV1::Transaction::Representation
2009
- command.response_class = Google::Apis::SpannerV1::Transaction
3339
+ def partition_session_query(session, partition_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3340
+ command = make_simple_command(:post, 'v1/{+session}:partitionQuery', options)
3341
+ command.request_representation = Google::Apis::SpannerV1::PartitionQueryRequest::Representation
3342
+ command.request_object = partition_query_request_object
3343
+ command.response_representation = Google::Apis::SpannerV1::PartitionResponse::Representation
3344
+ command.response_class = Google::Apis::SpannerV1::PartitionResponse
2010
3345
  command.params['session'] = session unless session.nil?
2011
3346
  command.query['fields'] = fields unless fields.nil?
2012
3347
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2013
3348
  execute_or_queue_command(command, &block)
2014
3349
  end
2015
3350
 
2016
- # Commits a transaction. The request includes the mutations to be applied to
2017
- # rows in the database. `Commit` might return an `ABORTED` error. This can occur
2018
- # at any time; commonly, the cause is conflicts with concurrent transactions.
2019
- # However, it can also happen for a variety of other reasons. If `Commit`
2020
- # returns `ABORTED`, the caller should re-attempt the transaction from the
2021
- # beginning, re-using the same session. On very rare occasions, `Commit` might
2022
- # return `UNKNOWN`. This can happen, for example, if the client job experiences
2023
- # a 1+ hour networking failure. At that point, Cloud Spanner has lost track of
2024
- # the transaction outcome and we recommend that you perform another read from
2025
- # the database to see the state of things as they are now.
3351
+ # Creates a set of partition tokens that can be used to execute a read operation
3352
+ # in parallel. Each of the returned partition tokens can be used by
3353
+ # StreamingRead to specify a subset of the read result to read. The same session
3354
+ # and read-only transaction must be used by the PartitionReadRequest used to
3355
+ # create the partition tokens and the ReadRequests that use the partition tokens.
3356
+ # There are no ordering guarantees on rows returned among the returned
3357
+ # partition tokens, or even within each individual StreamingRead call issued
3358
+ # with a partition_token. Partition tokens become invalid when the session used
3359
+ # to create them is deleted, is idle for too long, begins a new transaction, or
3360
+ # becomes too old. When any of these happen, it is not possible to resume the
3361
+ # read, and the whole operation must be restarted from the beginning.
2026
3362
  # @param [String] session
2027
- # Required. The session in which the transaction to be committed is running.
2028
- # @param [Google::Apis::SpannerV1::CommitRequest] commit_request_object
3363
+ # Required. The session used to create the partitions.
3364
+ # @param [Google::Apis::SpannerV1::PartitionReadRequest] partition_read_request_object
2029
3365
  # @param [String] fields
2030
3366
  # Selector specifying which fields to include in a partial response.
2031
3367
  # @param [String] quota_user
@@ -2035,40 +3371,37 @@ module Google
2035
3371
  # Request-specific options
2036
3372
  #
2037
3373
  # @yield [result, err] Result & error if block supplied
2038
- # @yieldparam result [Google::Apis::SpannerV1::CommitResponse] parsed result object
3374
+ # @yieldparam result [Google::Apis::SpannerV1::PartitionResponse] parsed result object
2039
3375
  # @yieldparam err [StandardError] error object if request failed
2040
3376
  #
2041
- # @return [Google::Apis::SpannerV1::CommitResponse]
3377
+ # @return [Google::Apis::SpannerV1::PartitionResponse]
2042
3378
  #
2043
3379
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2044
3380
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2045
3381
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2046
- def commit_session(session, commit_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2047
- command = make_simple_command(:post, 'v1/{+session}:commit', options)
2048
- command.request_representation = Google::Apis::SpannerV1::CommitRequest::Representation
2049
- command.request_object = commit_request_object
2050
- command.response_representation = Google::Apis::SpannerV1::CommitResponse::Representation
2051
- command.response_class = Google::Apis::SpannerV1::CommitResponse
3382
+ def partition_session_read(session, partition_read_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3383
+ command = make_simple_command(:post, 'v1/{+session}:partitionRead', options)
3384
+ command.request_representation = Google::Apis::SpannerV1::PartitionReadRequest::Representation
3385
+ command.request_object = partition_read_request_object
3386
+ command.response_representation = Google::Apis::SpannerV1::PartitionResponse::Representation
3387
+ command.response_class = Google::Apis::SpannerV1::PartitionResponse
2052
3388
  command.params['session'] = session unless session.nil?
2053
3389
  command.query['fields'] = fields unless fields.nil?
2054
3390
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2055
3391
  execute_or_queue_command(command, &block)
2056
3392
  end
2057
3393
 
2058
- # Creates a new session. A session can be used to perform transactions that read
2059
- # and/or modify data in a Cloud Spanner database. Sessions are meant to be
2060
- # reused for many consecutive transactions. Sessions can only execute one
2061
- # transaction at a time. To execute multiple concurrent read-write/write-only
2062
- # transactions, create multiple sessions. Note that standalone reads and queries
2063
- # use a transaction internally, and count toward the one transaction limit.
2064
- # Active sessions use additional server resources, so it is a good idea to
2065
- # delete idle and unneeded sessions. Aside from explicit deletes, Cloud Spanner
2066
- # may delete sessions for which no operations are sent for more than an hour. If
2067
- # a session is deleted, requests to it return `NOT_FOUND`. Idle sessions can be
2068
- # kept alive by sending a trivial SQL query periodically, e.g., `"SELECT 1"`.
2069
- # @param [String] database
2070
- # Required. The database in which the new session is created.
2071
- # @param [Google::Apis::SpannerV1::CreateSessionRequest] create_session_request_object
3394
+ # Reads rows from the database using key lookups and scans, as a simple key/
3395
+ # value style alternative to ExecuteSql. This method cannot be used to return a
3396
+ # result set larger than 10 MiB; if the read matches more data than that, the
3397
+ # read fails with a `FAILED_PRECONDITION` error. Reads inside read-write
3398
+ # transactions might return `ABORTED`. If this occurs, the application should
3399
+ # restart the transaction from the beginning. See Transaction for more details.
3400
+ # Larger result sets can be yielded in streaming fashion by calling
3401
+ # StreamingRead instead.
3402
+ # @param [String] session
3403
+ # Required. The session in which the read should be performed.
3404
+ # @param [Google::Apis::SpannerV1::ReadRequest] read_request_object
2072
3405
  # @param [String] fields
2073
3406
  # Selector specifying which fields to include in a partial response.
2074
3407
  # @param [String] quota_user
@@ -2078,31 +3411,34 @@ module Google
2078
3411
  # Request-specific options
2079
3412
  #
2080
3413
  # @yield [result, err] Result & error if block supplied
2081
- # @yieldparam result [Google::Apis::SpannerV1::Session] parsed result object
3414
+ # @yieldparam result [Google::Apis::SpannerV1::ResultSet] parsed result object
2082
3415
  # @yieldparam err [StandardError] error object if request failed
2083
3416
  #
2084
- # @return [Google::Apis::SpannerV1::Session]
3417
+ # @return [Google::Apis::SpannerV1::ResultSet]
2085
3418
  #
2086
3419
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2087
3420
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2088
3421
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2089
- def create_project_instance_database_session(database, create_session_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2090
- command = make_simple_command(:post, 'v1/{+database}/sessions', options)
2091
- command.request_representation = Google::Apis::SpannerV1::CreateSessionRequest::Representation
2092
- command.request_object = create_session_request_object
2093
- command.response_representation = Google::Apis::SpannerV1::Session::Representation
2094
- command.response_class = Google::Apis::SpannerV1::Session
2095
- command.params['database'] = database unless database.nil?
3422
+ def read_session(session, read_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3423
+ command = make_simple_command(:post, 'v1/{+session}:read', options)
3424
+ command.request_representation = Google::Apis::SpannerV1::ReadRequest::Representation
3425
+ command.request_object = read_request_object
3426
+ command.response_representation = Google::Apis::SpannerV1::ResultSet::Representation
3427
+ command.response_class = Google::Apis::SpannerV1::ResultSet
3428
+ command.params['session'] = session unless session.nil?
2096
3429
  command.query['fields'] = fields unless fields.nil?
2097
3430
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2098
3431
  execute_or_queue_command(command, &block)
2099
3432
  end
2100
3433
 
2101
- # Ends a session, releasing server resources associated with it. This will
2102
- # asynchronously trigger cancellation of any operations that are running with
2103
- # this session.
2104
- # @param [String] name
2105
- # Required. The name of the session to delete.
3434
+ # Rolls back a transaction, releasing any locks it holds. It is a good idea to
3435
+ # call this for any transaction that includes one or more Read or ExecuteSql
3436
+ # requests and ultimately decides not to commit. `Rollback` returns `OK` if it
3437
+ # successfully aborts the transaction, the transaction was already aborted, or
3438
+ # the transaction is not found. `Rollback` never returns `ABORTED`.
3439
+ # @param [String] session
3440
+ # Required. The session in which the transaction to roll back is running.
3441
+ # @param [Google::Apis::SpannerV1::RollbackRequest] rollback_request_object
2106
3442
  # @param [String] fields
2107
3443
  # Selector specifying which fields to include in a partial response.
2108
3444
  # @param [String] quota_user
@@ -2120,26 +3456,102 @@ module Google
2120
3456
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2121
3457
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2122
3458
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2123
- def delete_project_instance_database_session(name, fields: nil, quota_user: nil, options: nil, &block)
2124
- command = make_simple_command(:delete, 'v1/{+name}', options)
3459
+ def rollback_session(session, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3460
+ command = make_simple_command(:post, 'v1/{+session}:rollback', options)
3461
+ command.request_representation = Google::Apis::SpannerV1::RollbackRequest::Representation
3462
+ command.request_object = rollback_request_object
2125
3463
  command.response_representation = Google::Apis::SpannerV1::Empty::Representation
2126
3464
  command.response_class = Google::Apis::SpannerV1::Empty
2127
- command.params['name'] = name unless name.nil?
3465
+ command.params['session'] = session unless session.nil?
2128
3466
  command.query['fields'] = fields unless fields.nil?
2129
3467
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2130
3468
  execute_or_queue_command(command, &block)
2131
3469
  end
2132
3470
 
2133
- # Executes a batch of SQL DML statements. This method allows many statements to
2134
- # be run with lower latency than submitting them sequentially with ExecuteSql.
2135
- # Statements are executed in sequential order. A request can succeed even if a
2136
- # statement fails. The ExecuteBatchDmlResponse.status field in the response
2137
- # provides information about the statement that failed. Clients must inspect
2138
- # this field to determine whether an error occurred. Execution stops after the
2139
- # first failed statement; the remaining statements are not executed.
3471
+ # Like Read, except returns the result set as a stream. Unlike Read, there is no
3472
+ # limit on the size of the returned result set. However, no individual row in
3473
+ # the result set can exceed 100 MiB, and no column value can exceed 10 MiB.
2140
3474
  # @param [String] session
2141
- # Required. The session in which the DML statements should be performed.
2142
- # @param [Google::Apis::SpannerV1::ExecuteBatchDmlRequest] execute_batch_dml_request_object
3475
+ # Required. The session in which the read should be performed.
3476
+ # @param [Google::Apis::SpannerV1::ReadRequest] read_request_object
3477
+ # @param [String] fields
3478
+ # Selector specifying which fields to include in a partial response.
3479
+ # @param [String] quota_user
3480
+ # Available to use for quota purposes for server-side applications. Can be any
3481
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
3482
+ # @param [Google::Apis::RequestOptions] options
3483
+ # Request-specific options
3484
+ #
3485
+ # @yield [result, err] Result & error if block supplied
3486
+ # @yieldparam result [Google::Apis::SpannerV1::PartialResultSet] parsed result object
3487
+ # @yieldparam err [StandardError] error object if request failed
3488
+ #
3489
+ # @return [Google::Apis::SpannerV1::PartialResultSet]
3490
+ #
3491
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
3492
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
3493
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
3494
+ def streaming_project_instance_database_session_read(session, read_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3495
+ command = make_simple_command(:post, 'v1/{+session}:streamingRead', options)
3496
+ command.request_representation = Google::Apis::SpannerV1::ReadRequest::Representation
3497
+ command.request_object = read_request_object
3498
+ command.response_representation = Google::Apis::SpannerV1::PartialResultSet::Representation
3499
+ command.response_class = Google::Apis::SpannerV1::PartialResultSet
3500
+ command.params['session'] = session unless session.nil?
3501
+ command.query['fields'] = fields unless fields.nil?
3502
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
3503
+ execute_or_queue_command(command, &block)
3504
+ end
3505
+
3506
+ # Lists instance partition long-running operations in the given instance. An
3507
+ # instance partition operation has a name of the form `projects//instances//
3508
+ # instancePartitions//operations/`. The long-running operation metadata field
3509
+ # type `metadata.type_url` describes the type of the metadata. Operations
3510
+ # returned include those that have completed/failed/canceled within the last 7
3511
+ # days, and pending operations. Operations returned are ordered by `operation.
3512
+ # metadata.value.start_time` in descending order starting from the most recently
3513
+ # started operation. Authorization requires `spanner.instancePartitionOperations.
3514
+ # list` permission on the resource parent.
3515
+ # @param [String] parent
3516
+ # Required. The parent instance of the instance partition operations. Values are
3517
+ # of the form `projects//instances/`.
3518
+ # @param [String] filter
3519
+ # Optional. An expression that filters the list of returned operations. A filter
3520
+ # expression consists of a field name, a comparison operator, and a value for
3521
+ # filtering. The value must be a string, a number, or a boolean. The comparison
3522
+ # operator must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`. Colon `:` is
3523
+ # the contains operator. Filter rules are not case sensitive. The following
3524
+ # fields in the Operation are eligible for filtering: * `name` - The name of the
3525
+ # long-running operation * `done` - False if the operation is in progress, else
3526
+ # true. * `metadata.@type` - the type of metadata. For example, the type string
3527
+ # for CreateInstancePartitionMetadata is `type.googleapis.com/google.spanner.
3528
+ # admin.instance.v1.CreateInstancePartitionMetadata`. * `metadata.` - any field
3529
+ # in metadata.value. `metadata.@type` must be specified first, if filtering on
3530
+ # metadata fields. * `error` - Error associated with the long-running operation.
3531
+ # * `response.@type` - the type of response. * `response.` - any field in
3532
+ # response.value. You can combine multiple expressions by enclosing each
3533
+ # expression in parentheses. By default, expressions are combined with AND logic.
3534
+ # However, you can specify AND, OR, and NOT logic explicitly. Here are a few
3535
+ # examples: * `done:true` - The operation is complete. * `(metadata.@type=` \ `
3536
+ # type.googleapis.com/google.spanner.admin.instance.v1.
3537
+ # CreateInstancePartitionMetadata) AND` \ `(metadata.instance_partition.name:
3538
+ # custom-instance-partition) AND` \ `(metadata.start_time < \"2021-03-28T14:50:
3539
+ # 00Z\") AND` \ `(error:*)` - Return operations where: * The operation's
3540
+ # metadata type is CreateInstancePartitionMetadata. * The instance partition
3541
+ # name contains "custom-instance-partition". * The operation started before 2021-
3542
+ # 03-28T14:50:00Z. * The operation resulted in an error.
3543
+ # @param [String] instance_partition_deadline
3544
+ # Optional. Deadline used while retrieving metadata for instance partition
3545
+ # operations. Instance partitions whose operation metadata cannot be retrieved
3546
+ # within this deadline will be added to unreachable_instance_partitions in
3547
+ # ListInstancePartitionOperationsResponse.
3548
+ # @param [Fixnum] page_size
3549
+ # Optional. Number of operations to be returned in the response. If 0 or less,
3550
+ # defaults to the server's maximum allowed page size.
3551
+ # @param [String] page_token
3552
+ # Optional. If non-empty, `page_token` should contain a next_page_token from a
3553
+ # previous ListInstancePartitionOperationsResponse to the same `parent` and with
3554
+ # the same `filter`.
2143
3555
  # @param [String] fields
2144
3556
  # Selector specifying which fields to include in a partial response.
2145
3557
  # @param [String] quota_user
@@ -2149,36 +3561,50 @@ module Google
2149
3561
  # Request-specific options
2150
3562
  #
2151
3563
  # @yield [result, err] Result & error if block supplied
2152
- # @yieldparam result [Google::Apis::SpannerV1::ExecuteBatchDmlResponse] parsed result object
3564
+ # @yieldparam result [Google::Apis::SpannerV1::ListInstancePartitionOperationsResponse] parsed result object
2153
3565
  # @yieldparam err [StandardError] error object if request failed
2154
3566
  #
2155
- # @return [Google::Apis::SpannerV1::ExecuteBatchDmlResponse]
3567
+ # @return [Google::Apis::SpannerV1::ListInstancePartitionOperationsResponse]
2156
3568
  #
2157
3569
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2158
3570
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2159
3571
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2160
- def execute_session_batch_dml(session, execute_batch_dml_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2161
- command = make_simple_command(:post, 'v1/{+session}:executeBatchDml', options)
2162
- command.request_representation = Google::Apis::SpannerV1::ExecuteBatchDmlRequest::Representation
2163
- command.request_object = execute_batch_dml_request_object
2164
- command.response_representation = Google::Apis::SpannerV1::ExecuteBatchDmlResponse::Representation
2165
- command.response_class = Google::Apis::SpannerV1::ExecuteBatchDmlResponse
2166
- command.params['session'] = session unless session.nil?
3572
+ def list_project_instance_single_instance_partition_operations(parent, filter: nil, instance_partition_deadline: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
3573
+ command = make_simple_command(:get, 'v1/{+parent}/instancePartitionOperations', options)
3574
+ command.response_representation = Google::Apis::SpannerV1::ListInstancePartitionOperationsResponse::Representation
3575
+ command.response_class = Google::Apis::SpannerV1::ListInstancePartitionOperationsResponse
3576
+ command.params['parent'] = parent unless parent.nil?
3577
+ command.query['filter'] = filter unless filter.nil?
3578
+ command.query['instancePartitionDeadline'] = instance_partition_deadline unless instance_partition_deadline.nil?
3579
+ command.query['pageSize'] = page_size unless page_size.nil?
3580
+ command.query['pageToken'] = page_token unless page_token.nil?
2167
3581
  command.query['fields'] = fields unless fields.nil?
2168
3582
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2169
3583
  execute_or_queue_command(command, &block)
2170
3584
  end
2171
3585
 
2172
- # Executes an SQL statement, returning all results in a single reply. This
2173
- # method cannot be used to return a result set larger than 10 MiB; if the query
2174
- # yields more data than that, the query fails with a `FAILED_PRECONDITION` error.
2175
- # Operations inside read-write transactions might return `ABORTED`. If this
2176
- # occurs, the application should restart the transaction from the beginning. See
2177
- # Transaction for more details. Larger result sets can be fetched in streaming
2178
- # fashion by calling ExecuteStreamingSql instead.
2179
- # @param [String] session
2180
- # Required. The session in which the SQL query should be performed.
2181
- # @param [Google::Apis::SpannerV1::ExecuteSqlRequest] execute_sql_request_object
3586
+ # Creates an instance partition and begins preparing it to be used. The returned
3587
+ # long-running operation can be used to track the progress of preparing the new
3588
+ # instance partition. The instance partition name is assigned by the caller. If
3589
+ # the named instance partition already exists, `CreateInstancePartition` returns
3590
+ # `ALREADY_EXISTS`. Immediately upon completion of this request: * The instance
3591
+ # partition is readable via the API, with all requested attributes but no
3592
+ # allocated resources. Its state is `CREATING`. Until completion of the returned
3593
+ # operation: * Cancelling the operation renders the instance partition
3594
+ # immediately unreadable via the API. * The instance partition can be deleted. *
3595
+ # All other attempts to modify the instance partition are rejected. Upon
3596
+ # completion of the returned operation: * Billing for all successfully-allocated
3597
+ # resources begins (some types may have lower than the requested levels). *
3598
+ # Databases can start using this instance partition. * The instance partition's
3599
+ # allocated resource levels are readable via the API. * The instance partition's
3600
+ # state becomes `READY`. The returned long-running operation will have a name of
3601
+ # the format `/operations/` and can be used to track creation of the instance
3602
+ # partition. The metadata field type is CreateInstancePartitionMetadata. The
3603
+ # response field type is InstancePartition, if successful.
3604
+ # @param [String] parent
3605
+ # Required. The name of the instance in which to create the instance partition.
3606
+ # Values are of the form `projects//instances/`.
3607
+ # @param [Google::Apis::SpannerV1::CreateInstancePartitionRequest] create_instance_partition_request_object
2182
3608
  # @param [String] fields
2183
3609
  # Selector specifying which fields to include in a partial response.
2184
3610
  # @param [String] quota_user
@@ -2188,33 +3614,39 @@ module Google
2188
3614
  # Request-specific options
2189
3615
  #
2190
3616
  # @yield [result, err] Result & error if block supplied
2191
- # @yieldparam result [Google::Apis::SpannerV1::ResultSet] parsed result object
3617
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
2192
3618
  # @yieldparam err [StandardError] error object if request failed
2193
3619
  #
2194
- # @return [Google::Apis::SpannerV1::ResultSet]
3620
+ # @return [Google::Apis::SpannerV1::Operation]
2195
3621
  #
2196
3622
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2197
3623
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2198
3624
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2199
- def execute_session_sql(session, execute_sql_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2200
- command = make_simple_command(:post, 'v1/{+session}:executeSql', options)
2201
- command.request_representation = Google::Apis::SpannerV1::ExecuteSqlRequest::Representation
2202
- command.request_object = execute_sql_request_object
2203
- command.response_representation = Google::Apis::SpannerV1::ResultSet::Representation
2204
- command.response_class = Google::Apis::SpannerV1::ResultSet
2205
- command.params['session'] = session unless session.nil?
3625
+ def create_instance_partition(parent, create_instance_partition_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3626
+ command = make_simple_command(:post, 'v1/{+parent}/instancePartitions', options)
3627
+ command.request_representation = Google::Apis::SpannerV1::CreateInstancePartitionRequest::Representation
3628
+ command.request_object = create_instance_partition_request_object
3629
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
3630
+ command.response_class = Google::Apis::SpannerV1::Operation
3631
+ command.params['parent'] = parent unless parent.nil?
2206
3632
  command.query['fields'] = fields unless fields.nil?
2207
3633
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2208
3634
  execute_or_queue_command(command, &block)
2209
3635
  end
2210
3636
 
2211
- # Like ExecuteSql, except returns the result set as a stream. Unlike ExecuteSql,
2212
- # there is no limit on the size of the returned result set. However, no
2213
- # individual row in the result set can exceed 100 MiB, and no column value can
2214
- # exceed 10 MiB.
2215
- # @param [String] session
2216
- # Required. The session in which the SQL query should be performed.
2217
- # @param [Google::Apis::SpannerV1::ExecuteSqlRequest] execute_sql_request_object
3637
+ # Deletes an existing instance partition. Requires that the instance partition
3638
+ # is not used by any database or backup and is not the default instance
3639
+ # partition of an instance. Authorization requires `spanner.instancePartitions.
3640
+ # delete` permission on the resource name.
3641
+ # @param [String] name
3642
+ # Required. The name of the instance partition to be deleted. Values are of the
3643
+ # form `projects/`project`/instances/`instance`/instancePartitions/`
3644
+ # instance_partition``
3645
+ # @param [String] etag
3646
+ # Optional. If not empty, the API only deletes the instance partition when the
3647
+ # etag provided matches the current status of the requested instance partition.
3648
+ # Otherwise, deletes the instance partition without checking the current status
3649
+ # of the requested instance partition.
2218
3650
  # @param [String] fields
2219
3651
  # Selector specifying which fields to include in a partial response.
2220
3652
  # @param [String] quota_user
@@ -2224,30 +3656,30 @@ module Google
2224
3656
  # Request-specific options
2225
3657
  #
2226
3658
  # @yield [result, err] Result & error if block supplied
2227
- # @yieldparam result [Google::Apis::SpannerV1::PartialResultSet] parsed result object
3659
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
2228
3660
  # @yieldparam err [StandardError] error object if request failed
2229
3661
  #
2230
- # @return [Google::Apis::SpannerV1::PartialResultSet]
3662
+ # @return [Google::Apis::SpannerV1::Empty]
2231
3663
  #
2232
3664
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2233
3665
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2234
3666
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2235
- def execute_project_instance_database_session_streaming_sql(session, execute_sql_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2236
- command = make_simple_command(:post, 'v1/{+session}:executeStreamingSql', options)
2237
- command.request_representation = Google::Apis::SpannerV1::ExecuteSqlRequest::Representation
2238
- command.request_object = execute_sql_request_object
2239
- command.response_representation = Google::Apis::SpannerV1::PartialResultSet::Representation
2240
- command.response_class = Google::Apis::SpannerV1::PartialResultSet
2241
- command.params['session'] = session unless session.nil?
3667
+ def delete_project_instance_instance_partition(name, etag: nil, fields: nil, quota_user: nil, options: nil, &block)
3668
+ command = make_simple_command(:delete, 'v1/{+name}', options)
3669
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
3670
+ command.response_class = Google::Apis::SpannerV1::Empty
3671
+ command.params['name'] = name unless name.nil?
3672
+ command.query['etag'] = etag unless etag.nil?
2242
3673
  command.query['fields'] = fields unless fields.nil?
2243
3674
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2244
3675
  execute_or_queue_command(command, &block)
2245
3676
  end
2246
3677
 
2247
- # Gets a session. Returns `NOT_FOUND` if the session does not exist. This is
2248
- # mainly useful for determining whether a session is still alive.
3678
+ # Gets information about a particular instance partition.
2249
3679
  # @param [String] name
2250
- # Required. The name of the session to retrieve.
3680
+ # Required. The name of the requested instance partition. Values are of the form
3681
+ # `projects/`project`/instances/`instance`/instancePartitions/`
3682
+ # instance_partition``.
2251
3683
  # @param [String] fields
2252
3684
  # Selector specifying which fields to include in a partial response.
2253
3685
  # @param [String] quota_user
@@ -2257,39 +3689,40 @@ module Google
2257
3689
  # Request-specific options
2258
3690
  #
2259
3691
  # @yield [result, err] Result & error if block supplied
2260
- # @yieldparam result [Google::Apis::SpannerV1::Session] parsed result object
3692
+ # @yieldparam result [Google::Apis::SpannerV1::InstancePartition] parsed result object
2261
3693
  # @yieldparam err [StandardError] error object if request failed
2262
3694
  #
2263
- # @return [Google::Apis::SpannerV1::Session]
3695
+ # @return [Google::Apis::SpannerV1::InstancePartition]
2264
3696
  #
2265
3697
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2266
3698
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2267
3699
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2268
- def get_project_instance_database_session(name, fields: nil, quota_user: nil, options: nil, &block)
3700
+ def get_project_instance_instance_partition(name, fields: nil, quota_user: nil, options: nil, &block)
2269
3701
  command = make_simple_command(:get, 'v1/{+name}', options)
2270
- command.response_representation = Google::Apis::SpannerV1::Session::Representation
2271
- command.response_class = Google::Apis::SpannerV1::Session
3702
+ command.response_representation = Google::Apis::SpannerV1::InstancePartition::Representation
3703
+ command.response_class = Google::Apis::SpannerV1::InstancePartition
2272
3704
  command.params['name'] = name unless name.nil?
2273
3705
  command.query['fields'] = fields unless fields.nil?
2274
3706
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2275
3707
  execute_or_queue_command(command, &block)
2276
3708
  end
2277
3709
 
2278
- # Lists all sessions in a given database.
2279
- # @param [String] database
2280
- # Required. The database in which to list sessions.
2281
- # @param [String] filter
2282
- # An expression for filtering the results of the request. Filter rules are case
2283
- # insensitive. The fields eligible for filtering are: * `labels.key` where key
2284
- # is the name of a label Some examples of using filters are: * `labels.env:*` -->
2285
- # The session has the label "env". * `labels.env:dev` --> The session has the
2286
- # label "env" and the value of the label contains the string "dev".
3710
+ # Lists all instance partitions for the given instance.
3711
+ # @param [String] parent
3712
+ # Required. The instance whose instance partitions should be listed. Values are
3713
+ # of the form `projects//instances/`. Use ``instance` = '-'` to list instance
3714
+ # partitions for all Instances in a project, e.g., `projects/myproject/instances/
3715
+ # -`.
3716
+ # @param [String] instance_partition_deadline
3717
+ # Optional. Deadline used while retrieving metadata for instance partitions.
3718
+ # Instance partitions whose metadata cannot be retrieved within this deadline
3719
+ # will be added to unreachable in ListInstancePartitionsResponse.
2287
3720
  # @param [Fixnum] page_size
2288
- # Number of sessions to be returned in the response. If 0 or less, defaults to
2289
- # the server's maximum allowed page size.
3721
+ # Number of instance partitions to be returned in the response. If 0 or less,
3722
+ # defaults to the server's maximum allowed page size.
2290
3723
  # @param [String] page_token
2291
3724
  # If non-empty, `page_token` should contain a next_page_token from a previous
2292
- # ListSessionsResponse.
3725
+ # ListInstancePartitionsResponse.
2293
3726
  # @param [String] fields
2294
3727
  # Selector specifying which fields to include in a partial response.
2295
3728
  # @param [String] quota_user
@@ -2299,20 +3732,20 @@ module Google
2299
3732
  # Request-specific options
2300
3733
  #
2301
3734
  # @yield [result, err] Result & error if block supplied
2302
- # @yieldparam result [Google::Apis::SpannerV1::ListSessionsResponse] parsed result object
3735
+ # @yieldparam result [Google::Apis::SpannerV1::ListInstancePartitionsResponse] parsed result object
2303
3736
  # @yieldparam err [StandardError] error object if request failed
2304
3737
  #
2305
- # @return [Google::Apis::SpannerV1::ListSessionsResponse]
3738
+ # @return [Google::Apis::SpannerV1::ListInstancePartitionsResponse]
2306
3739
  #
2307
3740
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2308
3741
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2309
3742
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2310
- def list_project_instance_database_sessions(database, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
2311
- command = make_simple_command(:get, 'v1/{+database}/sessions', options)
2312
- command.response_representation = Google::Apis::SpannerV1::ListSessionsResponse::Representation
2313
- command.response_class = Google::Apis::SpannerV1::ListSessionsResponse
2314
- command.params['database'] = database unless database.nil?
2315
- command.query['filter'] = filter unless filter.nil?
3743
+ def list_project_instance_instance_partitions(parent, instance_partition_deadline: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
3744
+ command = make_simple_command(:get, 'v1/{+parent}/instancePartitions', options)
3745
+ command.response_representation = Google::Apis::SpannerV1::ListInstancePartitionsResponse::Representation
3746
+ command.response_class = Google::Apis::SpannerV1::ListInstancePartitionsResponse
3747
+ command.params['parent'] = parent unless parent.nil?
3748
+ command.query['instancePartitionDeadline'] = instance_partition_deadline unless instance_partition_deadline.nil?
2316
3749
  command.query['pageSize'] = page_size unless page_size.nil?
2317
3750
  command.query['pageToken'] = page_token unless page_token.nil?
2318
3751
  command.query['fields'] = fields unless fields.nil?
@@ -2320,18 +3753,33 @@ module Google
2320
3753
  execute_or_queue_command(command, &block)
2321
3754
  end
2322
3755
 
2323
- # Creates a set of partition tokens that can be used to execute a query
2324
- # operation in parallel. Each of the returned partition tokens can be used by
2325
- # ExecuteStreamingSql to specify a subset of the query result to read. The same
2326
- # session and read-only transaction must be used by the PartitionQueryRequest
2327
- # used to create the partition tokens and the ExecuteSqlRequests that use the
2328
- # partition tokens. Partition tokens become invalid when the session used to
2329
- # create them is deleted, is idle for too long, begins a new transaction, or
2330
- # becomes too old. When any of these happen, it is not possible to resume the
2331
- # query, and the whole operation must be restarted from the beginning.
2332
- # @param [String] session
2333
- # Required. The session used to create the partitions.
2334
- # @param [Google::Apis::SpannerV1::PartitionQueryRequest] partition_query_request_object
3756
+ # Updates an instance partition, and begins allocating or releasing resources as
3757
+ # requested. The returned long-running operation can be used to track the
3758
+ # progress of updating the instance partition. If the named instance partition
3759
+ # does not exist, returns `NOT_FOUND`. Immediately upon completion of this
3760
+ # request: * For resource types for which a decrease in the instance partition's
3761
+ # allocation has been requested, billing is based on the newly-requested level.
3762
+ # Until completion of the returned operation: * Cancelling the operation sets
3763
+ # its metadata's cancel_time, and begins restoring resources to their pre-
3764
+ # request values. The operation is guaranteed to succeed at undoing all resource
3765
+ # changes, after which point it terminates with a `CANCELLED` status. * All
3766
+ # other attempts to modify the instance partition are rejected. * Reading the
3767
+ # instance partition via the API continues to give the pre-request resource
3768
+ # levels. Upon completion of the returned operation: * Billing begins for all
3769
+ # successfully-allocated resources (some types may have lower than the requested
3770
+ # levels). * All newly-reserved resources are available for serving the instance
3771
+ # partition's tables. * The instance partition's new resource levels are
3772
+ # readable via the API. The returned long-running operation will have a name of
3773
+ # the format `/operations/` and can be used to track the instance partition
3774
+ # modification. The metadata field type is UpdateInstancePartitionMetadata. The
3775
+ # response field type is InstancePartition, if successful. Authorization
3776
+ # requires `spanner.instancePartitions.update` permission on the resource name.
3777
+ # @param [String] name
3778
+ # Required. A unique identifier for the instance partition. Values are of the
3779
+ # form `projects//instances//instancePartitions/a-z*[a-z0-9]`. The final segment
3780
+ # of the name must be between 2 and 64 characters in length. An instance
3781
+ # partition's name cannot be changed after the instance partition is created.
3782
+ # @param [Google::Apis::SpannerV1::UpdateInstancePartitionRequest] update_instance_partition_request_object
2335
3783
  # @param [String] fields
2336
3784
  # Selector specifying which fields to include in a partial response.
2337
3785
  # @param [String] quota_user
@@ -2341,40 +3789,36 @@ module Google
2341
3789
  # Request-specific options
2342
3790
  #
2343
3791
  # @yield [result, err] Result & error if block supplied
2344
- # @yieldparam result [Google::Apis::SpannerV1::PartitionResponse] parsed result object
3792
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
2345
3793
  # @yieldparam err [StandardError] error object if request failed
2346
3794
  #
2347
- # @return [Google::Apis::SpannerV1::PartitionResponse]
3795
+ # @return [Google::Apis::SpannerV1::Operation]
2348
3796
  #
2349
3797
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2350
3798
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2351
3799
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2352
- def partition_session_query(session, partition_query_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2353
- command = make_simple_command(:post, 'v1/{+session}:partitionQuery', options)
2354
- command.request_representation = Google::Apis::SpannerV1::PartitionQueryRequest::Representation
2355
- command.request_object = partition_query_request_object
2356
- command.response_representation = Google::Apis::SpannerV1::PartitionResponse::Representation
2357
- command.response_class = Google::Apis::SpannerV1::PartitionResponse
2358
- command.params['session'] = session unless session.nil?
3800
+ def patch_project_instance_instance_partition(name, update_instance_partition_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
3801
+ command = make_simple_command(:patch, 'v1/{+name}', options)
3802
+ command.request_representation = Google::Apis::SpannerV1::UpdateInstancePartitionRequest::Representation
3803
+ command.request_object = update_instance_partition_request_object
3804
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
3805
+ command.response_class = Google::Apis::SpannerV1::Operation
3806
+ command.params['name'] = name unless name.nil?
2359
3807
  command.query['fields'] = fields unless fields.nil?
2360
3808
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2361
3809
  execute_or_queue_command(command, &block)
2362
3810
  end
2363
3811
 
2364
- # Creates a set of partition tokens that can be used to execute a read operation
2365
- # in parallel. Each of the returned partition tokens can be used by
2366
- # StreamingRead to specify a subset of the read result to read. The same session
2367
- # and read-only transaction must be used by the PartitionReadRequest used to
2368
- # create the partition tokens and the ReadRequests that use the partition tokens.
2369
- # There are no ordering guarantees on rows returned among the returned
2370
- # partition tokens, or even within each individual StreamingRead call issued
2371
- # with a partition_token. Partition tokens become invalid when the session used
2372
- # to create them is deleted, is idle for too long, begins a new transaction, or
2373
- # becomes too old. When any of these happen, it is not possible to resume the
2374
- # read, and the whole operation must be restarted from the beginning.
2375
- # @param [String] session
2376
- # Required. The session used to create the partitions.
2377
- # @param [Google::Apis::SpannerV1::PartitionReadRequest] partition_read_request_object
3812
+ # Starts asynchronous cancellation on a long-running operation. The server makes
3813
+ # a best effort to cancel the operation, but success is not guaranteed. If the
3814
+ # server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`.
3815
+ # Clients can use Operations.GetOperation or other methods to check whether the
3816
+ # cancellation succeeded or whether the operation completed despite cancellation.
3817
+ # On successful cancellation, the operation is not deleted; instead, it becomes
3818
+ # an operation with an Operation.error value with a google.rpc.Status.code of `1`
3819
+ # , corresponding to `Code.CANCELLED`.
3820
+ # @param [String] name
3821
+ # The name of the operation resource to be cancelled.
2378
3822
  # @param [String] fields
2379
3823
  # Selector specifying which fields to include in a partial response.
2380
3824
  # @param [String] quota_user
@@ -2384,37 +3828,30 @@ module Google
2384
3828
  # Request-specific options
2385
3829
  #
2386
3830
  # @yield [result, err] Result & error if block supplied
2387
- # @yieldparam result [Google::Apis::SpannerV1::PartitionResponse] parsed result object
3831
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
2388
3832
  # @yieldparam err [StandardError] error object if request failed
2389
3833
  #
2390
- # @return [Google::Apis::SpannerV1::PartitionResponse]
3834
+ # @return [Google::Apis::SpannerV1::Empty]
2391
3835
  #
2392
3836
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2393
3837
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2394
3838
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2395
- def partition_session_read(session, partition_read_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2396
- command = make_simple_command(:post, 'v1/{+session}:partitionRead', options)
2397
- command.request_representation = Google::Apis::SpannerV1::PartitionReadRequest::Representation
2398
- command.request_object = partition_read_request_object
2399
- command.response_representation = Google::Apis::SpannerV1::PartitionResponse::Representation
2400
- command.response_class = Google::Apis::SpannerV1::PartitionResponse
2401
- command.params['session'] = session unless session.nil?
3839
+ def cancel_project_instance_instance_partition_operation(name, fields: nil, quota_user: nil, options: nil, &block)
3840
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
3841
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
3842
+ command.response_class = Google::Apis::SpannerV1::Empty
3843
+ command.params['name'] = name unless name.nil?
2402
3844
  command.query['fields'] = fields unless fields.nil?
2403
3845
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2404
3846
  execute_or_queue_command(command, &block)
2405
3847
  end
2406
3848
 
2407
- # Reads rows from the database using key lookups and scans, as a simple key/
2408
- # value style alternative to ExecuteSql. This method cannot be used to return a
2409
- # result set larger than 10 MiB; if the read matches more data than that, the
2410
- # read fails with a `FAILED_PRECONDITION` error. Reads inside read-write
2411
- # transactions might return `ABORTED`. If this occurs, the application should
2412
- # restart the transaction from the beginning. See Transaction for more details.
2413
- # Larger result sets can be yielded in streaming fashion by calling
2414
- # StreamingRead instead.
2415
- # @param [String] session
2416
- # Required. The session in which the read should be performed.
2417
- # @param [Google::Apis::SpannerV1::ReadRequest] read_request_object
3849
+ # Deletes a long-running operation. This method indicates that the client is no
3850
+ # longer interested in the operation result. It does not cancel the operation.
3851
+ # If the server doesn't support this method, it returns `google.rpc.Code.
3852
+ # UNIMPLEMENTED`.
3853
+ # @param [String] name
3854
+ # The name of the operation resource to be deleted.
2418
3855
  # @param [String] fields
2419
3856
  # Selector specifying which fields to include in a partial response.
2420
3857
  # @param [String] quota_user
@@ -2424,34 +3861,28 @@ module Google
2424
3861
  # Request-specific options
2425
3862
  #
2426
3863
  # @yield [result, err] Result & error if block supplied
2427
- # @yieldparam result [Google::Apis::SpannerV1::ResultSet] parsed result object
3864
+ # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
2428
3865
  # @yieldparam err [StandardError] error object if request failed
2429
3866
  #
2430
- # @return [Google::Apis::SpannerV1::ResultSet]
3867
+ # @return [Google::Apis::SpannerV1::Empty]
2431
3868
  #
2432
3869
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2433
3870
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2434
3871
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2435
- def read_session(session, read_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2436
- command = make_simple_command(:post, 'v1/{+session}:read', options)
2437
- command.request_representation = Google::Apis::SpannerV1::ReadRequest::Representation
2438
- command.request_object = read_request_object
2439
- command.response_representation = Google::Apis::SpannerV1::ResultSet::Representation
2440
- command.response_class = Google::Apis::SpannerV1::ResultSet
2441
- command.params['session'] = session unless session.nil?
3872
+ def delete_project_instance_instance_partition_operation(name, fields: nil, quota_user: nil, options: nil, &block)
3873
+ command = make_simple_command(:delete, 'v1/{+name}', options)
3874
+ command.response_representation = Google::Apis::SpannerV1::Empty::Representation
3875
+ command.response_class = Google::Apis::SpannerV1::Empty
3876
+ command.params['name'] = name unless name.nil?
2442
3877
  command.query['fields'] = fields unless fields.nil?
2443
3878
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2444
3879
  execute_or_queue_command(command, &block)
2445
3880
  end
2446
3881
 
2447
- # Rolls back a transaction, releasing any locks it holds. It is a good idea to
2448
- # call this for any transaction that includes one or more Read or ExecuteSql
2449
- # requests and ultimately decides not to commit. `Rollback` returns `OK` if it
2450
- # successfully aborts the transaction, the transaction was already aborted, or
2451
- # the transaction is not found. `Rollback` never returns `ABORTED`.
2452
- # @param [String] session
2453
- # Required. The session in which the transaction to roll back is running.
2454
- # @param [Google::Apis::SpannerV1::RollbackRequest] rollback_request_object
3882
+ # Gets the latest state of a long-running operation. Clients can use this method
3883
+ # to poll the operation result at intervals as recommended by the API service.
3884
+ # @param [String] name
3885
+ # The name of the operation resource.
2455
3886
  # @param [String] fields
2456
3887
  # Selector specifying which fields to include in a partial response.
2457
3888
  # @param [String] quota_user
@@ -2461,32 +3892,34 @@ module Google
2461
3892
  # Request-specific options
2462
3893
  #
2463
3894
  # @yield [result, err] Result & error if block supplied
2464
- # @yieldparam result [Google::Apis::SpannerV1::Empty] parsed result object
3895
+ # @yieldparam result [Google::Apis::SpannerV1::Operation] parsed result object
2465
3896
  # @yieldparam err [StandardError] error object if request failed
2466
3897
  #
2467
- # @return [Google::Apis::SpannerV1::Empty]
3898
+ # @return [Google::Apis::SpannerV1::Operation]
2468
3899
  #
2469
3900
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2470
3901
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2471
3902
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2472
- def rollback_session(session, rollback_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2473
- command = make_simple_command(:post, 'v1/{+session}:rollback', options)
2474
- command.request_representation = Google::Apis::SpannerV1::RollbackRequest::Representation
2475
- command.request_object = rollback_request_object
2476
- command.response_representation = Google::Apis::SpannerV1::Empty::Representation
2477
- command.response_class = Google::Apis::SpannerV1::Empty
2478
- command.params['session'] = session unless session.nil?
3903
+ def get_project_instance_instance_partition_operation(name, fields: nil, quota_user: nil, options: nil, &block)
3904
+ command = make_simple_command(:get, 'v1/{+name}', options)
3905
+ command.response_representation = Google::Apis::SpannerV1::Operation::Representation
3906
+ command.response_class = Google::Apis::SpannerV1::Operation
3907
+ command.params['name'] = name unless name.nil?
2479
3908
  command.query['fields'] = fields unless fields.nil?
2480
3909
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2481
3910
  execute_or_queue_command(command, &block)
2482
3911
  end
2483
3912
 
2484
- # Like Read, except returns the result set as a stream. Unlike Read, there is no
2485
- # limit on the size of the returned result set. However, no individual row in
2486
- # the result set can exceed 100 MiB, and no column value can exceed 10 MiB.
2487
- # @param [String] session
2488
- # Required. The session in which the read should be performed.
2489
- # @param [Google::Apis::SpannerV1::ReadRequest] read_request_object
3913
+ # Lists operations that match the specified filter in the request. If the server
3914
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
3915
+ # @param [String] name
3916
+ # The name of the operation's parent resource.
3917
+ # @param [String] filter
3918
+ # The standard list filter.
3919
+ # @param [Fixnum] page_size
3920
+ # The standard list page size.
3921
+ # @param [String] page_token
3922
+ # The standard list page token.
2490
3923
  # @param [String] fields
2491
3924
  # Selector specifying which fields to include in a partial response.
2492
3925
  # @param [String] quota_user
@@ -2496,21 +3929,22 @@ module Google
2496
3929
  # Request-specific options
2497
3930
  #
2498
3931
  # @yield [result, err] Result & error if block supplied
2499
- # @yieldparam result [Google::Apis::SpannerV1::PartialResultSet] parsed result object
3932
+ # @yieldparam result [Google::Apis::SpannerV1::ListOperationsResponse] parsed result object
2500
3933
  # @yieldparam err [StandardError] error object if request failed
2501
3934
  #
2502
- # @return [Google::Apis::SpannerV1::PartialResultSet]
3935
+ # @return [Google::Apis::SpannerV1::ListOperationsResponse]
2503
3936
  #
2504
3937
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
2505
3938
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
2506
3939
  # @raise [Google::Apis::AuthorizationError] Authorization is required
2507
- def streaming_project_instance_database_session_read(session, read_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
2508
- command = make_simple_command(:post, 'v1/{+session}:streamingRead', options)
2509
- command.request_representation = Google::Apis::SpannerV1::ReadRequest::Representation
2510
- command.request_object = read_request_object
2511
- command.response_representation = Google::Apis::SpannerV1::PartialResultSet::Representation
2512
- command.response_class = Google::Apis::SpannerV1::PartialResultSet
2513
- command.params['session'] = session unless session.nil?
3940
+ def list_project_instance_instance_partition_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
3941
+ command = make_simple_command(:get, 'v1/{+name}', options)
3942
+ command.response_representation = Google::Apis::SpannerV1::ListOperationsResponse::Representation
3943
+ command.response_class = Google::Apis::SpannerV1::ListOperationsResponse
3944
+ command.params['name'] = name unless name.nil?
3945
+ command.query['filter'] = filter unless filter.nil?
3946
+ command.query['pageSize'] = page_size unless page_size.nil?
3947
+ command.query['pageToken'] = page_token unless page_token.nil?
2514
3948
  command.query['fields'] = fields unless fields.nil?
2515
3949
  command.query['quotaUser'] = quota_user unless quota_user.nil?
2516
3950
  execute_or_queue_command(command, &block)
@@ -2522,8 +3956,8 @@ module Google
2522
3956
  # Clients can use Operations.GetOperation or other methods to check whether the
2523
3957
  # cancellation succeeded or whether the operation completed despite cancellation.
2524
3958
  # On successful cancellation, the operation is not deleted; instead, it becomes
2525
- # an operation with an Operation.error value with a google.rpc.Status.code of 1,
2526
- # corresponding to `Code.CANCELLED`.
3959
+ # an operation with an Operation.error value with a google.rpc.Status.code of `1`
3960
+ # , corresponding to `Code.CANCELLED`.
2527
3961
  # @param [String] name
2528
3962
  # The name of the operation resource to be cancelled.
2529
3963
  # @param [String] fields
@@ -2618,13 +4052,7 @@ module Google
2618
4052
  end
2619
4053
 
2620
4054
  # Lists operations that match the specified filter in the request. If the server
2621
- # doesn't support this method, it returns `UNIMPLEMENTED`. NOTE: the `name`
2622
- # binding allows API services to override the binding to use different resource
2623
- # name schemes, such as `users/*/operations`. To override the binding, API
2624
- # services can add a binding such as `"/v1/`name=users/*`/operations"` to their
2625
- # service configuration. For backwards compatibility, the default name includes
2626
- # the operations collection id, however overriding users must ensure the name
2627
- # binding is the parent resource, without the operations collection id.
4055
+ # doesn't support this method, it returns `UNIMPLEMENTED`.
2628
4056
  # @param [String] name
2629
4057
  # The name of the operation's parent resource.
2630
4058
  # @param [String] filter