CloudMemcacheClient

CloudMemcacheClient

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 refering to a GCP region; for example:

  • projects/my-memcached-project/locations/us-central1/instances/my-memcached

Constructor

new CloudMemcacheClient(optionsopt)

Construct an instance of CloudMemcacheClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. See the subsequent parameters for more details.

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

apiEndpoint string <optional>

The domain name of the API remote host.

Members

(static) apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

(static) port

The port for this API service.

(static) scopes

The scopes needed to make gRPC calls for every method defined in this service.

(static) servicePath

The DNS address for this API service.

Methods

applyParameters(request, optionsopt) → {Promise}

ApplyParameters will update current set of Parameters to the set of specified nodes of the Memcached Instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the Memcached instance for which parameter group updates should be applied.

nodeIds Array.<string>

Nodes to which we should apply the instance-level parameter group.

applyAll boolean

Whether to apply instance-level parameter group to all nodes. If set to true, will explicitly restrict users from specifying any nodes, and apply parameter group updates to all nodes within the instance.

options object <optional>

Call options. See CallOptions for more details.

(async) checkApplyParametersProgress(name) → {Promise}

Check the status of the long running operation returned by the applyParameters() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkCreateInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by the createInstance() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkDeleteInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by the deleteInstance() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkUpdateInstanceProgress(name) → {Promise}

Check the status of the long running operation returned by the updateInstance() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

(async) checkUpdateParametersProgress(name) → {Promise}

Check the status of the long running operation returned by the updateParameters() method.

Parameters:
Name Type Description
name String

The operation name that will be passed.

close()

Terminate the GRPC channel and close the client.

The client will no longer be usable and all future behavior is undefined.

createInstance(request, optionsopt) → {Promise}

Creates a new Instance in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The resource name of the instance location using the form: projects/{project_id}/locations/{location_id} where location_id refers to a GCP region

instanceId 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
resource google.cloud.memcache.v1beta2.Instance

Required. A Memcached [Instance] resource

options object <optional>

Call options. See CallOptions for more details.

deleteInstance(request, optionsopt) → {Promise}

Deletes a single Instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Memcached instance resource name in the format: projects/{project_id}/locations/{location_id}/instances/{instance_id} where location_id refers to a GCP region

options object <optional>

Call options. See CallOptions for more details.

getInstance(request, optionsopt) → {Promise}

Gets details of a single Instance.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Memcached instance resource name in the format: projects/{project_id}/locations/{location_id}/instances/{instance_id} where location_id refers to a GCP region

options object <optional>

Call options. See CallOptions for more details.

getProjectId(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

initialize() → {Promise}

Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.

You can await on this method if you want to make sure the client is initialized.

instancePath(project, location, instance) → {string}

Return a fully-qualified instance resource name string.

Parameters:
Name Type Description
project string
location string
instance string

listInstances(request, optionsopt) → {Promise}

Lists Instances in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The resource name of the instance location using the form: projects/{project_id}/locations/{location_id} where location_id refers to a GCP region

pageSize number

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_size value, the response may include a partial list and a caller should only rely on response's next_page_token to determine if there are more instances left to be queried.

pageToken string

The next_page_token value 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".

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

options object <optional>

Call options. See CallOptions for more details.

listInstancesAsync(request, optionsopt) → {Object}

Equivalent to listInstances, but returns an iterable object.

for-await-of syntax is used with the iterable to recursively get response element on-demand.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The resource name of the instance location using the form: projects/{project_id}/locations/{location_id} where location_id refers to a GCP region

pageSize number

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_size value, the response may include a partial list and a caller should only rely on response's next_page_token to determine if there are more instances left to be queried.

pageToken string

The next_page_token value 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".

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

options object <optional>

Call options. See CallOptions for more details.

listInstancesStream(request, optionsopt) → {Stream}

Equivalent to listInstances, but returns a NodeJS Stream object.

This fetches the paged responses for listInstances continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. The resource name of the instance location using the form: projects/{project_id}/locations/{location_id} where location_id refers to a GCP region

pageSize number

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_size value, the response may include a partial list and a caller should only rely on response's next_page_token to determine if there are more instances left to be queried.

pageToken string

The next_page_token value 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".

orderBy string

Sort results. Supported values are "name", "name desc" or "" (unsorted).

options object <optional>

Call options. See CallOptions for more details.

See:

locationPath(project, location) → {string}

Return a fully-qualified location resource name string.

Parameters:
Name Type Description
project string
location string

matchInstanceFromInstanceName(instanceName) → {string}

Parse the instance from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

matchLocationFromInstanceName(instanceName) → {string}

Parse the location from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

matchLocationFromLocationName(locationName) → {string}

Parse the location from Location resource.

Parameters:
Name Type Description
locationName string

A fully-qualified path representing Location resource.

matchProjectFromInstanceName(instanceName) → {string}

Parse the project from Instance resource.

Parameters:
Name Type Description
instanceName string

A fully-qualified path representing Instance resource.

matchProjectFromLocationName(locationName) → {string}

Parse the project from Location resource.

Parameters:
Name Type Description
locationName string

A fully-qualified path representing Location resource.

updateInstance(request, optionsopt) → {Promise}

Updates an existing Instance in a given project and location.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
updateMask google.protobuf.FieldMask

Required. Mask of fields to update.

  • displayName
resource google.cloud.memcache.v1beta2.Instance

Required. A Memcached [Instance] resource. Only fields specified in update_mask are updated.

options object <optional>

Call options. See CallOptions for more details.

updateParameters(request, optionsopt) → {Promise}

Updates 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.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. Resource name of the Memcached instance for which the parameters should be updated.

updateMask google.protobuf.FieldMask

Required. Mask of fields to update.

parameters google.cloud.memcache.v1beta2.MemcacheParameters

The parameters to apply to the instance.

options object <optional>

Call options. See CallOptions for more details.