google-cloud-redis-cluster-v1 0.5.0 → 1.0.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.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/client.rb +1046 -178
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/operations.rb +7 -0
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/paths.rb +139 -0
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/client.rb +938 -124
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/operations.rb +7 -0
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest/service_stub.rb +491 -0
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster/rest.rb +0 -6
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb +0 -6
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_pb.rb +44 -1
- data/lib/google/cloud/redis/cluster/v1/cloud_redis_cluster_services_pb.rb +31 -6
- data/lib/google/cloud/redis/cluster/v1/version.rb +1 -1
- data/proto_docs/google/api/client.rb +8 -0
- data/proto_docs/google/api/field_info.rb +88 -0
- data/proto_docs/google/cloud/redis/cluster/v1/cloud_redis_cluster.rb +752 -15
- data/proto_docs/google/longrunning/operations.rb +4 -0
- data/proto_docs/google/type/dayofweek.rb +49 -0
- data/proto_docs/google/type/timeofday.rb +45 -0
- metadata +9 -9
@@ -47,12 +47,6 @@ module Google
|
|
47
47
|
# Note that location_id must be a GCP `region`; for example:
|
48
48
|
# * `projects/redpepper-1290/locations/us-central1/clusters/my-redis`
|
49
49
|
#
|
50
|
-
# We use API version selector for Flex APIs
|
51
|
-
# * The versioning strategy is release-based versioning
|
52
|
-
# * Our backend CLH only deals with the superset version (called v1main)
|
53
|
-
# * Existing backend for Redis Gen1 and MRR is not touched.
|
54
|
-
# * More details in go/redis-flex-api-versioning
|
55
|
-
#
|
56
50
|
class Client
|
57
51
|
# @private
|
58
52
|
API_VERSION = ""
|
@@ -106,6 +100,22 @@ module Google
|
|
106
100
|
|
107
101
|
default_config.rpcs.get_cluster_certificate_authority.timeout = 600.0
|
108
102
|
|
103
|
+
default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0
|
104
|
+
|
105
|
+
default_config.rpcs.list_backup_collections.timeout = 600.0
|
106
|
+
|
107
|
+
default_config.rpcs.get_backup_collection.timeout = 600.0
|
108
|
+
|
109
|
+
default_config.rpcs.list_backups.timeout = 600.0
|
110
|
+
|
111
|
+
default_config.rpcs.get_backup.timeout = 600.0
|
112
|
+
|
113
|
+
default_config.rpcs.delete_backup.timeout = 600.0
|
114
|
+
|
115
|
+
default_config.rpcs.export_backup.timeout = 600.0
|
116
|
+
|
117
|
+
default_config.rpcs.backup_cluster.timeout = 600.0
|
118
|
+
|
109
119
|
default_config
|
110
120
|
end
|
111
121
|
yield @configure if block_given?
|
@@ -282,10 +292,10 @@ module Google
|
|
282
292
|
# The `next_page_token` value returned from a previous
|
283
293
|
# [ListClusters][CloudRedis.ListClusters] request, if any.
|
284
294
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
285
|
-
# @yieldparam result [::Google::Cloud::Redis::Cluster::V1::
|
295
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>]
|
286
296
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
287
297
|
#
|
288
|
-
# @return [::Google::Cloud::Redis::Cluster::V1::
|
298
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Cluster>]
|
289
299
|
#
|
290
300
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
291
301
|
#
|
@@ -337,7 +347,9 @@ module Google
|
|
337
347
|
retry_policy: @config.retry_policy
|
338
348
|
|
339
349
|
@cloud_redis_cluster_stub.list_clusters request, options do |result, operation|
|
350
|
+
result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, "clusters", request, result, options
|
340
351
|
yield result, operation if block_given?
|
352
|
+
throw :response, result
|
341
353
|
end
|
342
354
|
rescue ::Gapic::Rest::Error => e
|
343
355
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -806,138 +818,884 @@ module Google
|
|
806
818
|
end
|
807
819
|
|
808
820
|
##
|
809
|
-
#
|
821
|
+
# Reschedules upcoming maintenance event.
|
810
822
|
#
|
811
|
-
#
|
812
|
-
#
|
813
|
-
#
|
814
|
-
# applied individually to specific RPCs. See
|
815
|
-
# {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration::Rpcs}
|
816
|
-
# for a list of RPCs that can be configured independently.
|
823
|
+
# @overload reschedule_cluster_maintenance(request, options = nil)
|
824
|
+
# Pass arguments to `reschedule_cluster_maintenance` via a request object, either of type
|
825
|
+
# {::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest} or an equivalent Hash.
|
817
826
|
#
|
818
|
-
#
|
819
|
-
#
|
827
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest, ::Hash]
|
828
|
+
# A request object representing the call parameters. Required. To specify no
|
829
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
830
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
831
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
820
832
|
#
|
821
|
-
# @
|
833
|
+
# @overload reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil)
|
834
|
+
# Pass arguments to `reschedule_cluster_maintenance` via keyword arguments. Note that at
|
835
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
836
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
822
837
|
#
|
823
|
-
#
|
824
|
-
#
|
825
|
-
#
|
826
|
-
#
|
827
|
-
#
|
828
|
-
#
|
829
|
-
#
|
838
|
+
# @param name [::String]
|
839
|
+
# Required. Redis Cluster instance resource name using the form:
|
840
|
+
# `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
|
841
|
+
# where `location_id` refers to a GCP region.
|
842
|
+
# @param reschedule_type [::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest::RescheduleType]
|
843
|
+
# Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as
|
844
|
+
# well.
|
845
|
+
# @param schedule_time [::Google::Protobuf::Timestamp, ::Hash]
|
846
|
+
# Optional. Timestamp when the maintenance shall be rescheduled to if
|
847
|
+
# reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
|
848
|
+
# example `2012-11-15T16:19:00.094Z`.
|
849
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
850
|
+
# @yieldparam result [::Gapic::Operation]
|
851
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
830
852
|
#
|
831
|
-
#
|
832
|
-
# client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config|
|
833
|
-
# config.timeout = 10.0
|
834
|
-
# config.rpcs.list_clusters.timeout = 20.0
|
835
|
-
# end
|
853
|
+
# @return [::Gapic::Operation]
|
836
854
|
#
|
837
|
-
#
|
838
|
-
# A custom service endpoint, as a hostname or hostname:port. The default is
|
839
|
-
# nil, indicating to use the default endpoint in the current universe domain.
|
840
|
-
# @return [::String,nil]
|
841
|
-
# @!attribute [rw] credentials
|
842
|
-
# Credentials to send with calls. You may provide any of the following types:
|
843
|
-
# * (`String`) The path to a service account key file in JSON format
|
844
|
-
# * (`Hash`) A service account key as a Hash
|
845
|
-
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
846
|
-
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
847
|
-
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
848
|
-
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
849
|
-
# * (`nil`) indicating no credentials
|
850
|
-
# @return [::Object]
|
851
|
-
# @!attribute [rw] scope
|
852
|
-
# The OAuth scopes
|
853
|
-
# @return [::Array<::String>]
|
854
|
-
# @!attribute [rw] lib_name
|
855
|
-
# The library name as recorded in instrumentation and logging
|
856
|
-
# @return [::String]
|
857
|
-
# @!attribute [rw] lib_version
|
858
|
-
# The library version as recorded in instrumentation and logging
|
859
|
-
# @return [::String]
|
860
|
-
# @!attribute [rw] timeout
|
861
|
-
# The call timeout in seconds.
|
862
|
-
# @return [::Numeric]
|
863
|
-
# @!attribute [rw] metadata
|
864
|
-
# Additional headers to be sent with the call.
|
865
|
-
# @return [::Hash{::Symbol=>::String}]
|
866
|
-
# @!attribute [rw] retry_policy
|
867
|
-
# The retry policy. The value is a hash with the following keys:
|
868
|
-
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
869
|
-
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
870
|
-
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
871
|
-
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
872
|
-
# trigger a retry.
|
873
|
-
# @return [::Hash]
|
874
|
-
# @!attribute [rw] quota_project
|
875
|
-
# A separate project against which to charge quota.
|
876
|
-
# @return [::String]
|
877
|
-
# @!attribute [rw] universe_domain
|
878
|
-
# The universe domain within which to make requests. This determines the
|
879
|
-
# default endpoint URL. The default value of nil uses the environment
|
880
|
-
# universe (usually the default "googleapis.com" universe).
|
881
|
-
# @return [::String,nil]
|
882
|
-
# @!attribute [rw] logger
|
883
|
-
# A custom logger to use for request/response debug logging, or the value
|
884
|
-
# `:default` (the default) to construct a default logger, or `nil` to
|
885
|
-
# explicitly disable logging.
|
886
|
-
# @return [::Logger,:default,nil]
|
855
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
887
856
|
#
|
888
|
-
|
889
|
-
|
857
|
+
# @example Basic example
|
858
|
+
# require "google/cloud/redis/cluster/v1"
|
859
|
+
#
|
860
|
+
# # Create a client object. The client can be reused for multiple calls.
|
861
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
862
|
+
#
|
863
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
864
|
+
# request = Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest.new
|
865
|
+
#
|
866
|
+
# # Call the reschedule_cluster_maintenance method.
|
867
|
+
# result = client.reschedule_cluster_maintenance request
|
868
|
+
#
|
869
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
870
|
+
# # check the status of an operation, cancel it, or wait for results.
|
871
|
+
# # Here is how to wait for a response.
|
872
|
+
# result.wait_until_done! timeout: 60
|
873
|
+
# if result.response?
|
874
|
+
# p result.response
|
875
|
+
# else
|
876
|
+
# puts "No response received."
|
877
|
+
# end
|
878
|
+
#
|
879
|
+
def reschedule_cluster_maintenance request, options = nil
|
880
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
890
881
|
|
891
|
-
|
892
|
-
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
893
|
-
DEFAULT_ENDPOINT = "redis.googleapis.com"
|
882
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::RescheduleClusterMaintenanceRequest
|
894
883
|
|
895
|
-
|
896
|
-
|
897
|
-
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
898
|
-
allowed.any? { |klass| klass === value }
|
899
|
-
end
|
900
|
-
config_attr :scope, nil, ::String, ::Array, nil
|
901
|
-
config_attr :lib_name, nil, ::String, nil
|
902
|
-
config_attr :lib_version, nil, ::String, nil
|
903
|
-
config_attr :timeout, nil, ::Numeric, nil
|
904
|
-
config_attr :metadata, nil, ::Hash, nil
|
905
|
-
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
906
|
-
config_attr :quota_project, nil, ::String, nil
|
907
|
-
config_attr :universe_domain, nil, ::String, nil
|
884
|
+
# Converts hash and nil to an options object
|
885
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
908
886
|
|
909
|
-
#
|
910
|
-
|
911
|
-
# are only used when this service is used as mixin, and only
|
912
|
-
# by the host service.
|
913
|
-
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
914
|
-
config_attr :bindings_override, {}, ::Hash, nil
|
915
|
-
config_attr :logger, :default, ::Logger, nil, :default
|
887
|
+
# Customize the options with defaults
|
888
|
+
call_metadata = @config.rpcs.reschedule_cluster_maintenance.metadata.to_h
|
916
889
|
|
917
|
-
#
|
918
|
-
|
919
|
-
@
|
890
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
891
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
892
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
893
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
894
|
+
transports_version_send: [:rest]
|
920
895
|
|
921
|
-
|
896
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
897
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
898
|
+
|
899
|
+
options.apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout,
|
900
|
+
metadata: call_metadata,
|
901
|
+
retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy
|
902
|
+
|
903
|
+
options.apply_defaults timeout: @config.timeout,
|
904
|
+
metadata: @config.metadata,
|
905
|
+
retry_policy: @config.retry_policy
|
906
|
+
|
907
|
+
@cloud_redis_cluster_stub.reschedule_cluster_maintenance request, options do |result, operation|
|
908
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
909
|
+
yield result, operation if block_given?
|
910
|
+
throw :response, result
|
922
911
|
end
|
912
|
+
rescue ::Gapic::Rest::Error => e
|
913
|
+
raise ::Google::Cloud::Error.from_error(e)
|
914
|
+
end
|
923
915
|
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
916
|
+
##
|
917
|
+
# Lists all backup collections owned by a consumer project in either the
|
918
|
+
# specified location (region) or all locations.
|
919
|
+
#
|
920
|
+
# If `location_id` is specified as `-` (wildcard), then all regions
|
921
|
+
# available to the project are queried, and the results are aggregated.
|
922
|
+
#
|
923
|
+
# @overload list_backup_collections(request, options = nil)
|
924
|
+
# Pass arguments to `list_backup_collections` via a request object, either of type
|
925
|
+
# {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest} or an equivalent Hash.
|
926
|
+
#
|
927
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest, ::Hash]
|
928
|
+
# A request object representing the call parameters. Required. To specify no
|
929
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
930
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
931
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
932
|
+
#
|
933
|
+
# @overload list_backup_collections(parent: nil, page_size: nil, page_token: nil)
|
934
|
+
# Pass arguments to `list_backup_collections` via keyword arguments. Note that at
|
935
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
936
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
937
|
+
#
|
938
|
+
# @param parent [::String]
|
939
|
+
# Required. The resource name of the backupCollection location using the
|
940
|
+
# form:
|
941
|
+
# `projects/{project_id}/locations/{location_id}`
|
942
|
+
# where `location_id` refers to a GCP region.
|
943
|
+
# @param page_size [::Integer]
|
944
|
+
# Optional. The maximum number of items to return.
|
945
|
+
#
|
946
|
+
# If not specified, a default value of 1000 will be used by the service.
|
947
|
+
# Regardless of the page_size value, the response may include a partial list
|
948
|
+
# and a caller should only rely on response's
|
949
|
+
# {::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsResponse#next_page_token `next_page_token`}
|
950
|
+
# to determine if there are more clusters left to be queried.
|
951
|
+
# @param page_token [::String]
|
952
|
+
# Optional. The `next_page_token` value returned from a previous
|
953
|
+
# [ListBackupCollections] request, if any.
|
954
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
955
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>]
|
956
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
957
|
+
#
|
958
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::BackupCollection>]
|
959
|
+
#
|
960
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
961
|
+
#
|
962
|
+
# @example Basic example
|
963
|
+
# require "google/cloud/redis/cluster/v1"
|
964
|
+
#
|
965
|
+
# # Create a client object. The client can be reused for multiple calls.
|
966
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
967
|
+
#
|
968
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
969
|
+
# request = Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest.new
|
970
|
+
#
|
971
|
+
# # Call the list_backup_collections method.
|
972
|
+
# result = client.list_backup_collections request
|
973
|
+
#
|
974
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
975
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
976
|
+
# result.each do |item|
|
977
|
+
# # Each element is of type ::Google::Cloud::Redis::Cluster::V1::BackupCollection.
|
978
|
+
# p item
|
979
|
+
# end
|
980
|
+
#
|
981
|
+
def list_backup_collections request, options = nil
|
982
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
983
|
+
|
984
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupCollectionsRequest
|
985
|
+
|
986
|
+
# Converts hash and nil to an options object
|
987
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
988
|
+
|
989
|
+
# Customize the options with defaults
|
990
|
+
call_metadata = @config.rpcs.list_backup_collections.metadata.to_h
|
991
|
+
|
992
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
993
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
994
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
995
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
996
|
+
transports_version_send: [:rest]
|
997
|
+
|
998
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
999
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1000
|
+
|
1001
|
+
options.apply_defaults timeout: @config.rpcs.list_backup_collections.timeout,
|
1002
|
+
metadata: call_metadata,
|
1003
|
+
retry_policy: @config.rpcs.list_backup_collections.retry_policy
|
1004
|
+
|
1005
|
+
options.apply_defaults timeout: @config.timeout,
|
1006
|
+
metadata: @config.metadata,
|
1007
|
+
retry_policy: @config.retry_policy
|
1008
|
+
|
1009
|
+
@cloud_redis_cluster_stub.list_backup_collections request, options do |result, operation|
|
1010
|
+
result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, "backup_collections", request, result, options
|
1011
|
+
yield result, operation if block_given?
|
1012
|
+
throw :response, result
|
934
1013
|
end
|
1014
|
+
rescue ::Gapic::Rest::Error => e
|
1015
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1016
|
+
end
|
935
1017
|
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
1018
|
+
##
|
1019
|
+
# Get a backup collection.
|
1020
|
+
#
|
1021
|
+
# @overload get_backup_collection(request, options = nil)
|
1022
|
+
# Pass arguments to `get_backup_collection` via a request object, either of type
|
1023
|
+
# {::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest} or an equivalent Hash.
|
1024
|
+
#
|
1025
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest, ::Hash]
|
1026
|
+
# A request object representing the call parameters. Required. To specify no
|
1027
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1028
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1029
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1030
|
+
#
|
1031
|
+
# @overload get_backup_collection(name: nil)
|
1032
|
+
# Pass arguments to `get_backup_collection` via keyword arguments. Note that at
|
1033
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1034
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1035
|
+
#
|
1036
|
+
# @param name [::String]
|
1037
|
+
# Required. Redis backupCollection resource name using the form:
|
1038
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`
|
1039
|
+
# where `location_id` refers to a GCP region.
|
1040
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1041
|
+
# @yieldparam result [::Google::Cloud::Redis::Cluster::V1::BackupCollection]
|
1042
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1043
|
+
#
|
1044
|
+
# @return [::Google::Cloud::Redis::Cluster::V1::BackupCollection]
|
1045
|
+
#
|
1046
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1047
|
+
#
|
1048
|
+
# @example Basic example
|
1049
|
+
# require "google/cloud/redis/cluster/v1"
|
1050
|
+
#
|
1051
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1052
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
1053
|
+
#
|
1054
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1055
|
+
# request = Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest.new
|
1056
|
+
#
|
1057
|
+
# # Call the get_backup_collection method.
|
1058
|
+
# result = client.get_backup_collection request
|
1059
|
+
#
|
1060
|
+
# # The returned object is of type Google::Cloud::Redis::Cluster::V1::BackupCollection.
|
1061
|
+
# p result
|
1062
|
+
#
|
1063
|
+
def get_backup_collection request, options = nil
|
1064
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1065
|
+
|
1066
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupCollectionRequest
|
1067
|
+
|
1068
|
+
# Converts hash and nil to an options object
|
1069
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1070
|
+
|
1071
|
+
# Customize the options with defaults
|
1072
|
+
call_metadata = @config.rpcs.get_backup_collection.metadata.to_h
|
1073
|
+
|
1074
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1075
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1076
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1077
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
1078
|
+
transports_version_send: [:rest]
|
1079
|
+
|
1080
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1081
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1082
|
+
|
1083
|
+
options.apply_defaults timeout: @config.rpcs.get_backup_collection.timeout,
|
1084
|
+
metadata: call_metadata,
|
1085
|
+
retry_policy: @config.rpcs.get_backup_collection.retry_policy
|
1086
|
+
|
1087
|
+
options.apply_defaults timeout: @config.timeout,
|
1088
|
+
metadata: @config.metadata,
|
1089
|
+
retry_policy: @config.retry_policy
|
1090
|
+
|
1091
|
+
@cloud_redis_cluster_stub.get_backup_collection request, options do |result, operation|
|
1092
|
+
yield result, operation if block_given?
|
1093
|
+
end
|
1094
|
+
rescue ::Gapic::Rest::Error => e
|
1095
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1096
|
+
end
|
1097
|
+
|
1098
|
+
##
|
1099
|
+
# Lists all backups owned by a backup collection.
|
1100
|
+
#
|
1101
|
+
# @overload list_backups(request, options = nil)
|
1102
|
+
# Pass arguments to `list_backups` via a request object, either of type
|
1103
|
+
# {::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest} or an equivalent Hash.
|
1104
|
+
#
|
1105
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest, ::Hash]
|
1106
|
+
# A request object representing the call parameters. Required. To specify no
|
1107
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1108
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1109
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1110
|
+
#
|
1111
|
+
# @overload list_backups(parent: nil, page_size: nil, page_token: nil)
|
1112
|
+
# Pass arguments to `list_backups` via keyword arguments. Note that at
|
1113
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1114
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1115
|
+
#
|
1116
|
+
# @param parent [::String]
|
1117
|
+
# Required. The resource name of the backupCollection using the form:
|
1118
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}`
|
1119
|
+
# @param page_size [::Integer]
|
1120
|
+
# Optional. The maximum number of items to return.
|
1121
|
+
#
|
1122
|
+
# If not specified, a default value of 1000 will be used by the service.
|
1123
|
+
# Regardless of the page_size value, the response may include a partial list
|
1124
|
+
# and a caller should only rely on response's
|
1125
|
+
# {::Google::Cloud::Redis::Cluster::V1::ListBackupsResponse#next_page_token `next_page_token`}
|
1126
|
+
# to determine if there are more clusters left to be queried.
|
1127
|
+
# @param page_token [::String]
|
1128
|
+
# Optional. The `next_page_token` value returned from a previous
|
1129
|
+
# [ListBackupCollections] request, if any.
|
1130
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1131
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>]
|
1132
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1133
|
+
#
|
1134
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1::Backup>]
|
1135
|
+
#
|
1136
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1137
|
+
#
|
1138
|
+
# @example Basic example
|
1139
|
+
# require "google/cloud/redis/cluster/v1"
|
1140
|
+
#
|
1141
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1142
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
1143
|
+
#
|
1144
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1145
|
+
# request = Google::Cloud::Redis::Cluster::V1::ListBackupsRequest.new
|
1146
|
+
#
|
1147
|
+
# # Call the list_backups method.
|
1148
|
+
# result = client.list_backups request
|
1149
|
+
#
|
1150
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1151
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1152
|
+
# result.each do |item|
|
1153
|
+
# # Each element is of type ::Google::Cloud::Redis::Cluster::V1::Backup.
|
1154
|
+
# p item
|
1155
|
+
# end
|
1156
|
+
#
|
1157
|
+
def list_backups request, options = nil
|
1158
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1159
|
+
|
1160
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ListBackupsRequest
|
1161
|
+
|
1162
|
+
# Converts hash and nil to an options object
|
1163
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1164
|
+
|
1165
|
+
# Customize the options with defaults
|
1166
|
+
call_metadata = @config.rpcs.list_backups.metadata.to_h
|
1167
|
+
|
1168
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1169
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1170
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1171
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
1172
|
+
transports_version_send: [:rest]
|
1173
|
+
|
1174
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1175
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1176
|
+
|
1177
|
+
options.apply_defaults timeout: @config.rpcs.list_backups.timeout,
|
1178
|
+
metadata: call_metadata,
|
1179
|
+
retry_policy: @config.rpcs.list_backups.retry_policy
|
1180
|
+
|
1181
|
+
options.apply_defaults timeout: @config.timeout,
|
1182
|
+
metadata: @config.metadata,
|
1183
|
+
retry_policy: @config.retry_policy
|
1184
|
+
|
1185
|
+
@cloud_redis_cluster_stub.list_backups request, options do |result, operation|
|
1186
|
+
result = ::Gapic::Rest::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, "backups", request, result, options
|
1187
|
+
yield result, operation if block_given?
|
1188
|
+
throw :response, result
|
1189
|
+
end
|
1190
|
+
rescue ::Gapic::Rest::Error => e
|
1191
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1192
|
+
end
|
1193
|
+
|
1194
|
+
##
|
1195
|
+
# Gets the details of a specific backup.
|
1196
|
+
#
|
1197
|
+
# @overload get_backup(request, options = nil)
|
1198
|
+
# Pass arguments to `get_backup` via a request object, either of type
|
1199
|
+
# {::Google::Cloud::Redis::Cluster::V1::GetBackupRequest} or an equivalent Hash.
|
1200
|
+
#
|
1201
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::GetBackupRequest, ::Hash]
|
1202
|
+
# A request object representing the call parameters. Required. To specify no
|
1203
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1204
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1205
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1206
|
+
#
|
1207
|
+
# @overload get_backup(name: nil)
|
1208
|
+
# Pass arguments to `get_backup` via keyword arguments. Note that at
|
1209
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1210
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1211
|
+
#
|
1212
|
+
# @param name [::String]
|
1213
|
+
# Required. Redis backup resource name using the form:
|
1214
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
|
1215
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1216
|
+
# @yieldparam result [::Google::Cloud::Redis::Cluster::V1::Backup]
|
1217
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1218
|
+
#
|
1219
|
+
# @return [::Google::Cloud::Redis::Cluster::V1::Backup]
|
1220
|
+
#
|
1221
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1222
|
+
#
|
1223
|
+
# @example Basic example
|
1224
|
+
# require "google/cloud/redis/cluster/v1"
|
1225
|
+
#
|
1226
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1227
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
1228
|
+
#
|
1229
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1230
|
+
# request = Google::Cloud::Redis::Cluster::V1::GetBackupRequest.new
|
1231
|
+
#
|
1232
|
+
# # Call the get_backup method.
|
1233
|
+
# result = client.get_backup request
|
1234
|
+
#
|
1235
|
+
# # The returned object is of type Google::Cloud::Redis::Cluster::V1::Backup.
|
1236
|
+
# p result
|
1237
|
+
#
|
1238
|
+
def get_backup request, options = nil
|
1239
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1240
|
+
|
1241
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::GetBackupRequest
|
1242
|
+
|
1243
|
+
# Converts hash and nil to an options object
|
1244
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1245
|
+
|
1246
|
+
# Customize the options with defaults
|
1247
|
+
call_metadata = @config.rpcs.get_backup.metadata.to_h
|
1248
|
+
|
1249
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1250
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1251
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1252
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
1253
|
+
transports_version_send: [:rest]
|
1254
|
+
|
1255
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1256
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1257
|
+
|
1258
|
+
options.apply_defaults timeout: @config.rpcs.get_backup.timeout,
|
1259
|
+
metadata: call_metadata,
|
1260
|
+
retry_policy: @config.rpcs.get_backup.retry_policy
|
1261
|
+
|
1262
|
+
options.apply_defaults timeout: @config.timeout,
|
1263
|
+
metadata: @config.metadata,
|
1264
|
+
retry_policy: @config.retry_policy
|
1265
|
+
|
1266
|
+
@cloud_redis_cluster_stub.get_backup request, options do |result, operation|
|
1267
|
+
yield result, operation if block_given?
|
1268
|
+
end
|
1269
|
+
rescue ::Gapic::Rest::Error => e
|
1270
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1271
|
+
end
|
1272
|
+
|
1273
|
+
##
|
1274
|
+
# Deletes a specific backup.
|
1275
|
+
#
|
1276
|
+
# @overload delete_backup(request, options = nil)
|
1277
|
+
# Pass arguments to `delete_backup` via a request object, either of type
|
1278
|
+
# {::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest} or an equivalent Hash.
|
1279
|
+
#
|
1280
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest, ::Hash]
|
1281
|
+
# A request object representing the call parameters. Required. To specify no
|
1282
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1283
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1284
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1285
|
+
#
|
1286
|
+
# @overload delete_backup(name: nil, request_id: nil)
|
1287
|
+
# Pass arguments to `delete_backup` via keyword arguments. Note that at
|
1288
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1289
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1290
|
+
#
|
1291
|
+
# @param name [::String]
|
1292
|
+
# Required. Redis backup resource name using the form:
|
1293
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
|
1294
|
+
# @param request_id [::String]
|
1295
|
+
# Optional. Idempotent request UUID.
|
1296
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1297
|
+
# @yieldparam result [::Gapic::Operation]
|
1298
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1299
|
+
#
|
1300
|
+
# @return [::Gapic::Operation]
|
1301
|
+
#
|
1302
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1303
|
+
#
|
1304
|
+
# @example Basic example
|
1305
|
+
# require "google/cloud/redis/cluster/v1"
|
1306
|
+
#
|
1307
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1308
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
1309
|
+
#
|
1310
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1311
|
+
# request = Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest.new
|
1312
|
+
#
|
1313
|
+
# # Call the delete_backup method.
|
1314
|
+
# result = client.delete_backup request
|
1315
|
+
#
|
1316
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1317
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1318
|
+
# # Here is how to wait for a response.
|
1319
|
+
# result.wait_until_done! timeout: 60
|
1320
|
+
# if result.response?
|
1321
|
+
# p result.response
|
1322
|
+
# else
|
1323
|
+
# puts "No response received."
|
1324
|
+
# end
|
1325
|
+
#
|
1326
|
+
def delete_backup request, options = nil
|
1327
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1328
|
+
|
1329
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::DeleteBackupRequest
|
1330
|
+
|
1331
|
+
# Converts hash and nil to an options object
|
1332
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1333
|
+
|
1334
|
+
# Customize the options with defaults
|
1335
|
+
call_metadata = @config.rpcs.delete_backup.metadata.to_h
|
1336
|
+
|
1337
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1338
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1339
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1340
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
1341
|
+
transports_version_send: [:rest]
|
1342
|
+
|
1343
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1344
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1345
|
+
|
1346
|
+
options.apply_defaults timeout: @config.rpcs.delete_backup.timeout,
|
1347
|
+
metadata: call_metadata,
|
1348
|
+
retry_policy: @config.rpcs.delete_backup.retry_policy
|
1349
|
+
|
1350
|
+
options.apply_defaults timeout: @config.timeout,
|
1351
|
+
metadata: @config.metadata,
|
1352
|
+
retry_policy: @config.retry_policy
|
1353
|
+
|
1354
|
+
@cloud_redis_cluster_stub.delete_backup request, options do |result, operation|
|
1355
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1356
|
+
yield result, operation if block_given?
|
1357
|
+
throw :response, result
|
1358
|
+
end
|
1359
|
+
rescue ::Gapic::Rest::Error => e
|
1360
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1361
|
+
end
|
1362
|
+
|
1363
|
+
##
|
1364
|
+
# Exports a specific backup to a customer target Cloud Storage URI.
|
1365
|
+
#
|
1366
|
+
# @overload export_backup(request, options = nil)
|
1367
|
+
# Pass arguments to `export_backup` via a request object, either of type
|
1368
|
+
# {::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest} or an equivalent Hash.
|
1369
|
+
#
|
1370
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest, ::Hash]
|
1371
|
+
# A request object representing the call parameters. Required. To specify no
|
1372
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1373
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1374
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1375
|
+
#
|
1376
|
+
# @overload export_backup(gcs_bucket: nil, name: nil)
|
1377
|
+
# Pass arguments to `export_backup` via keyword arguments. Note that at
|
1378
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1379
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1380
|
+
#
|
1381
|
+
# @param gcs_bucket [::String]
|
1382
|
+
# Google Cloud Storage bucket, like "my-bucket".
|
1383
|
+
# @param name [::String]
|
1384
|
+
# Required. Redis backup resource name using the form:
|
1385
|
+
# `projects/{project_id}/locations/{location_id}/backupCollections/{backup_collection_id}/backups/{backup_id}`
|
1386
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1387
|
+
# @yieldparam result [::Gapic::Operation]
|
1388
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1389
|
+
#
|
1390
|
+
# @return [::Gapic::Operation]
|
1391
|
+
#
|
1392
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1393
|
+
#
|
1394
|
+
# @example Basic example
|
1395
|
+
# require "google/cloud/redis/cluster/v1"
|
1396
|
+
#
|
1397
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1398
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
1399
|
+
#
|
1400
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1401
|
+
# request = Google::Cloud::Redis::Cluster::V1::ExportBackupRequest.new
|
1402
|
+
#
|
1403
|
+
# # Call the export_backup method.
|
1404
|
+
# result = client.export_backup request
|
1405
|
+
#
|
1406
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1407
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1408
|
+
# # Here is how to wait for a response.
|
1409
|
+
# result.wait_until_done! timeout: 60
|
1410
|
+
# if result.response?
|
1411
|
+
# p result.response
|
1412
|
+
# else
|
1413
|
+
# puts "No response received."
|
1414
|
+
# end
|
1415
|
+
#
|
1416
|
+
def export_backup request, options = nil
|
1417
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1418
|
+
|
1419
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::ExportBackupRequest
|
1420
|
+
|
1421
|
+
# Converts hash and nil to an options object
|
1422
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1423
|
+
|
1424
|
+
# Customize the options with defaults
|
1425
|
+
call_metadata = @config.rpcs.export_backup.metadata.to_h
|
1426
|
+
|
1427
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1428
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1429
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1430
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
1431
|
+
transports_version_send: [:rest]
|
1432
|
+
|
1433
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1434
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1435
|
+
|
1436
|
+
options.apply_defaults timeout: @config.rpcs.export_backup.timeout,
|
1437
|
+
metadata: call_metadata,
|
1438
|
+
retry_policy: @config.rpcs.export_backup.retry_policy
|
1439
|
+
|
1440
|
+
options.apply_defaults timeout: @config.timeout,
|
1441
|
+
metadata: @config.metadata,
|
1442
|
+
retry_policy: @config.retry_policy
|
1443
|
+
|
1444
|
+
@cloud_redis_cluster_stub.export_backup request, options do |result, operation|
|
1445
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1446
|
+
yield result, operation if block_given?
|
1447
|
+
throw :response, result
|
1448
|
+
end
|
1449
|
+
rescue ::Gapic::Rest::Error => e
|
1450
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1451
|
+
end
|
1452
|
+
|
1453
|
+
##
|
1454
|
+
# Backup Redis Cluster.
|
1455
|
+
# If this is the first time a backup is being created, a backup collection
|
1456
|
+
# will be created at the backend, and this backup belongs to this collection.
|
1457
|
+
# Both collection and backup will have a resource name. Backup will be
|
1458
|
+
# executed for each shard. A replica (primary if nonHA) will be selected to
|
1459
|
+
# perform the execution. Backup call will be rejected if there is an ongoing
|
1460
|
+
# backup or update operation. Be aware that during preview, if the cluster's
|
1461
|
+
# internal software version is too old, critical update will be performed
|
1462
|
+
# before actual backup. Once the internal software version is updated to the
|
1463
|
+
# minimum version required by the backup feature, subsequent backups will not
|
1464
|
+
# require critical update. After preview, there will be no critical update
|
1465
|
+
# needed for backup.
|
1466
|
+
#
|
1467
|
+
# @overload backup_cluster(request, options = nil)
|
1468
|
+
# Pass arguments to `backup_cluster` via a request object, either of type
|
1469
|
+
# {::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest} or an equivalent Hash.
|
1470
|
+
#
|
1471
|
+
# @param request [::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest, ::Hash]
|
1472
|
+
# A request object representing the call parameters. Required. To specify no
|
1473
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1474
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1475
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1476
|
+
#
|
1477
|
+
# @overload backup_cluster(name: nil, ttl: nil, backup_id: nil)
|
1478
|
+
# Pass arguments to `backup_cluster` via keyword arguments. Note that at
|
1479
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1480
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1481
|
+
#
|
1482
|
+
# @param name [::String]
|
1483
|
+
# Required. Redis cluster resource name using the form:
|
1484
|
+
# `projects/{project_id}/locations/{location_id}/clusters/{cluster_id}`
|
1485
|
+
# where `location_id` refers to a GCP region.
|
1486
|
+
# @param ttl [::Google::Protobuf::Duration, ::Hash]
|
1487
|
+
# Optional. TTL for the backup to expire. Value range is 1 day to 100 years.
|
1488
|
+
# If not specified, the default value is 100 years.
|
1489
|
+
# @param backup_id [::String]
|
1490
|
+
# Optional. The id of the backup to be created. If not specified, the
|
1491
|
+
# default value ([YYYYMMDDHHMMSS]_[Shortened Cluster UID] is used.
|
1492
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1493
|
+
# @yieldparam result [::Gapic::Operation]
|
1494
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1495
|
+
#
|
1496
|
+
# @return [::Gapic::Operation]
|
1497
|
+
#
|
1498
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1499
|
+
#
|
1500
|
+
# @example Basic example
|
1501
|
+
# require "google/cloud/redis/cluster/v1"
|
1502
|
+
#
|
1503
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1504
|
+
# client = Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new
|
1505
|
+
#
|
1506
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1507
|
+
# request = Google::Cloud::Redis::Cluster::V1::BackupClusterRequest.new
|
1508
|
+
#
|
1509
|
+
# # Call the backup_cluster method.
|
1510
|
+
# result = client.backup_cluster request
|
1511
|
+
#
|
1512
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1513
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1514
|
+
# # Here is how to wait for a response.
|
1515
|
+
# result.wait_until_done! timeout: 60
|
1516
|
+
# if result.response?
|
1517
|
+
# p result.response
|
1518
|
+
# else
|
1519
|
+
# puts "No response received."
|
1520
|
+
# end
|
1521
|
+
#
|
1522
|
+
def backup_cluster request, options = nil
|
1523
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1524
|
+
|
1525
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1::BackupClusterRequest
|
1526
|
+
|
1527
|
+
# Converts hash and nil to an options object
|
1528
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1529
|
+
|
1530
|
+
# Customize the options with defaults
|
1531
|
+
call_metadata = @config.rpcs.backup_cluster.metadata.to_h
|
1532
|
+
|
1533
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1534
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1535
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1536
|
+
gapic_version: ::Google::Cloud::Redis::Cluster::V1::VERSION,
|
1537
|
+
transports_version_send: [:rest]
|
1538
|
+
|
1539
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1540
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1541
|
+
|
1542
|
+
options.apply_defaults timeout: @config.rpcs.backup_cluster.timeout,
|
1543
|
+
metadata: call_metadata,
|
1544
|
+
retry_policy: @config.rpcs.backup_cluster.retry_policy
|
1545
|
+
|
1546
|
+
options.apply_defaults timeout: @config.timeout,
|
1547
|
+
metadata: @config.metadata,
|
1548
|
+
retry_policy: @config.retry_policy
|
1549
|
+
|
1550
|
+
@cloud_redis_cluster_stub.backup_cluster request, options do |result, operation|
|
1551
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1552
|
+
yield result, operation if block_given?
|
1553
|
+
throw :response, result
|
1554
|
+
end
|
1555
|
+
rescue ::Gapic::Rest::Error => e
|
1556
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1557
|
+
end
|
1558
|
+
|
1559
|
+
##
|
1560
|
+
# Configuration class for the CloudRedisCluster REST API.
|
1561
|
+
#
|
1562
|
+
# This class represents the configuration for CloudRedisCluster REST,
|
1563
|
+
# providing control over timeouts, retry behavior, logging, transport
|
1564
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
1565
|
+
# applied individually to specific RPCs. See
|
1566
|
+
# {::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client::Configuration::Rpcs}
|
1567
|
+
# for a list of RPCs that can be configured independently.
|
1568
|
+
#
|
1569
|
+
# Configuration can be applied globally to all clients, or to a single client
|
1570
|
+
# on construction.
|
1571
|
+
#
|
1572
|
+
# @example
|
1573
|
+
#
|
1574
|
+
# # Modify the global config, setting the timeout for
|
1575
|
+
# # list_clusters to 20 seconds,
|
1576
|
+
# # and all remaining timeouts to 10 seconds.
|
1577
|
+
# ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.configure do |config|
|
1578
|
+
# config.timeout = 10.0
|
1579
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
1580
|
+
# end
|
1581
|
+
#
|
1582
|
+
# # Apply the above configuration only to a new client.
|
1583
|
+
# client = ::Google::Cloud::Redis::Cluster::V1::CloudRedisCluster::Rest::Client.new do |config|
|
1584
|
+
# config.timeout = 10.0
|
1585
|
+
# config.rpcs.list_clusters.timeout = 20.0
|
1586
|
+
# end
|
1587
|
+
#
|
1588
|
+
# @!attribute [rw] endpoint
|
1589
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1590
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1591
|
+
# @return [::String,nil]
|
1592
|
+
# @!attribute [rw] credentials
|
1593
|
+
# Credentials to send with calls. You may provide any of the following types:
|
1594
|
+
# * (`String`) The path to a service account key file in JSON format
|
1595
|
+
# * (`Hash`) A service account key as a Hash
|
1596
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1597
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
1598
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1599
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1600
|
+
# * (`nil`) indicating no credentials
|
1601
|
+
#
|
1602
|
+
# Warning: If you accept a credential configuration (JSON file or Hash) from an
|
1603
|
+
# external source for authentication to Google Cloud, you must validate it before
|
1604
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
1605
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
1606
|
+
# For more information, refer to [Validate credential configurations from external
|
1607
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
1608
|
+
# @return [::Object]
|
1609
|
+
# @!attribute [rw] scope
|
1610
|
+
# The OAuth scopes
|
1611
|
+
# @return [::Array<::String>]
|
1612
|
+
# @!attribute [rw] lib_name
|
1613
|
+
# The library name as recorded in instrumentation and logging
|
1614
|
+
# @return [::String]
|
1615
|
+
# @!attribute [rw] lib_version
|
1616
|
+
# The library version as recorded in instrumentation and logging
|
1617
|
+
# @return [::String]
|
1618
|
+
# @!attribute [rw] timeout
|
1619
|
+
# The call timeout in seconds.
|
1620
|
+
# @return [::Numeric]
|
1621
|
+
# @!attribute [rw] metadata
|
1622
|
+
# Additional headers to be sent with the call.
|
1623
|
+
# @return [::Hash{::Symbol=>::String}]
|
1624
|
+
# @!attribute [rw] retry_policy
|
1625
|
+
# The retry policy. The value is a hash with the following keys:
|
1626
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1627
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1628
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1629
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1630
|
+
# trigger a retry.
|
1631
|
+
# @return [::Hash]
|
1632
|
+
# @!attribute [rw] quota_project
|
1633
|
+
# A separate project against which to charge quota.
|
1634
|
+
# @return [::String]
|
1635
|
+
# @!attribute [rw] universe_domain
|
1636
|
+
# The universe domain within which to make requests. This determines the
|
1637
|
+
# default endpoint URL. The default value of nil uses the environment
|
1638
|
+
# universe (usually the default "googleapis.com" universe).
|
1639
|
+
# @return [::String,nil]
|
1640
|
+
# @!attribute [rw] logger
|
1641
|
+
# A custom logger to use for request/response debug logging, or the value
|
1642
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
1643
|
+
# explicitly disable logging.
|
1644
|
+
# @return [::Logger,:default,nil]
|
1645
|
+
#
|
1646
|
+
class Configuration
|
1647
|
+
extend ::Gapic::Config
|
1648
|
+
|
1649
|
+
# @private
|
1650
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1651
|
+
DEFAULT_ENDPOINT = "redis.googleapis.com"
|
1652
|
+
|
1653
|
+
config_attr :endpoint, nil, ::String, nil
|
1654
|
+
config_attr :credentials, nil do |value|
|
1655
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1656
|
+
allowed.any? { |klass| klass === value }
|
1657
|
+
end
|
1658
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1659
|
+
config_attr :lib_name, nil, ::String, nil
|
1660
|
+
config_attr :lib_version, nil, ::String, nil
|
1661
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1662
|
+
config_attr :metadata, nil, ::Hash, nil
|
1663
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1664
|
+
config_attr :quota_project, nil, ::String, nil
|
1665
|
+
config_attr :universe_domain, nil, ::String, nil
|
1666
|
+
|
1667
|
+
# @private
|
1668
|
+
# Overrides for http bindings for the RPCs of this service
|
1669
|
+
# are only used when this service is used as mixin, and only
|
1670
|
+
# by the host service.
|
1671
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1672
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
1673
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
1674
|
+
|
1675
|
+
# @private
|
1676
|
+
def initialize parent_config = nil
|
1677
|
+
@parent_config = parent_config unless parent_config.nil?
|
1678
|
+
|
1679
|
+
yield self if block_given?
|
1680
|
+
end
|
1681
|
+
|
1682
|
+
##
|
1683
|
+
# Configurations for individual RPCs
|
1684
|
+
# @return [Rpcs]
|
1685
|
+
#
|
1686
|
+
def rpcs
|
1687
|
+
@rpcs ||= begin
|
1688
|
+
parent_rpcs = nil
|
1689
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1690
|
+
Rpcs.new parent_rpcs
|
1691
|
+
end
|
1692
|
+
end
|
1693
|
+
|
1694
|
+
##
|
1695
|
+
# Configuration RPC class for the CloudRedisCluster API.
|
1696
|
+
#
|
1697
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1698
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
941
1699
|
# the following configuration fields:
|
942
1700
|
#
|
943
1701
|
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
@@ -981,6 +1739,46 @@ module Google
|
|
981
1739
|
# @return [::Gapic::Config::Method]
|
982
1740
|
#
|
983
1741
|
attr_reader :get_cluster_certificate_authority
|
1742
|
+
##
|
1743
|
+
# RPC-specific configuration for `reschedule_cluster_maintenance`
|
1744
|
+
# @return [::Gapic::Config::Method]
|
1745
|
+
#
|
1746
|
+
attr_reader :reschedule_cluster_maintenance
|
1747
|
+
##
|
1748
|
+
# RPC-specific configuration for `list_backup_collections`
|
1749
|
+
# @return [::Gapic::Config::Method]
|
1750
|
+
#
|
1751
|
+
attr_reader :list_backup_collections
|
1752
|
+
##
|
1753
|
+
# RPC-specific configuration for `get_backup_collection`
|
1754
|
+
# @return [::Gapic::Config::Method]
|
1755
|
+
#
|
1756
|
+
attr_reader :get_backup_collection
|
1757
|
+
##
|
1758
|
+
# RPC-specific configuration for `list_backups`
|
1759
|
+
# @return [::Gapic::Config::Method]
|
1760
|
+
#
|
1761
|
+
attr_reader :list_backups
|
1762
|
+
##
|
1763
|
+
# RPC-specific configuration for `get_backup`
|
1764
|
+
# @return [::Gapic::Config::Method]
|
1765
|
+
#
|
1766
|
+
attr_reader :get_backup
|
1767
|
+
##
|
1768
|
+
# RPC-specific configuration for `delete_backup`
|
1769
|
+
# @return [::Gapic::Config::Method]
|
1770
|
+
#
|
1771
|
+
attr_reader :delete_backup
|
1772
|
+
##
|
1773
|
+
# RPC-specific configuration for `export_backup`
|
1774
|
+
# @return [::Gapic::Config::Method]
|
1775
|
+
#
|
1776
|
+
attr_reader :export_backup
|
1777
|
+
##
|
1778
|
+
# RPC-specific configuration for `backup_cluster`
|
1779
|
+
# @return [::Gapic::Config::Method]
|
1780
|
+
#
|
1781
|
+
attr_reader :backup_cluster
|
984
1782
|
|
985
1783
|
# @private
|
986
1784
|
def initialize parent_rpcs = nil
|
@@ -996,6 +1794,22 @@ module Google
|
|
996
1794
|
@create_cluster = ::Gapic::Config::Method.new create_cluster_config
|
997
1795
|
get_cluster_certificate_authority_config = parent_rpcs.get_cluster_certificate_authority if parent_rpcs.respond_to? :get_cluster_certificate_authority
|
998
1796
|
@get_cluster_certificate_authority = ::Gapic::Config::Method.new get_cluster_certificate_authority_config
|
1797
|
+
reschedule_cluster_maintenance_config = parent_rpcs.reschedule_cluster_maintenance if parent_rpcs.respond_to? :reschedule_cluster_maintenance
|
1798
|
+
@reschedule_cluster_maintenance = ::Gapic::Config::Method.new reschedule_cluster_maintenance_config
|
1799
|
+
list_backup_collections_config = parent_rpcs.list_backup_collections if parent_rpcs.respond_to? :list_backup_collections
|
1800
|
+
@list_backup_collections = ::Gapic::Config::Method.new list_backup_collections_config
|
1801
|
+
get_backup_collection_config = parent_rpcs.get_backup_collection if parent_rpcs.respond_to? :get_backup_collection
|
1802
|
+
@get_backup_collection = ::Gapic::Config::Method.new get_backup_collection_config
|
1803
|
+
list_backups_config = parent_rpcs.list_backups if parent_rpcs.respond_to? :list_backups
|
1804
|
+
@list_backups = ::Gapic::Config::Method.new list_backups_config
|
1805
|
+
get_backup_config = parent_rpcs.get_backup if parent_rpcs.respond_to? :get_backup
|
1806
|
+
@get_backup = ::Gapic::Config::Method.new get_backup_config
|
1807
|
+
delete_backup_config = parent_rpcs.delete_backup if parent_rpcs.respond_to? :delete_backup
|
1808
|
+
@delete_backup = ::Gapic::Config::Method.new delete_backup_config
|
1809
|
+
export_backup_config = parent_rpcs.export_backup if parent_rpcs.respond_to? :export_backup
|
1810
|
+
@export_backup = ::Gapic::Config::Method.new export_backup_config
|
1811
|
+
backup_cluster_config = parent_rpcs.backup_cluster if parent_rpcs.respond_to? :backup_cluster
|
1812
|
+
@backup_cluster = ::Gapic::Config::Method.new backup_cluster_config
|
999
1813
|
|
1000
1814
|
yield self if block_given?
|
1001
1815
|
end
|