Google Cloud Memorystore for Memcached V1 API - Class Google::Cloud::Memcache::V1::CloudMemcache::Client (v1.2.0)
Stay organized with collections
Save and categorize content based on your preferences.
Reference documentation and code samples for the Google Cloud Memorystore for Memcached V1 API class Google::Cloud::Memcache::V1::CloudMemcache::Client.
Client for the CloudMemcache service.
Configures and manages Cloud Memorystore for Memcached instances.
The memcache.googleapis.com service implements the Google Cloud Memorystore
for Memcached API and defines the following resource model for managing
Memorystore Memcached (also called Memcached below) instances:
- 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 Memcached instances, named:
/instances/* - As such, Memcached instances are resources of the form:
/projects/{project_id}/locations/{location_id}/instances/{instance_id}
Note that location_id must be a GCP region; for example:
projects/my-memcached-project/locations/us-central1/instances/my-memcached
Inherits
- Object
Methods
.configure
defself.configure(){|config|...}->Client::ConfigurationConfigure the CloudMemcache Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all CloudMemcache clients ::Google::Cloud::Memcache::V1::CloudMemcache::Client.configuredo|config| config.timeout=10.0 end
#apply_parameters
defapply_parameters(request,options=nil)->::Gapic::Operation
defapply_parameters(name:nil,node_ids:nil,apply_all:nil)->::Gapic::OperationApplyParameters restarts the set of specified nodes in order to update
them to the current set of parameters for the Memcached Instance.
defapply_parameters(request,options=nil)->::Gapic::Operationapply_parameters via a request object, either of type
ApplyParametersRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::ApplyParametersRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
defapply_parameters(name:nil,node_ids:nil,apply_all:nil)->::Gapic::Operationapply_parameters via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. Resource name of the Memcached instance for which parameter group updates should be applied.
- node_ids (::Array<::String>) — Nodes to which the instance-level parameter group is applied.
-
apply_all (::Boolean) — Whether to apply instance-level parameter group to all nodes. If set to
true, users are restricted from specifying individual nodes, and
ApplyParametersupdates all nodes within the instance.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::ApplyParametersRequest.new # Call the apply_parameters method. result=client.apply_parametersrequest # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done!timeout:60 ifresult.response? presult.response else puts"No response received." end
#configure
defconfigure(){|config|...}->Client::ConfigurationConfigure the CloudMemcache 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 Client.configure .
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_instance
defcreate_instance(request,options=nil)->::Gapic::Operation
defcreate_instance(parent:nil,instance_id:nil,instance:nil)->::Gapic::OperationCreates a new Instance in a given location.
defcreate_instance(request,options=nil)->::Gapic::Operationcreate_instance via a request object, either of type
Google::Cloud::Memcache::V1::CreateInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::CreateInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
defcreate_instance(parent:nil,instance_id:nil,instance:nil)->::Gapic::Operationcreate_instance via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the instance location using the form:
projects/{project_id}/locations/{location_id}wherelocation_idrefers to a GCP region -
instance_id (::String) — Required. The logical name of the Memcached instance in the user
project with the following restrictions:
- Must contain only lowercase letters, numbers, and hyphens.
- Must start with a letter.
- Must be between 1-40 characters.
- Must end with a number or a letter.
- Must be unique within the user project / location.
If any of the above are not met, the API raises an invalid argument error.
- instance (::Google::Cloud::Memcache::V1::Instance, ::Hash) — Required. A Memcached Instance
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::CreateInstanceRequest.new # Call the create_instance method. result=client.create_instancerequest # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done!timeout:60 ifresult.response? presult.response else puts"No response received." end
#delete_instance
defdelete_instance(request,options=nil)->::Gapic::Operation
defdelete_instance(name:nil)->::Gapic::OperationDeletes a single Instance.
defdelete_instance(request,options=nil)->::Gapic::Operationdelete_instance via a request object, either of type
DeleteInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::DeleteInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
defdelete_instance(name:nil)->::Gapic::Operationdelete_instance via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Memcached instance resource name in the format:
projects/{project_id}/locations/{location_id}/instances/{instance_id}wherelocation_idrefers to a GCP region
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::DeleteInstanceRequest.new # Call the delete_instance method. result=client.delete_instancerequest # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done!timeout:60 ifresult.response? presult.response else puts"No response received." end
#get_instance
defget_instance(request,options=nil)->::Google::Cloud::Memcache::V1::Instance
defget_instance(name:nil)->::Google::Cloud::Memcache::V1::InstanceGets details of a single Instance.
defget_instance(request,options=nil)->::Google::Cloud::Memcache::V1::Instanceget_instance via a request object, either of type
GetInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::GetInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
defget_instance(name:nil)->::Google::Cloud::Memcache::V1::Instanceget_instance via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
name (::String) — Required. Memcached instance resource name in the format:
projects/{project_id}/locations/{location_id}/instances/{instance_id}wherelocation_idrefers to a GCP region
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Memcache::V1::Instance)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::GetInstanceRequest.new # Call the get_instance method. result=client.get_instancerequest # The returned object is of type Google::Cloud::Memcache::V1::Instance. presult
#initialize
definitialize(){|config|...}->ClientCreate a new CloudMemcache client object.
- (config) — Configure the CloudMemcache client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client=::Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a client using a custom configuration client=::Google::Cloud::Memcache::V1::CloudMemcache::Client.newdo|config| config.timeout=10.0 end
#list_instances
deflist_instances(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Memcache::V1::Instance>
deflist_instances(parent:nil,page_size:nil,page_token:nil,filter:nil,order_by:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Memcache::V1::Instance>Lists Instances in a given location.
deflist_instances(request,options=nil)->::Gapic::PagedEnumerable<::Google::Cloud::Memcache::V1::Instance>list_instances via a request object, either of type
ListInstancesRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::ListInstancesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
deflist_instances(parent:nil,page_size:nil,page_token:nil,filter:nil,order_by:nil)->::Gapic::PagedEnumerable<::Google::Cloud::Memcache::V1::Instance>list_instances via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
parent (::String) — Required. The resource name of the instance location using the form:
projects/{project_id}/locations/{location_id}wherelocation_idrefers to a GCP region -
page_size (::Integer) — The maximum number of items to return.
If not specified, a default value of 1000 will be used by the service. Regardless of the
page_sizevalue, the response may include a partial list and a caller should only rely on response'snext_page_tokento determine if there are more instances left to be queried. -
page_token (::String) — The
next_page_tokenvalue returned from a previous List request, if any. -
filter (::String) — List filter. For example, exclude all Memcached instances with name as
my-instance by specifying
"name != my-instance". - order_by (::String) — Sort results. Supported values are "name", "name desc" or "" (unsorted).
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Memcache::V1::Instance>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Memcache::V1::Instance>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::ListInstancesRequest.new # Call the list_instances method. result=client.list_instancesrequest # The returned object is of type Gapic::PagedEnumerable. You can iterate # over elements, and API calls will be issued to fetch pages as needed. result.eachdo|item| # Each element is of type ::Google::Cloud::Memcache::V1::Instance. pitem end
#location_client
deflocation_client()->Google::Cloud::Location::Locations::ClientGet the associated client for mix-in of the Locations.
- (Google::Cloud::Location::Locations::Client)
#logger
deflogger()->LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
defoperations_client()->::Google::Cloud::Memcache::V1::CloudMemcache::OperationsGet the associated client for long-running operations.
#reschedule_maintenance
defreschedule_maintenance(request,options=nil)->::Gapic::Operation
defreschedule_maintenance(instance:nil,reschedule_type:nil,schedule_time:nil)->::Gapic::OperationReschedules upcoming maintenance event.
defreschedule_maintenance(request,options=nil)->::Gapic::Operationreschedule_maintenance via a request object, either of type
RescheduleMaintenanceRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
defreschedule_maintenance(instance:nil,reschedule_type:nil,schedule_time:nil)->::Gapic::Operationreschedule_maintenance via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
instance (::String) — Required. Memcache instance resource name using the form:
projects/{project_id}/locations/{location_id}/instances/{instance_id}wherelocation_idrefers to a GCP region. - reschedule_type (::Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest::RescheduleType) — Required. If reschedule type is SPECIFIC_TIME, must set up schedule_time as well.
-
schedule_time (::Google::Protobuf::Timestamp, ::Hash) — Timestamp when the maintenance shall be rescheduled to if
reschedule_type=SPECIFIC_TIME, in RFC 3339 format, for
example
2012年11月15日T16:19:00.094Z.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::RescheduleMaintenanceRequest.new # Call the reschedule_maintenance method. result=client.reschedule_maintenancerequest # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done!timeout:60 ifresult.response? presult.response else puts"No response received." end
#universe_domain
defuniverse_domain()->StringThe effective universe domain
- (String)
#update_instance
defupdate_instance(request,options=nil)->::Gapic::Operation
defupdate_instance(update_mask:nil,instance:nil)->::Gapic::OperationUpdates an existing Instance in a given project and location.
defupdate_instance(request,options=nil)->::Gapic::Operationupdate_instance via a request object, either of type
UpdateInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::UpdateInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
defupdate_instance(update_mask:nil,instance:nil)->::Gapic::Operationupdate_instance via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
-
update_mask (::Google::Protobuf::FieldMask, ::Hash) —
Required. Mask of fields to update.
-
displayName
-
- instance (::Google::Cloud::Memcache::V1::Instance, ::Hash) — Required. A Memcached Instance. Only fields specified in update_mask are updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::UpdateInstanceRequest.new # Call the update_instance method. result=client.update_instancerequest # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done!timeout:60 ifresult.response? presult.response else puts"No response received." end
#update_parameters
defupdate_parameters(request,options=nil)->::Gapic::Operation
defupdate_parameters(name:nil,update_mask:nil,parameters:nil)->::Gapic::OperationUpdates the defined Memcached parameters for an existing instance.
This method only stages the parameters, it must be followed by
ApplyParameters to apply the parameters to nodes of the Memcached
instance.
defupdate_parameters(request,options=nil)->::Gapic::Operationupdate_parameters via a request object, either of type
UpdateParametersRequest or an equivalent Hash.
- request (::Google::Cloud::Memcache::V1::UpdateParametersRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
defupdate_parameters(name:nil,update_mask:nil,parameters:nil)->::Gapic::Operationupdate_parameters via keyword arguments. Note that at
least one keyword argument is required. To specify no parameters, or to keep all
the default parameter values, pass an empty Hash as a request object (see above).
- name (::String) — Required. Resource name of the Memcached instance for which the parameters should be updated.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Mask of fields to update.
- parameters (::Google::Cloud::Memcache::V1::MemcacheParameters, ::Hash) — The parameters to apply to the instance.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require"google/cloud/memcache/v1" # Create a client object. The client can be reused for multiple calls. client=Google::Cloud::Memcache::V1::CloudMemcache::Client.new # Create a request. To set request fields, pass in keyword arguments. request=Google::Cloud::Memcache::V1::UpdateParametersRequest.new # Call the update_parameters method. result=client.update_parametersrequest # The returned object is of type Gapic::Operation. You can use it to # check the status of an operation, cancel it, or wait for results. # Here is how to wait for a response. result.wait_until_done!timeout:60 ifresult.response? presult.response else puts"No response received." end