google-cloud-spanner-admin-instance-v1 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb +608 -13
- data/lib/google/cloud/spanner/admin/instance/v1/version.rb +1 -1
- data/lib/google/spanner/admin/instance/v1/common_pb.rb +30 -0
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +63 -0
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +111 -3
- data/proto_docs/google/protobuf/empty.rb +0 -2
- data/proto_docs/google/spanner/admin/instance/v1/common.rb +48 -0
- data/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb +336 -29
- metadata +4 -2
@@ -245,7 +245,8 @@ module Google
|
|
245
245
|
# @param page_token [::String]
|
246
246
|
# If non-empty, `page_token` should contain a
|
247
247
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse#next_page_token next_page_token}
|
248
|
-
# from a previous
|
248
|
+
# from a previous
|
249
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigsResponse ListInstanceConfigsResponse}.
|
249
250
|
#
|
250
251
|
# @yield [response, operation] Access the result along with the RPC operation
|
251
252
|
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig>]
|
@@ -404,6 +405,567 @@ module Google
|
|
404
405
|
raise ::Google::Cloud::Error.from_error(e)
|
405
406
|
end
|
406
407
|
|
408
|
+
##
|
409
|
+
# Creates an instance config and begins preparing it to be used. The
|
410
|
+
# returned {::Google::Longrunning::Operation long-running operation}
|
411
|
+
# can be used to track the progress of preparing the new
|
412
|
+
# instance config. The instance config name is assigned by the caller. If the
|
413
|
+
# named instance config already exists, `CreateInstanceConfig` returns
|
414
|
+
# `ALREADY_EXISTS`.
|
415
|
+
#
|
416
|
+
# Immediately after the request returns:
|
417
|
+
#
|
418
|
+
# * The instance config is readable via the API, with all requested
|
419
|
+
# attributes. The instance config's
|
420
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
421
|
+
# field is set to true. Its state is `CREATING`.
|
422
|
+
#
|
423
|
+
# While the operation is pending:
|
424
|
+
#
|
425
|
+
# * Cancelling the operation renders the instance config immediately
|
426
|
+
# unreadable via the API.
|
427
|
+
# * Except for deleting the creating resource, all other attempts to modify
|
428
|
+
# the instance config are rejected.
|
429
|
+
#
|
430
|
+
# Upon completion of the returned operation:
|
431
|
+
#
|
432
|
+
# * Instances can be created using the instance configuration.
|
433
|
+
# * The instance config's
|
434
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
435
|
+
# field becomes false. Its state becomes `READY`.
|
436
|
+
#
|
437
|
+
# The returned {::Google::Longrunning::Operation long-running operation} will
|
438
|
+
# have a name of the format
|
439
|
+
# `<instance_config_name>/operations/<operation_id>` and can be used to track
|
440
|
+
# creation of the instance config. The
|
441
|
+
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
442
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}.
|
443
|
+
# The {::Google::Longrunning::Operation#response response} field type is
|
444
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if
|
445
|
+
# successful.
|
446
|
+
#
|
447
|
+
# Authorization requires `spanner.instanceConfigs.create` permission on
|
448
|
+
# the resource
|
449
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest#parent parent}.
|
450
|
+
#
|
451
|
+
# @overload create_instance_config(request, options = nil)
|
452
|
+
# Pass arguments to `create_instance_config` via a request object, either of type
|
453
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest} or an equivalent Hash.
|
454
|
+
#
|
455
|
+
# @param request [::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest, ::Hash]
|
456
|
+
# A request object representing the call parameters. Required. To specify no
|
457
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
458
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
459
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
460
|
+
#
|
461
|
+
# @overload create_instance_config(parent: nil, instance_config_id: nil, instance_config: nil, validate_only: nil)
|
462
|
+
# Pass arguments to `create_instance_config` via keyword arguments. Note that at
|
463
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
464
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
465
|
+
#
|
466
|
+
# @param parent [::String]
|
467
|
+
# Required. The name of the project in which to create the instance config.
|
468
|
+
# Values are of the form `projects/<project>`.
|
469
|
+
# @param instance_config_id [::String]
|
470
|
+
# Required. The ID of the instance config to create. Valid identifiers are
|
471
|
+
# of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
|
472
|
+
# characters in length. The `custom-` prefix is required to avoid name
|
473
|
+
# conflicts with Google managed configurations.
|
474
|
+
# @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash]
|
475
|
+
# Required. The InstanceConfig proto of the configuration to create.
|
476
|
+
# instance_config.name must be
|
477
|
+
# `<parent>/instanceConfigs/<instance_config_id>`.
|
478
|
+
# instance_config.base_config must be a Google managed configuration name,
|
479
|
+
# e.g. <parent>/instanceConfigs/us-east1, <parent>/instanceConfigs/nam3.
|
480
|
+
# @param validate_only [::Boolean]
|
481
|
+
# An option to validate, but not actually execute, a request,
|
482
|
+
# and provide the same response.
|
483
|
+
#
|
484
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
485
|
+
# @yieldparam response [::Gapic::Operation]
|
486
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
487
|
+
#
|
488
|
+
# @return [::Gapic::Operation]
|
489
|
+
#
|
490
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
491
|
+
#
|
492
|
+
# @example Basic example
|
493
|
+
# require "google/cloud/spanner/admin/instance/v1"
|
494
|
+
#
|
495
|
+
# # Create a client object. The client can be reused for multiple calls.
|
496
|
+
# client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new
|
497
|
+
#
|
498
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
499
|
+
# request = Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest.new
|
500
|
+
#
|
501
|
+
# # Call the create_instance_config method.
|
502
|
+
# result = client.create_instance_config request
|
503
|
+
#
|
504
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
505
|
+
# # object to check the status of an operation, cancel it, or wait
|
506
|
+
# # for results. Here is how to block until completion:
|
507
|
+
# result.wait_until_done! timeout: 60
|
508
|
+
# if result.response?
|
509
|
+
# p result.response
|
510
|
+
# else
|
511
|
+
# puts "Error!"
|
512
|
+
# end
|
513
|
+
#
|
514
|
+
def create_instance_config request, options = nil
|
515
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
516
|
+
|
517
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigRequest
|
518
|
+
|
519
|
+
# Converts hash and nil to an options object
|
520
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
521
|
+
|
522
|
+
# Customize the options with defaults
|
523
|
+
metadata = @config.rpcs.create_instance_config.metadata.to_h
|
524
|
+
|
525
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
526
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
527
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
528
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
|
529
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
530
|
+
|
531
|
+
header_params = {}
|
532
|
+
if request.parent
|
533
|
+
header_params["parent"] = request.parent
|
534
|
+
end
|
535
|
+
|
536
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
537
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
538
|
+
|
539
|
+
options.apply_defaults timeout: @config.rpcs.create_instance_config.timeout,
|
540
|
+
metadata: metadata,
|
541
|
+
retry_policy: @config.rpcs.create_instance_config.retry_policy
|
542
|
+
|
543
|
+
options.apply_defaults timeout: @config.timeout,
|
544
|
+
metadata: @config.metadata,
|
545
|
+
retry_policy: @config.retry_policy
|
546
|
+
|
547
|
+
@instance_admin_stub.call_rpc :create_instance_config, request, options: options do |response, operation|
|
548
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
549
|
+
yield response, operation if block_given?
|
550
|
+
return response
|
551
|
+
end
|
552
|
+
rescue ::GRPC::BadStatus => e
|
553
|
+
raise ::Google::Cloud::Error.from_error(e)
|
554
|
+
end
|
555
|
+
|
556
|
+
##
|
557
|
+
# Updates an instance config. The returned
|
558
|
+
# {::Google::Longrunning::Operation long-running operation} can be used to track
|
559
|
+
# the progress of updating the instance. If the named instance config does
|
560
|
+
# not exist, returns `NOT_FOUND`.
|
561
|
+
#
|
562
|
+
# Only user managed configurations can be updated.
|
563
|
+
#
|
564
|
+
# Immediately after the request returns:
|
565
|
+
#
|
566
|
+
# * The instance config's
|
567
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
568
|
+
# field is set to true.
|
569
|
+
#
|
570
|
+
# While the operation is pending:
|
571
|
+
#
|
572
|
+
# * Cancelling the operation sets its metadata's
|
573
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}.
|
574
|
+
# The operation is guaranteed to succeed at undoing all changes, after
|
575
|
+
# which point it terminates with a `CANCELLED` status.
|
576
|
+
# * All other attempts to modify the instance config are rejected.
|
577
|
+
# * Reading the instance config via the API continues to give the
|
578
|
+
# pre-request values.
|
579
|
+
#
|
580
|
+
# Upon completion of the returned operation:
|
581
|
+
#
|
582
|
+
# * Creating instances using the instance configuration uses the new
|
583
|
+
# values.
|
584
|
+
# * The instance config's new values are readable via the API.
|
585
|
+
# * The instance config's
|
586
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
587
|
+
# field becomes false.
|
588
|
+
#
|
589
|
+
# The returned {::Google::Longrunning::Operation long-running operation} will
|
590
|
+
# have a name of the format
|
591
|
+
# `<instance_config_name>/operations/<operation_id>` and can be used to track
|
592
|
+
# the instance config modification. The
|
593
|
+
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
594
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}.
|
595
|
+
# The {::Google::Longrunning::Operation#response response} field type is
|
596
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}, if
|
597
|
+
# successful.
|
598
|
+
#
|
599
|
+
# Authorization requires `spanner.instanceConfigs.update` permission on
|
600
|
+
# the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}.
|
601
|
+
#
|
602
|
+
# @overload update_instance_config(request, options = nil)
|
603
|
+
# Pass arguments to `update_instance_config` via a request object, either of type
|
604
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest} or an equivalent Hash.
|
605
|
+
#
|
606
|
+
# @param request [::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest, ::Hash]
|
607
|
+
# A request object representing the call parameters. Required. To specify no
|
608
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
609
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
610
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
611
|
+
#
|
612
|
+
# @overload update_instance_config(instance_config: nil, update_mask: nil, validate_only: nil)
|
613
|
+
# Pass arguments to `update_instance_config` via keyword arguments. Note that at
|
614
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
615
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
616
|
+
#
|
617
|
+
# @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash]
|
618
|
+
# Required. The user instance config to update, which must always include the
|
619
|
+
# instance config name. Otherwise, only fields mentioned in
|
620
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask}
|
621
|
+
# need be included. To prevent conflicts of concurrent updates,
|
622
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can
|
623
|
+
# be used.
|
624
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
625
|
+
# Required. A mask specifying which fields in
|
626
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig} should be
|
627
|
+
# updated. The field mask must always be specified; this prevents any future
|
628
|
+
# fields in {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig InstanceConfig}
|
629
|
+
# from being erased accidentally by clients that do not know about them. Only
|
630
|
+
# display_name and labels can be updated.
|
631
|
+
# @param validate_only [::Boolean]
|
632
|
+
# An option to validate, but not actually execute, a request,
|
633
|
+
# and provide the same response.
|
634
|
+
#
|
635
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
636
|
+
# @yieldparam response [::Gapic::Operation]
|
637
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
638
|
+
#
|
639
|
+
# @return [::Gapic::Operation]
|
640
|
+
#
|
641
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
642
|
+
#
|
643
|
+
# @example Basic example
|
644
|
+
# require "google/cloud/spanner/admin/instance/v1"
|
645
|
+
#
|
646
|
+
# # Create a client object. The client can be reused for multiple calls.
|
647
|
+
# client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new
|
648
|
+
#
|
649
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
650
|
+
# request = Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest.new
|
651
|
+
#
|
652
|
+
# # Call the update_instance_config method.
|
653
|
+
# result = client.update_instance_config request
|
654
|
+
#
|
655
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
656
|
+
# # object to check the status of an operation, cancel it, or wait
|
657
|
+
# # for results. Here is how to block until completion:
|
658
|
+
# result.wait_until_done! timeout: 60
|
659
|
+
# if result.response?
|
660
|
+
# p result.response
|
661
|
+
# else
|
662
|
+
# puts "Error!"
|
663
|
+
# end
|
664
|
+
#
|
665
|
+
def update_instance_config request, options = nil
|
666
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
667
|
+
|
668
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest
|
669
|
+
|
670
|
+
# Converts hash and nil to an options object
|
671
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
672
|
+
|
673
|
+
# Customize the options with defaults
|
674
|
+
metadata = @config.rpcs.update_instance_config.metadata.to_h
|
675
|
+
|
676
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
677
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
678
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
679
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
|
680
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
681
|
+
|
682
|
+
header_params = {}
|
683
|
+
if request.instance_config&.name
|
684
|
+
header_params["instance_config.name"] = request.instance_config.name
|
685
|
+
end
|
686
|
+
|
687
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
688
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
689
|
+
|
690
|
+
options.apply_defaults timeout: @config.rpcs.update_instance_config.timeout,
|
691
|
+
metadata: metadata,
|
692
|
+
retry_policy: @config.rpcs.update_instance_config.retry_policy
|
693
|
+
|
694
|
+
options.apply_defaults timeout: @config.timeout,
|
695
|
+
metadata: @config.metadata,
|
696
|
+
retry_policy: @config.retry_policy
|
697
|
+
|
698
|
+
@instance_admin_stub.call_rpc :update_instance_config, request, options: options do |response, operation|
|
699
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
700
|
+
yield response, operation if block_given?
|
701
|
+
return response
|
702
|
+
end
|
703
|
+
rescue ::GRPC::BadStatus => e
|
704
|
+
raise ::Google::Cloud::Error.from_error(e)
|
705
|
+
end
|
706
|
+
|
707
|
+
##
|
708
|
+
# Deletes the instance config. Deletion is only allowed when no
|
709
|
+
# instances are using the configuration. If any instances are using
|
710
|
+
# the config, returns `FAILED_PRECONDITION`.
|
711
|
+
#
|
712
|
+
# Only user managed configurations can be deleted.
|
713
|
+
#
|
714
|
+
# Authorization requires `spanner.instanceConfigs.delete` permission on
|
715
|
+
# the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}.
|
716
|
+
#
|
717
|
+
# @overload delete_instance_config(request, options = nil)
|
718
|
+
# Pass arguments to `delete_instance_config` via a request object, either of type
|
719
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest} or an equivalent Hash.
|
720
|
+
#
|
721
|
+
# @param request [::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest, ::Hash]
|
722
|
+
# A request object representing the call parameters. Required. To specify no
|
723
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
724
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
725
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
726
|
+
#
|
727
|
+
# @overload delete_instance_config(name: nil, etag: nil, validate_only: nil)
|
728
|
+
# Pass arguments to `delete_instance_config` via keyword arguments. Note that at
|
729
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
730
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
731
|
+
#
|
732
|
+
# @param name [::String]
|
733
|
+
# Required. The name of the instance configuration to be deleted.
|
734
|
+
# Values are of the form
|
735
|
+
# `projects/<project>/instanceConfigs/<instance_config>`
|
736
|
+
# @param etag [::String]
|
737
|
+
# Used for optimistic concurrency control as a way to help prevent
|
738
|
+
# simultaneous deletes of an instance config from overwriting each
|
739
|
+
# other. If not empty, the API
|
740
|
+
# only deletes the instance config when the etag provided matches the current
|
741
|
+
# status of the requested instance config. Otherwise, deletes the instance
|
742
|
+
# config without checking the current status of the requested instance
|
743
|
+
# config.
|
744
|
+
# @param validate_only [::Boolean]
|
745
|
+
# An option to validate, but not actually execute, a request,
|
746
|
+
# and provide the same response.
|
747
|
+
#
|
748
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
749
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
750
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
751
|
+
#
|
752
|
+
# @return [::Google::Protobuf::Empty]
|
753
|
+
#
|
754
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
755
|
+
#
|
756
|
+
# @example Basic example
|
757
|
+
# require "google/cloud/spanner/admin/instance/v1"
|
758
|
+
#
|
759
|
+
# # Create a client object. The client can be reused for multiple calls.
|
760
|
+
# client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new
|
761
|
+
#
|
762
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
763
|
+
# request = Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest.new
|
764
|
+
#
|
765
|
+
# # Call the delete_instance_config method.
|
766
|
+
# result = client.delete_instance_config request
|
767
|
+
#
|
768
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
769
|
+
# p result
|
770
|
+
#
|
771
|
+
def delete_instance_config request, options = nil
|
772
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
773
|
+
|
774
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::DeleteInstanceConfigRequest
|
775
|
+
|
776
|
+
# Converts hash and nil to an options object
|
777
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
778
|
+
|
779
|
+
# Customize the options with defaults
|
780
|
+
metadata = @config.rpcs.delete_instance_config.metadata.to_h
|
781
|
+
|
782
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
783
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
784
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
785
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
|
786
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
787
|
+
|
788
|
+
header_params = {}
|
789
|
+
if request.name
|
790
|
+
header_params["name"] = request.name
|
791
|
+
end
|
792
|
+
|
793
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
794
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
795
|
+
|
796
|
+
options.apply_defaults timeout: @config.rpcs.delete_instance_config.timeout,
|
797
|
+
metadata: metadata,
|
798
|
+
retry_policy: @config.rpcs.delete_instance_config.retry_policy
|
799
|
+
|
800
|
+
options.apply_defaults timeout: @config.timeout,
|
801
|
+
metadata: @config.metadata,
|
802
|
+
retry_policy: @config.retry_policy
|
803
|
+
|
804
|
+
@instance_admin_stub.call_rpc :delete_instance_config, request, options: options do |response, operation|
|
805
|
+
yield response, operation if block_given?
|
806
|
+
return response
|
807
|
+
end
|
808
|
+
rescue ::GRPC::BadStatus => e
|
809
|
+
raise ::Google::Cloud::Error.from_error(e)
|
810
|
+
end
|
811
|
+
|
812
|
+
##
|
813
|
+
# Lists the user-managed instance config [long-running
|
814
|
+
# operations][google.longrunning.Operation] in the given project. An instance
|
815
|
+
# config operation has a name of the form
|
816
|
+
# `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
|
817
|
+
# The long-running operation
|
818
|
+
# {::Google::Longrunning::Operation#metadata metadata} field type
|
819
|
+
# `metadata.type_url` describes the type of the metadata. Operations returned
|
820
|
+
# include those that have completed/failed/canceled within the last 7 days,
|
821
|
+
# and pending operations. Operations returned are ordered by
|
822
|
+
# `operation.metadata.value.start_time` in descending order starting
|
823
|
+
# from the most recently started operation.
|
824
|
+
#
|
825
|
+
# @overload list_instance_config_operations(request, options = nil)
|
826
|
+
# Pass arguments to `list_instance_config_operations` via a request object, either of type
|
827
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest} or an equivalent Hash.
|
828
|
+
#
|
829
|
+
# @param request [::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest, ::Hash]
|
830
|
+
# A request object representing the call parameters. Required. To specify no
|
831
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
832
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
833
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
834
|
+
#
|
835
|
+
# @overload list_instance_config_operations(parent: nil, filter: nil, page_size: nil, page_token: nil)
|
836
|
+
# Pass arguments to `list_instance_config_operations` via keyword arguments. Note that at
|
837
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
838
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
839
|
+
#
|
840
|
+
# @param parent [::String]
|
841
|
+
# Required. The project of the instance config operations.
|
842
|
+
# Values are of the form `projects/<project>`.
|
843
|
+
# @param filter [::String]
|
844
|
+
# An expression that filters the list of returned operations.
|
845
|
+
#
|
846
|
+
# A filter expression consists of a field name, a
|
847
|
+
# comparison operator, and a value for filtering.
|
848
|
+
# The value must be a string, a number, or a boolean. The comparison operator
|
849
|
+
# must be one of: `<`, `>`, `<=`, `>=`, `!=`, `=`, or `:`.
|
850
|
+
# Colon `:` is the contains operator. Filter rules are not case sensitive.
|
851
|
+
#
|
852
|
+
# The following fields in the {::Google::Longrunning::Operation Operation}
|
853
|
+
# are eligible for filtering:
|
854
|
+
#
|
855
|
+
# * `name` - The name of the long-running operation
|
856
|
+
# * `done` - False if the operation is in progress, else true.
|
857
|
+
# * `metadata.@type` - the type of metadata. For example, the type string
|
858
|
+
# for
|
859
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}
|
860
|
+
# is
|
861
|
+
# `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata`.
|
862
|
+
# * `metadata.<field_name>` - any field in metadata.value.
|
863
|
+
# `metadata.@type` must be specified first, if filtering on metadata
|
864
|
+
# fields.
|
865
|
+
# * `error` - Error associated with the long-running operation.
|
866
|
+
# * `response.@type` - the type of response.
|
867
|
+
# * `response.<field_name>` - any field in response.value.
|
868
|
+
#
|
869
|
+
# You can combine multiple expressions by enclosing each expression in
|
870
|
+
# parentheses. By default, expressions are combined with AND logic. However,
|
871
|
+
# you can specify AND, OR, and NOT logic explicitly.
|
872
|
+
#
|
873
|
+
# Here are a few examples:
|
874
|
+
#
|
875
|
+
# * `done:true` - The operation is complete.
|
876
|
+
# * `(metadata.@type=` \
|
877
|
+
# `type.googleapis.com/google.spanner.admin.instance.v1.CreateInstanceConfigMetadata)
|
878
|
+
# AND` \
|
879
|
+
# `(metadata.instance_config.name:custom-config) AND` \
|
880
|
+
# `(metadata.progress.start_time < \"2021-03-28T14:50:00Z\") AND` \
|
881
|
+
# `(error:*)` - Return operations where:
|
882
|
+
# * The operation's metadata type is
|
883
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}.
|
884
|
+
# * The instance config name contains "custom-config".
|
885
|
+
# * The operation started before 2021-03-28T14:50:00Z.
|
886
|
+
# * The operation resulted in an error.
|
887
|
+
# @param page_size [::Integer]
|
888
|
+
# Number of operations to be returned in the response. If 0 or
|
889
|
+
# less, defaults to the server's maximum allowed page size.
|
890
|
+
# @param page_token [::String]
|
891
|
+
# If non-empty, `page_token` should contain a
|
892
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse#next_page_token next_page_token}
|
893
|
+
# from a previous
|
894
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsResponse ListInstanceConfigOperationsResponse}
|
895
|
+
# to the same `parent` and with the same `filter`.
|
896
|
+
#
|
897
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
898
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
|
899
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
900
|
+
#
|
901
|
+
# @return [::Gapic::PagedEnumerable<::Gapic::Operation>]
|
902
|
+
#
|
903
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
904
|
+
#
|
905
|
+
# @example Basic example
|
906
|
+
# require "google/cloud/spanner/admin/instance/v1"
|
907
|
+
#
|
908
|
+
# # Create a client object. The client can be reused for multiple calls.
|
909
|
+
# client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new
|
910
|
+
#
|
911
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
912
|
+
# request = Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest.new
|
913
|
+
#
|
914
|
+
# # Call the list_instance_config_operations method.
|
915
|
+
# result = client.list_instance_config_operations request
|
916
|
+
#
|
917
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
918
|
+
# # iterate over all elements by calling #each, and the enumerable
|
919
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
920
|
+
# # methods are also available for managing paging directly.
|
921
|
+
# result.each do |response|
|
922
|
+
# # Each element is of type ::Google::Longrunning::Operation.
|
923
|
+
# p response
|
924
|
+
# end
|
925
|
+
#
|
926
|
+
def list_instance_config_operations request, options = nil
|
927
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
928
|
+
|
929
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::ListInstanceConfigOperationsRequest
|
930
|
+
|
931
|
+
# Converts hash and nil to an options object
|
932
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
933
|
+
|
934
|
+
# Customize the options with defaults
|
935
|
+
metadata = @config.rpcs.list_instance_config_operations.metadata.to_h
|
936
|
+
|
937
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
938
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
939
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
940
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
|
941
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
942
|
+
|
943
|
+
header_params = {}
|
944
|
+
if request.parent
|
945
|
+
header_params["parent"] = request.parent
|
946
|
+
end
|
947
|
+
|
948
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
949
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
950
|
+
|
951
|
+
options.apply_defaults timeout: @config.rpcs.list_instance_config_operations.timeout,
|
952
|
+
metadata: metadata,
|
953
|
+
retry_policy: @config.rpcs.list_instance_config_operations.retry_policy
|
954
|
+
|
955
|
+
options.apply_defaults timeout: @config.timeout,
|
956
|
+
metadata: @config.metadata,
|
957
|
+
retry_policy: @config.retry_policy
|
958
|
+
|
959
|
+
@instance_admin_stub.call_rpc :list_instance_config_operations, request, options: options do |response, operation|
|
960
|
+
wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
|
961
|
+
response = ::Gapic::PagedEnumerable.new @instance_admin_stub, :list_instance_config_operations, request, response, operation, options, format_resource: wrap_lro_operation
|
962
|
+
yield response, operation if block_given?
|
963
|
+
return response
|
964
|
+
end
|
965
|
+
rescue ::GRPC::BadStatus => e
|
966
|
+
raise ::Google::Cloud::Error.from_error(e)
|
967
|
+
end
|
968
|
+
|
407
969
|
##
|
408
970
|
# Lists all instances in the given project.
|
409
971
|
#
|
@@ -430,8 +992,9 @@ module Google
|
|
430
992
|
# to the server's maximum allowed page size.
|
431
993
|
# @param page_token [::String]
|
432
994
|
# If non-empty, `page_token` should contain a
|
433
|
-
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token}
|
434
|
-
#
|
995
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse#next_page_token next_page_token}
|
996
|
+
# from a previous
|
997
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::ListInstancesResponse ListInstancesResponse}.
|
435
998
|
# @param filter [::String]
|
436
999
|
# An expression for filtering the results of the request. Filter rules are
|
437
1000
|
# case insensitive. The fields eligible for filtering are:
|
@@ -546,9 +1109,10 @@ module Google
|
|
546
1109
|
# Required. The name of the requested instance. Values are of the form
|
547
1110
|
# `projects/<project>/instances/<instance>`.
|
548
1111
|
# @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
|
549
|
-
# If field_mask is present, specifies the subset of
|
550
|
-
# should be
|
551
|
-
# If absent, all
|
1112
|
+
# If field_mask is present, specifies the subset of
|
1113
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields that should be
|
1114
|
+
# returned. If absent, all
|
1115
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} fields are returned.
|
552
1116
|
#
|
553
1117
|
# @yield [response, operation] Access the result along with the RPC operation
|
554
1118
|
# @yieldparam response [::Google::Cloud::Spanner::Admin::Instance::V1::Instance]
|
@@ -763,9 +1327,9 @@ module Google
|
|
763
1327
|
# Until completion of the returned operation:
|
764
1328
|
#
|
765
1329
|
# * Cancelling the operation sets its metadata's
|
766
|
-
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time},
|
767
|
-
# restoring resources to their pre-request values. The
|
768
|
-
# is guaranteed to succeed at undoing all resource changes,
|
1330
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceMetadata#cancel_time cancel_time},
|
1331
|
+
# and begins restoring resources to their pre-request values. The
|
1332
|
+
# operation is guaranteed to succeed at undoing all resource changes,
|
769
1333
|
# after which point it terminates with a `CANCELLED` status.
|
770
1334
|
# * All other attempts to modify the instance are rejected.
|
771
1335
|
# * Reading the instance via the API continues to give the pre-request
|
@@ -807,12 +1371,15 @@ module Google
|
|
807
1371
|
#
|
808
1372
|
# @param instance [::Google::Cloud::Spanner::Admin::Instance::V1::Instance, ::Hash]
|
809
1373
|
# Required. The instance to update, which must always include the instance
|
810
|
-
# name. Otherwise, only fields mentioned in
|
1374
|
+
# name. Otherwise, only fields mentioned in
|
1375
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceRequest#field_mask field_mask}
|
1376
|
+
# need be included.
|
811
1377
|
# @param field_mask [::Google::Protobuf::FieldMask, ::Hash]
|
812
|
-
# Required. A mask specifying which fields in
|
1378
|
+
# Required. A mask specifying which fields in
|
1379
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} should be updated.
|
813
1380
|
# The field mask must always be specified; this prevents any future fields in
|
814
|
-
# {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased
|
815
|
-
# about them.
|
1381
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance} from being erased
|
1382
|
+
# accidentally by clients that do not know about them.
|
816
1383
|
#
|
817
1384
|
# @yield [response, operation] Access the result along with the RPC operation
|
818
1385
|
# @yieldparam response [::Gapic::Operation]
|
@@ -1418,6 +1985,26 @@ module Google
|
|
1418
1985
|
#
|
1419
1986
|
attr_reader :get_instance_config
|
1420
1987
|
##
|
1988
|
+
# RPC-specific configuration for `create_instance_config`
|
1989
|
+
# @return [::Gapic::Config::Method]
|
1990
|
+
#
|
1991
|
+
attr_reader :create_instance_config
|
1992
|
+
##
|
1993
|
+
# RPC-specific configuration for `update_instance_config`
|
1994
|
+
# @return [::Gapic::Config::Method]
|
1995
|
+
#
|
1996
|
+
attr_reader :update_instance_config
|
1997
|
+
##
|
1998
|
+
# RPC-specific configuration for `delete_instance_config`
|
1999
|
+
# @return [::Gapic::Config::Method]
|
2000
|
+
#
|
2001
|
+
attr_reader :delete_instance_config
|
2002
|
+
##
|
2003
|
+
# RPC-specific configuration for `list_instance_config_operations`
|
2004
|
+
# @return [::Gapic::Config::Method]
|
2005
|
+
#
|
2006
|
+
attr_reader :list_instance_config_operations
|
2007
|
+
##
|
1421
2008
|
# RPC-specific configuration for `list_instances`
|
1422
2009
|
# @return [::Gapic::Config::Method]
|
1423
2010
|
#
|
@@ -1464,6 +2051,14 @@ module Google
|
|
1464
2051
|
@list_instance_configs = ::Gapic::Config::Method.new list_instance_configs_config
|
1465
2052
|
get_instance_config_config = parent_rpcs.get_instance_config if parent_rpcs.respond_to? :get_instance_config
|
1466
2053
|
@get_instance_config = ::Gapic::Config::Method.new get_instance_config_config
|
2054
|
+
create_instance_config_config = parent_rpcs.create_instance_config if parent_rpcs.respond_to? :create_instance_config
|
2055
|
+
@create_instance_config = ::Gapic::Config::Method.new create_instance_config_config
|
2056
|
+
update_instance_config_config = parent_rpcs.update_instance_config if parent_rpcs.respond_to? :update_instance_config
|
2057
|
+
@update_instance_config = ::Gapic::Config::Method.new update_instance_config_config
|
2058
|
+
delete_instance_config_config = parent_rpcs.delete_instance_config if parent_rpcs.respond_to? :delete_instance_config
|
2059
|
+
@delete_instance_config = ::Gapic::Config::Method.new delete_instance_config_config
|
2060
|
+
list_instance_config_operations_config = parent_rpcs.list_instance_config_operations if parent_rpcs.respond_to? :list_instance_config_operations
|
2061
|
+
@list_instance_config_operations = ::Gapic::Config::Method.new list_instance_config_operations_config
|
1467
2062
|
list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances
|
1468
2063
|
@list_instances = ::Gapic::Config::Method.new list_instances_config
|
1469
2064
|
get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance
|