google-cloud-spanner-admin-instance-v1 1.0.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/client.rb +205 -39
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/client.rb +198 -39
- data/lib/google/cloud/spanner/admin/instance/v1/instance_admin/rest/service_stub.rb +60 -0
- data/lib/google/cloud/spanner/admin/instance/v1/version.rb +1 -1
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_pb.rb +5 -1
- data/lib/google/spanner/admin/instance/v1/spanner_instance_admin_services_pb.rb +87 -25
- data/proto_docs/google/api/client.rb +31 -10
- data/proto_docs/google/api/resource.rb +7 -2
- data/proto_docs/google/spanner/admin/instance/v1/spanner_instance_admin.rb +105 -37
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f2d6142626f53f74e67683af74c16442561cd0f0fbb80344e2dc633324f9457
|
4
|
+
data.tar.gz: 2ee80cd6dd93b806895aa7f72033daaa4574ae459e7c63831558db083a10fa68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fefaea816e28b3b48cbb9fba0e24719e8fbdaef52b17aa293541b8efad2acf4d960ed36267adf418ba88604cfc974f422e600411703f2a090619a7fc3007d4d
|
7
|
+
data.tar.gz: a497a5bfc3d2f3775c1b87a0b71c9459d270b754a5e4026b3bb3c40415e7fb0d470776bd051fe967483eb17c64eab7f76e4349d3263309c84fa08fc4c2f50994
|
@@ -426,38 +426,38 @@ module Google
|
|
426
426
|
end
|
427
427
|
|
428
428
|
##
|
429
|
-
# Creates an instance
|
429
|
+
# Creates an instance configuration and begins preparing it to be used. The
|
430
430
|
# returned {::Google::Longrunning::Operation long-running operation}
|
431
431
|
# can be used to track the progress of preparing the new
|
432
|
-
# instance
|
433
|
-
# named instance
|
434
|
-
# `ALREADY_EXISTS`.
|
432
|
+
# instance configuration. The instance configuration name is assigned by the
|
433
|
+
# caller. If the named instance configuration already exists,
|
434
|
+
# `CreateInstanceConfig` returns `ALREADY_EXISTS`.
|
435
435
|
#
|
436
436
|
# Immediately after the request returns:
|
437
437
|
#
|
438
|
-
# * The instance
|
439
|
-
# attributes. The instance
|
438
|
+
# * The instance configuration is readable via the API, with all requested
|
439
|
+
# attributes. The instance configuration's
|
440
440
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
441
441
|
# field is set to true. Its state is `CREATING`.
|
442
442
|
#
|
443
443
|
# While the operation is pending:
|
444
444
|
#
|
445
|
-
# * Cancelling the operation renders the instance
|
445
|
+
# * Cancelling the operation renders the instance configuration immediately
|
446
446
|
# unreadable via the API.
|
447
447
|
# * Except for deleting the creating resource, all other attempts to modify
|
448
|
-
# the instance
|
448
|
+
# the instance configuration are rejected.
|
449
449
|
#
|
450
450
|
# Upon completion of the returned operation:
|
451
451
|
#
|
452
452
|
# * Instances can be created using the instance configuration.
|
453
|
-
# * The instance
|
453
|
+
# * The instance configuration's
|
454
454
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
455
455
|
# field becomes false. Its state becomes `READY`.
|
456
456
|
#
|
457
457
|
# The returned {::Google::Longrunning::Operation long-running operation} will
|
458
458
|
# have a name of the format
|
459
459
|
# `<instance_config_name>/operations/<operation_id>` and can be used to track
|
460
|
-
# creation of the instance
|
460
|
+
# creation of the instance configuration. The
|
461
461
|
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
462
462
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}.
|
463
463
|
# The {::Google::Longrunning::Operation#response response} field type is
|
@@ -484,13 +484,13 @@ module Google
|
|
484
484
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
485
485
|
#
|
486
486
|
# @param parent [::String]
|
487
|
-
# Required. The name of the project in which to create the instance
|
488
|
-
# Values are of the form `projects/<project>`.
|
487
|
+
# Required. The name of the project in which to create the instance
|
488
|
+
# configuration. Values are of the form `projects/<project>`.
|
489
489
|
# @param instance_config_id [::String]
|
490
|
-
# Required. The ID of the instance
|
491
|
-
# of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
|
490
|
+
# Required. The ID of the instance configuration to create. Valid identifiers
|
491
|
+
# are of the form `custom-[-a-z0-9]*[a-z0-9]` and must be between 2 and 64
|
492
492
|
# characters in length. The `custom-` prefix is required to avoid name
|
493
|
-
# conflicts with Google
|
493
|
+
# conflicts with Google-managed configurations.
|
494
494
|
# @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash]
|
495
495
|
# Required. The InstanceConfig proto of the configuration to create.
|
496
496
|
# instance_config.name must be
|
@@ -575,16 +575,16 @@ module Google
|
|
575
575
|
end
|
576
576
|
|
577
577
|
##
|
578
|
-
# Updates an instance
|
578
|
+
# Updates an instance configuration. The returned
|
579
579
|
# {::Google::Longrunning::Operation long-running operation} can be used to track
|
580
|
-
# the progress of updating the instance. If the named instance
|
581
|
-
# not exist, returns `NOT_FOUND`.
|
580
|
+
# the progress of updating the instance. If the named instance configuration
|
581
|
+
# does not exist, returns `NOT_FOUND`.
|
582
582
|
#
|
583
|
-
# Only user
|
583
|
+
# Only user-managed configurations can be updated.
|
584
584
|
#
|
585
585
|
# Immediately after the request returns:
|
586
586
|
#
|
587
|
-
# * The instance
|
587
|
+
# * The instance configuration's
|
588
588
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
589
589
|
# field is set to true.
|
590
590
|
#
|
@@ -594,23 +594,23 @@ module Google
|
|
594
594
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata#cancel_time cancel_time}.
|
595
595
|
# The operation is guaranteed to succeed at undoing all changes, after
|
596
596
|
# which point it terminates with a `CANCELLED` status.
|
597
|
-
# * All other attempts to modify the instance
|
598
|
-
# * Reading the instance
|
597
|
+
# * All other attempts to modify the instance configuration are rejected.
|
598
|
+
# * Reading the instance configuration via the API continues to give the
|
599
599
|
# pre-request values.
|
600
600
|
#
|
601
601
|
# Upon completion of the returned operation:
|
602
602
|
#
|
603
603
|
# * Creating instances using the instance configuration uses the new
|
604
604
|
# values.
|
605
|
-
# * The
|
606
|
-
# * The instance
|
605
|
+
# * The new values of the instance configuration are readable via the API.
|
606
|
+
# * The instance configuration's
|
607
607
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling reconciling}
|
608
608
|
# field becomes false.
|
609
609
|
#
|
610
610
|
# The returned {::Google::Longrunning::Operation long-running operation} will
|
611
611
|
# have a name of the format
|
612
612
|
# `<instance_config_name>/operations/<operation_id>` and can be used to track
|
613
|
-
# the instance
|
613
|
+
# the instance configuration modification. The
|
614
614
|
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
615
615
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigMetadata UpdateInstanceConfigMetadata}.
|
616
616
|
# The {::Google::Longrunning::Operation#response response} field type is
|
@@ -636,8 +636,9 @@ module Google
|
|
636
636
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
637
637
|
#
|
638
638
|
# @param instance_config [::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig, ::Hash]
|
639
|
-
# Required. The user instance
|
640
|
-
# instance
|
639
|
+
# Required. The user instance configuration to update, which must always
|
640
|
+
# include the instance configuration name. Otherwise, only fields mentioned
|
641
|
+
# in
|
641
642
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::UpdateInstanceConfigRequest#update_mask update_mask}
|
642
643
|
# need be included. To prevent conflicts of concurrent updates,
|
643
644
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#reconciling etag} can
|
@@ -727,11 +728,11 @@ module Google
|
|
727
728
|
end
|
728
729
|
|
729
730
|
##
|
730
|
-
# Deletes the instance
|
731
|
+
# Deletes the instance configuration. Deletion is only allowed when no
|
731
732
|
# instances are using the configuration. If any instances are using
|
732
|
-
# the
|
733
|
+
# the configuration, returns `FAILED_PRECONDITION`.
|
733
734
|
#
|
734
|
-
# Only user
|
735
|
+
# Only user-managed configurations can be deleted.
|
735
736
|
#
|
736
737
|
# Authorization requires `spanner.instanceConfigs.delete` permission on
|
737
738
|
# the resource {::Google::Cloud::Spanner::Admin::Instance::V1::InstanceConfig#name name}.
|
@@ -757,12 +758,12 @@ module Google
|
|
757
758
|
# `projects/<project>/instanceConfigs/<instance_config>`
|
758
759
|
# @param etag [::String]
|
759
760
|
# Used for optimistic concurrency control as a way to help prevent
|
760
|
-
# simultaneous deletes of an instance
|
761
|
+
# simultaneous deletes of an instance configuration from overwriting each
|
761
762
|
# other. If not empty, the API
|
762
|
-
# only deletes the instance
|
763
|
-
# status of the requested instance
|
764
|
-
#
|
765
|
-
#
|
763
|
+
# only deletes the instance configuration when the etag provided matches the
|
764
|
+
# current status of the requested instance configuration. Otherwise, deletes
|
765
|
+
# the instance configuration without checking the current status of the
|
766
|
+
# requested instance configuration.
|
766
767
|
# @param validate_only [::Boolean]
|
767
768
|
# An option to validate, but not actually execute, a request,
|
768
769
|
# and provide the same response.
|
@@ -833,9 +834,9 @@ module Google
|
|
833
834
|
end
|
834
835
|
|
835
836
|
##
|
836
|
-
# Lists the user-managed instance
|
837
|
+
# Lists the user-managed instance configuration [long-running
|
837
838
|
# operations][google.longrunning.Operation] in the given project. An instance
|
838
|
-
#
|
839
|
+
# configuration operation has a name of the form
|
839
840
|
# `projects/<project>/instanceConfigs/<instance_config>/operations/<operation>`.
|
840
841
|
# The long-running operation
|
841
842
|
# {::Google::Longrunning::Operation#metadata metadata} field type
|
@@ -861,7 +862,7 @@ module Google
|
|
861
862
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
862
863
|
#
|
863
864
|
# @param parent [::String]
|
864
|
-
# Required. The project of the instance
|
865
|
+
# Required. The project of the instance configuration operations.
|
865
866
|
# Values are of the form `projects/<project>`.
|
866
867
|
# @param filter [::String]
|
867
868
|
# An expression that filters the list of returned operations.
|
@@ -904,7 +905,7 @@ module Google
|
|
904
905
|
# `(error:*)` - Return operations where:
|
905
906
|
# * The operation's metadata type is
|
906
907
|
# {::Google::Cloud::Spanner::Admin::Instance::V1::CreateInstanceConfigMetadata CreateInstanceConfigMetadata}.
|
907
|
-
# * The instance
|
908
|
+
# * The instance configuration name contains "custom-config".
|
908
909
|
# * The operation started before 2021-03-28T14:50:00Z.
|
909
910
|
# * The operation resulted in an error.
|
910
911
|
# @param page_size [::Integer]
|
@@ -2621,6 +2622,164 @@ module Google
|
|
2621
2622
|
raise ::Google::Cloud::Error.from_error(e)
|
2622
2623
|
end
|
2623
2624
|
|
2625
|
+
##
|
2626
|
+
# Moves an instance to the target instance configuration. You can use the
|
2627
|
+
# returned {::Google::Longrunning::Operation long-running operation} to track
|
2628
|
+
# the progress of moving the instance.
|
2629
|
+
#
|
2630
|
+
# `MoveInstance` returns `FAILED_PRECONDITION` if the instance meets any of
|
2631
|
+
# the following criteria:
|
2632
|
+
#
|
2633
|
+
# * Is undergoing a move to a different instance configuration
|
2634
|
+
# * Has backups
|
2635
|
+
# * Has an ongoing update
|
2636
|
+
# * Contains any CMEK-enabled databases
|
2637
|
+
# * Is a free trial instance
|
2638
|
+
#
|
2639
|
+
# While the operation is pending:
|
2640
|
+
#
|
2641
|
+
# * All other attempts to modify the instance, including changes to its
|
2642
|
+
# compute capacity, are rejected.
|
2643
|
+
# * The following database and backup admin operations are rejected:
|
2644
|
+
#
|
2645
|
+
# * `DatabaseAdmin.CreateDatabase`
|
2646
|
+
# * `DatabaseAdmin.UpdateDatabaseDdl` (disabled if default_leader is
|
2647
|
+
# specified in the request.)
|
2648
|
+
# * `DatabaseAdmin.RestoreDatabase`
|
2649
|
+
# * `DatabaseAdmin.CreateBackup`
|
2650
|
+
# * `DatabaseAdmin.CopyBackup`
|
2651
|
+
#
|
2652
|
+
# * Both the source and target instance configurations are subject to
|
2653
|
+
# hourly compute and storage charges.
|
2654
|
+
# * The instance might experience higher read-write latencies and a higher
|
2655
|
+
# transaction abort rate. However, moving an instance doesn't cause any
|
2656
|
+
# downtime.
|
2657
|
+
#
|
2658
|
+
# The returned {::Google::Longrunning::Operation long-running operation} has
|
2659
|
+
# a name of the format
|
2660
|
+
# `<instance_name>/operations/<operation_id>` and can be used to track
|
2661
|
+
# the move instance operation. The
|
2662
|
+
# {::Google::Longrunning::Operation#metadata metadata} field type is
|
2663
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata MoveInstanceMetadata}.
|
2664
|
+
# The {::Google::Longrunning::Operation#response response} field type is
|
2665
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::Instance Instance},
|
2666
|
+
# if successful.
|
2667
|
+
# Cancelling the operation sets its metadata's
|
2668
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceMetadata#cancel_time cancel_time}.
|
2669
|
+
# Cancellation is not immediate because it involves moving any data
|
2670
|
+
# previously moved to the target instance configuration back to the original
|
2671
|
+
# instance configuration. You can use this operation to track the progress of
|
2672
|
+
# the cancellation. Upon successful completion of the cancellation, the
|
2673
|
+
# operation terminates with `CANCELLED` status.
|
2674
|
+
#
|
2675
|
+
# If not cancelled, upon completion of the returned operation:
|
2676
|
+
#
|
2677
|
+
# * The instance successfully moves to the target instance
|
2678
|
+
# configuration.
|
2679
|
+
# * You are billed for compute and storage in target instance
|
2680
|
+
# configuration.
|
2681
|
+
#
|
2682
|
+
# Authorization requires the `spanner.instances.update` permission on
|
2683
|
+
# the resource {::Google::Cloud::Spanner::Admin::Instance::V1::Instance instance}.
|
2684
|
+
#
|
2685
|
+
# For more details, see
|
2686
|
+
# [Move an instance](https://cloud.google.com/spanner/docs/move-instance).
|
2687
|
+
#
|
2688
|
+
# @overload move_instance(request, options = nil)
|
2689
|
+
# Pass arguments to `move_instance` via a request object, either of type
|
2690
|
+
# {::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest} or an equivalent Hash.
|
2691
|
+
#
|
2692
|
+
# @param request [::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest, ::Hash]
|
2693
|
+
# A request object representing the call parameters. Required. To specify no
|
2694
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2695
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2696
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2697
|
+
#
|
2698
|
+
# @overload move_instance(name: nil, target_config: nil)
|
2699
|
+
# Pass arguments to `move_instance` via keyword arguments. Note that at
|
2700
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2701
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2702
|
+
#
|
2703
|
+
# @param name [::String]
|
2704
|
+
# Required. The instance to move.
|
2705
|
+
# Values are of the form `projects/<project>/instances/<instance>`.
|
2706
|
+
# @param target_config [::String]
|
2707
|
+
# Required. The target instance configuration where to move the instance.
|
2708
|
+
# Values are of the form `projects/<project>/instanceConfigs/<config>`.
|
2709
|
+
#
|
2710
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2711
|
+
# @yieldparam response [::Gapic::Operation]
|
2712
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2713
|
+
#
|
2714
|
+
# @return [::Gapic::Operation]
|
2715
|
+
#
|
2716
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2717
|
+
#
|
2718
|
+
# @example Basic example
|
2719
|
+
# require "google/cloud/spanner/admin/instance/v1"
|
2720
|
+
#
|
2721
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2722
|
+
# client = Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Client.new
|
2723
|
+
#
|
2724
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2725
|
+
# request = Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest.new
|
2726
|
+
#
|
2727
|
+
# # Call the move_instance method.
|
2728
|
+
# result = client.move_instance request
|
2729
|
+
#
|
2730
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2731
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2732
|
+
# # Here is how to wait for a response.
|
2733
|
+
# result.wait_until_done! timeout: 60
|
2734
|
+
# if result.response?
|
2735
|
+
# p result.response
|
2736
|
+
# else
|
2737
|
+
# puts "No response received."
|
2738
|
+
# end
|
2739
|
+
#
|
2740
|
+
def move_instance request, options = nil
|
2741
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2742
|
+
|
2743
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Spanner::Admin::Instance::V1::MoveInstanceRequest
|
2744
|
+
|
2745
|
+
# Converts hash and nil to an options object
|
2746
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2747
|
+
|
2748
|
+
# Customize the options with defaults
|
2749
|
+
metadata = @config.rpcs.move_instance.metadata.to_h
|
2750
|
+
|
2751
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
2752
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2753
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2754
|
+
gapic_version: ::Google::Cloud::Spanner::Admin::Instance::V1::VERSION
|
2755
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
2756
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2757
|
+
|
2758
|
+
header_params = {}
|
2759
|
+
if request.name
|
2760
|
+
header_params["name"] = request.name
|
2761
|
+
end
|
2762
|
+
|
2763
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2764
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2765
|
+
|
2766
|
+
options.apply_defaults timeout: @config.rpcs.move_instance.timeout,
|
2767
|
+
metadata: metadata,
|
2768
|
+
retry_policy: @config.rpcs.move_instance.retry_policy
|
2769
|
+
|
2770
|
+
options.apply_defaults timeout: @config.timeout,
|
2771
|
+
metadata: @config.metadata,
|
2772
|
+
retry_policy: @config.retry_policy
|
2773
|
+
|
2774
|
+
@instance_admin_stub.call_rpc :move_instance, request, options: options do |response, operation|
|
2775
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2776
|
+
yield response, operation if block_given?
|
2777
|
+
return response
|
2778
|
+
end
|
2779
|
+
rescue ::GRPC::BadStatus => e
|
2780
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2781
|
+
end
|
2782
|
+
|
2624
2783
|
##
|
2625
2784
|
# Configuration class for the InstanceAdmin API.
|
2626
2785
|
#
|
@@ -2874,6 +3033,11 @@ module Google
|
|
2874
3033
|
# @return [::Gapic::Config::Method]
|
2875
3034
|
#
|
2876
3035
|
attr_reader :list_instance_partition_operations
|
3036
|
+
##
|
3037
|
+
# RPC-specific configuration for `move_instance`
|
3038
|
+
# @return [::Gapic::Config::Method]
|
3039
|
+
#
|
3040
|
+
attr_reader :move_instance
|
2877
3041
|
|
2878
3042
|
# @private
|
2879
3043
|
def initialize parent_rpcs = nil
|
@@ -2917,6 +3081,8 @@ module Google
|
|
2917
3081
|
@update_instance_partition = ::Gapic::Config::Method.new update_instance_partition_config
|
2918
3082
|
list_instance_partition_operations_config = parent_rpcs.list_instance_partition_operations if parent_rpcs.respond_to? :list_instance_partition_operations
|
2919
3083
|
@list_instance_partition_operations = ::Gapic::Config::Method.new list_instance_partition_operations_config
|
3084
|
+
move_instance_config = parent_rpcs.move_instance if parent_rpcs.respond_to? :move_instance
|
3085
|
+
@move_instance = ::Gapic::Config::Method.new move_instance_config
|
2920
3086
|
|
2921
3087
|
yield self if block_given?
|
2922
3088
|
end
|