Class: Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client
- Inherits:
-
Object
- Object
- Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Client
- Includes:
- Paths
- Defined in:
- lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb
Overview
Client for the CloudRedisCluster service.
Configures and manages Cloud Memorystore for Redis clusters
Google Cloud Memorystore for Redis Cluster
The redis.googleapis.com
service implements the Google Cloud Memorystore
for Redis API and defines the following resource model for managing Redis
clusters:
- The service works with a collection of cloud projects, named:
/projects/*
- Each project has a collection of available locations, named:
/locations/*
- Each location has a collection of Redis clusters, named:
/clusters/*
- As such, Redis clusters are resources of the form:
/projects/{project_id}/locations/{location_id}/clusters/{instance_id}
Note that location_id must be a GCP region
; for example:
projects/redpepper-1290/locations/us-central1/clusters/my-redis
Defined Under Namespace
Classes: Configuration
Instance Attribute Summary collapse
-
#location_client ⇒ Google::Cloud::Location::Locations::Client
readonly
Get the associated client for mix-in of the Locations.
-
#operations_client ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations
readonly
Get the associated client for long-running operations.
Class Method Summary collapse
-
.configure {|config| ... } ⇒ Client::Configuration
Configure the CloudRedisCluster Client class.
Instance Method Summary collapse
-
#backup_cluster(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Backup Redis Cluster.
-
#configure {|config| ... } ⇒ Client::Configuration
Configure the CloudRedisCluster Client instance.
-
#create_cluster(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Creates a Redis cluster based on the specified properties.
-
#delete_backup(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Deletes a specific backup.
-
#delete_cluster(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Deletes a specific Redis cluster.
-
#export_backup(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Exports a specific backup to a customer target Cloud Storage URI.
-
#get_backup(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::Backup
Gets the details of a specific backup.
-
#get_backup_collection(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection
Get a backup collection.
-
#get_cluster(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::Cluster
Gets the details of a specific Redis cluster.
-
#get_cluster_certificate_authority(request, options = nil) {|response, operation| ... } ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority
Gets the details of certificate authority information for Redis cluster.
-
#initialize {|config| ... } ⇒ Client
constructor
Create a new CloudRedisCluster client object.
-
#list_backup_collections(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>
Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.
-
#list_backups(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>
Lists all backups owned by a backup collection.
-
#list_clusters(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>
Lists all Redis clusters owned by a project in either the specified location (region) or all locations.
-
#logger ⇒ Logger
The logger used for request/response debug logging.
-
#reschedule_cluster_maintenance(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Reschedules upcoming maintenance event.
-
#universe_domain ⇒ String
The effective universe domain.
-
#update_cluster(request, options = nil) {|response, operation| ... } ⇒ ::Gapic::Operation
Updates the metadata and configuration of a specific Redis cluster.
Methods included from Paths
#backup_collection_path, #backup_path, #certificate_authority_path, #cluster_path, #crypto_key_path, #crypto_key_version_path, #forwarding_rule_path, #location_path, #network_path, #service_attachment_path
Constructor Details
#initialize {|config| ... } ⇒ Client
Create a new CloudRedisCluster client object.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 168 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/cloud/redis/cluster/v1beta1/cloud_redis_cluster_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint.nil? || (@config.endpoint == Configuration::DEFAULT_ENDPOINT && !@config.endpoint.split(".").first.include?("-")) credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @config.endpoint config.universe_domain = @config.universe_domain end @cloud_redis_cluster_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Stub, credentials: credentials, endpoint: @config.endpoint, endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, universe_domain: @config.universe_domain, channel_args: @config.channel_args, interceptors: @config.interceptors, channel_pool_config: @config.channel_pool, logger: @config.logger ) @cloud_redis_cluster_stub.stub_logger&.info do |entry| entry.set_system_name entry.set_service entry. = "Created client for #{entry.service}" entry.set_credentials_fields credentials entry.set "customEndpoint", @config.endpoint if @config.endpoint entry.set "defaultTimeout", @config.timeout if @config.timeout entry.set "quotaProject", @quota_project_id if @quota_project_id end @location_client = Google::Cloud::Location::Locations::Client.new do |config| config.credentials = credentials config.quota_project = @quota_project_id config.endpoint = @cloud_redis_cluster_stub.endpoint config.universe_domain = @cloud_redis_cluster_stub.universe_domain config.logger = @cloud_redis_cluster_stub.logger if config.respond_to? :logger= end end |
Instance Attribute Details
#location_client ⇒ Google::Cloud::Location::Locations::Client (readonly)
Get the associated client for mix-in of the Locations.
246 247 248 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 246 def location_client @location_client end |
#operations_client ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::CloudRedisCluster::Operations (readonly)
Get the associated client for long-running operations.
239 240 241 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 239 def operations_client @operations_client end |
Class Method Details
.configure {|config| ... } ⇒ Client::Configuration
Configure the CloudRedisCluster Client class.
See Configuration for a description of the configuration fields.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 78 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "Redis", "Cluster", "V1beta1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config.rpcs.list_clusters.timeout = 600.0 default_config.rpcs.get_cluster.timeout = 600.0 default_config.rpcs.update_cluster.timeout = 600.0 default_config.rpcs.delete_cluster.timeout = 600.0 default_config.rpcs.create_cluster.timeout = 600.0 default_config.rpcs..timeout = 600.0 default_config.rpcs.reschedule_cluster_maintenance.timeout = 600.0 default_config.rpcs.list_backup_collections.timeout = 600.0 default_config.rpcs.get_backup_collection.timeout = 600.0 default_config.rpcs.list_backups.timeout = 600.0 default_config.rpcs.get_backup.timeout = 600.0 default_config.rpcs.delete_backup.timeout = 600.0 default_config.rpcs.export_backup.timeout = 600.0 default_config.rpcs.backup_cluster.timeout = 600.0 default_config end yield @configure if block_given? @configure end |
Instance Method Details
#backup_cluster(request, options = nil) ⇒ ::Gapic::Operation #backup_cluster(name: nil, ttl: nil, backup_id: nil) ⇒ ::Gapic::Operation
Backup Redis Cluster. If this is the first time a backup is being created, a backup collection will be created at the backend, and this backup belongs to this collection. Both collection and backup will have a resource name. Backup will be executed for each shard. A replica (primary if nonHA) will be selected to perform the execution. Backup call will be rejected if there is an ongoing backup or update operation. Be aware that during preview, if the cluster's internal software version is too old, critical update will be performed before actual backup. Once the internal software version is updated to the minimum version required by the backup feature, subsequent backups will not require critical update. After preview, there will be no critical update needed for backup.
1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 1620 def backup_cluster request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::BackupClusterRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.backup_cluster..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.backup_cluster.timeout, metadata: , retry_policy: @config.rpcs.backup_cluster.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :backup_cluster, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#configure {|config| ... } ⇒ Client::Configuration
Configure the CloudRedisCluster Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.
See Configuration for a description of the configuration fields.
138 139 140 141 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 138 def configure yield @config if block_given? @config end |
#create_cluster(request, options = nil) ⇒ ::Gapic::Operation #create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) ⇒ ::Gapic::Operation
Creates a Redis cluster based on the specified properties. The creation is executed asynchronously and callers may check the returned operation to track its progress. Once the operation is completed the Redis cluster will be fully functional. The completed longrunning.Operation will contain the new cluster object in the response field.
The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 738 def create_cluster request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::CreateClusterRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.create_cluster..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.create_cluster.timeout, metadata: , retry_policy: @config.rpcs.create_cluster.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :create_cluster, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_backup(request, options = nil) ⇒ ::Gapic::Operation #delete_backup(name: nil, request_id: nil) ⇒ ::Gapic::Operation
Deletes a specific backup.
1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 1410 def delete_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_backup.timeout, metadata: , retry_policy: @config.rpcs.delete_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :delete_backup, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#delete_cluster(request, options = nil) ⇒ ::Gapic::Operation #delete_cluster(name: nil, request_id: nil) ⇒ ::Gapic::Operation
Deletes a specific Redis cluster. Cluster stops serving and data is deleted.
622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 622 def delete_cluster request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::DeleteClusterRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.delete_cluster..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.delete_cluster.timeout, metadata: , retry_policy: @config.rpcs.delete_cluster.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :delete_cluster, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#export_backup(request, options = nil) ⇒ ::Gapic::Operation #export_backup(gcs_bucket: nil, name: nil) ⇒ ::Gapic::Operation
Exports a specific backup to a customer target Cloud Storage URI.
1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 1507 def export_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ExportBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.export_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.export_backup.timeout, metadata: , retry_policy: @config.rpcs.export_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :export_backup, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_backup(request, options = nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::Backup #get_backup(name: nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::Backup
Gets the details of a specific backup.
1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 1315 def get_backup request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_backup..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_backup.timeout, metadata: , retry_policy: @config.rpcs.get_backup.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :get_backup, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_backup_collection(request, options = nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection #get_backup_collection(name: nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection
Get a backup collection.
1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 1126 def get_backup_collection request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetBackupCollectionRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_backup_collection..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_backup_collection.timeout, metadata: , retry_policy: @config.rpcs.get_backup_collection.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :get_backup_collection, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_cluster(request, options = nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::Cluster #get_cluster(name: nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::Cluster
Gets the details of a specific Redis cluster.
417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 417 def get_cluster request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.get_cluster..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.get_cluster.timeout, metadata: , retry_policy: @config.rpcs.get_cluster.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :get_cluster, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#get_cluster_certificate_authority(request, options = nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority #get_cluster_certificate_authority(name: nil) ⇒ ::Google::Cloud::Redis::Cluster::V1beta1::CertificateAuthority
Gets the details of certificate authority information for Redis cluster.
827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 827 def request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::GetClusterCertificateAuthorityRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs...to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs..timeout, metadata: , retry_policy: @config.rpcs..retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :get_cluster_certificate_authority, request, options: do |response, operation| yield response, operation if block_given? end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_backup_collections(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection> #list_backup_collections(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::BackupCollection>
Lists all backup collections owned by a consumer project in either the specified location (region) or all locations.
If location_id
is specified as -
(wildcard), then all regions
available to the project are queried, and the results are aggregated.
1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 1037 def list_backup_collections request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupCollectionsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_backup_collections..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_backup_collections.timeout, metadata: , retry_policy: @config.rpcs.list_backup_collections.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :list_backup_collections, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backup_collections, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_backups(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup> #list_backups(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Backup>
Lists all backups owned by a backup collection.
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 1227 def list_backups request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListBackupsRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_backups..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_backups.timeout, metadata: , retry_policy: @config.rpcs.list_backups.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :list_backups, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_backups, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#list_clusters(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster> #list_clusters(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Redis::Cluster::V1beta1::Cluster>
Lists all Redis clusters owned by a project in either the specified location (region) or all locations.
The location should have the following format:
projects/{project_id}/locations/{location_id}
If location_id
is specified as -
(wildcard), then all regions
available to the project are queried, and the results are aggregated.
328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 328 def list_clusters request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::ListClustersRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.list_clusters..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.parent header_params["parent"] = request.parent end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.list_clusters.timeout, metadata: , retry_policy: @config.rpcs.list_clusters.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :list_clusters, request, options: do |response, operation| response = ::Gapic::PagedEnumerable.new @cloud_redis_cluster_stub, :list_clusters, request, response, operation, yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#logger ⇒ Logger
The logger used for request/response debug logging.
253 254 255 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 253 def logger @cloud_redis_cluster_stub.logger end |
#reschedule_cluster_maintenance(request, options = nil) ⇒ ::Gapic::Operation #reschedule_cluster_maintenance(name: nil, reschedule_type: nil, schedule_time: nil) ⇒ ::Gapic::Operation
Reschedules upcoming maintenance event.
928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 928 def reschedule_cluster_maintenance request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::RescheduleClusterMaintenanceRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.reschedule_cluster_maintenance..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.name header_params["name"] = request.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.reschedule_cluster_maintenance.timeout, metadata: , retry_policy: @config.rpcs.reschedule_cluster_maintenance.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :reschedule_cluster_maintenance, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |
#universe_domain ⇒ String
The effective universe domain
148 149 150 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 148 def universe_domain @cloud_redis_cluster_stub.universe_domain end |
#update_cluster(request, options = nil) ⇒ ::Gapic::Operation #update_cluster(update_mask: nil, cluster: nil, request_id: nil) ⇒ ::Gapic::Operation
Updates the metadata and configuration of a specific Redis cluster.
Completed longrunning.Operation will contain the new cluster object in the response field. The returned operation is automatically deleted after a few hours, so there is no need to call DeleteOperation.
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 |
# File 'lib/google/cloud/redis/cluster/v1beta1/cloud_redis_cluster/client.rb', line 523 def update_cluster request, = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Redis::Cluster::V1beta1::UpdateClusterRequest # Converts hash and nil to an options object = ::Gapic::CallOptions.new(**.to_h) if .respond_to? :to_h # Customize the options with defaults = @config.rpcs.update_cluster..to_h # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::Redis::Cluster::V1beta1::VERSION [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty? [:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = {} if request.cluster&.name header_params["cluster.name"] = request.cluster.name end request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") [:"x-goog-request-params"] ||= request_params_header .apply_defaults timeout: @config.rpcs.update_cluster.timeout, metadata: , retry_policy: @config.rpcs.update_cluster.retry_policy .apply_defaults timeout: @config.timeout, metadata: @config., retry_policy: @config.retry_policy @cloud_redis_cluster_stub.call_rpc :update_cluster, request, options: do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: yield response, operation if block_given? throw :response, response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end |