Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idgoogle.memcache.instances

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringRequired. Unique name of the resource in this scope including project and location using the form: projects/{project_id}/locations/{location_id}/instances/{instance_id} Note: Memcached instances are managed and addressed at the regional level so location_id here refers to a Google Cloud region; however, users may choose which zones Memcached nodes should be provisioned in within an instance. Refer to zones field for more details.
authorizedNetworkstringThe full name of the Google Compute Engine network to which the instance is connected. If left unspecified, the default network will be used.
createTimestring (google-datetime)Output only. The time the instance was created.
discoveryEndpointstringOutput only. Endpoint for the Discovery API.
displayNamestringUser provided name for the instance, which is only used for display purposes. Cannot be more than 80 characters.
instanceMessagesarrayList of messages that describe the current state of the Memcached instance.
labelsobjectResource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
maintenancePolicyobjectThe maintenance policy for the instance. If not provided, the maintenance event will be performed based on Memorystore internal rollout schedule. (id: GoogleCloudMemcacheV1MaintenancePolicy)
maintenanceScheduleobjectOutput only. Published maintenance schedule. (id: MaintenanceSchedule)
memcacheFullVersionstringOutput only. The full version of memcached server running on this instance. System automatically determines the full memcached version for an instance based on the input MemcacheVersion. The full version format will be "memcached-1.5.16".
memcacheNodesarrayOutput only. List of Memcached nodes. Refer to Node message for more details.
memcacheVersionstringThe major version of Memcached software. If not provided, latest supported version will be used. Currently the latest supported major version is MEMCACHE_1_5. The minor version will be automatically determined by our system based on the latest supported minor version.
nodeConfigobjectRequired. Configuration for Memcached nodes. (id: NodeConfig)
nodeCountinteger (int32)Required. Number of nodes in the Memcached instance.
parametersobjectUser defined parameters to apply to the memcached process on each node. (id: MemcacheParameters)
reservedIpRangeIdarrayOptional. Contains the id of allocated IP address ranges associated with the private service access connection for example, "test-default" associated with IP range 10.0.0.0/29.
satisfiesPzibooleanOptional. Output only. Reserved for future use.
satisfiesPzsbooleanOptional. Output only. Reserved for future use.
statestringOutput only. The state of this Memcached instance.
updateTimestring (google-datetime)Output only. The time the instance was updated.
zonesarrayZones in which Memcached nodes should be provisioned. Memcached nodes will be equally distributed across these zones. If not provided, the service will by default create nodes in all zones in the region for the instance.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, instancesIdGets details of a single Instance.
listselectprojectsId, locationsIdpageSize, pageToken, filter, orderByLists Instances in a given location.
createinsertprojectsId, locationsIdinstanceIdCreates a new Instance in a given location.
patchupdateprojectsId, locationsId, instancesIdupdateMaskUpdates an existing Instance in a given project and location.
deletedeleteprojectsId, locationsId, instancesIdDeletes a single Instance.
apply_parametersexecprojectsId, locationsId, instancesIdApplyParameters restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.
reschedule_maintenanceexecprojectsId, locationsId, instancesIdReschedules upcoming maintenance event.
upgradeexecprojectsId, locationsId, instancesIdUpgrades the Memcache instance to a newer memcached engine version specified in the request.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
instancesIdstring
locationsIdstring
projectsIdstring
filterstring
instanceIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets details of a single Instance.

SELECT
name,
authorizedNetwork,
createTime,
discoveryEndpoint,
displayName,
instanceMessages,
labels,
maintenancePolicy,
maintenanceSchedule,
memcacheFullVersion,
memcacheNodes,
memcacheVersion,
nodeConfig,
nodeCount,
parameters,
reservedIpRangeId,
satisfiesPzi,
satisfiesPzs,
state,
updateTime,
zones
FROM google.memcache.instances
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required;

INSERT examples

Creates a new Instance in a given location.

INSERT INTO google.memcache.instances (
data__name,
data__displayName,
data__labels,
data__authorizedNetwork,
data__zones,
data__nodeCount,
data__nodeConfig,
data__memcacheVersion,
data__parameters,
data__instanceMessages,
data__maintenancePolicy,
data__reservedIpRangeId,
projectsId,
locationsId,
instanceId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ labels }}',
'{{ authorizedNetwork }}',
'{{ zones }}',
{{ nodeCount }},
'{{ nodeConfig }}',
'{{ memcacheVersion }}',
'{{ parameters }}',
'{{ instanceMessages }}',
'{{ maintenancePolicy }}',
'{{ reservedIpRangeId }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ instanceId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates an existing Instance in a given project and location.

UPDATE google.memcache.instances
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__labels = '{{ labels }}',
data__authorizedNetwork = '{{ authorizedNetwork }}',
data__zones = '{{ zones }}',
data__nodeCount = {{ nodeCount }},
data__nodeConfig = '{{ nodeConfig }}',
data__memcacheVersion = '{{ memcacheVersion }}',
data__parameters = '{{ parameters }}',
data__instanceMessages = '{{ instanceMessages }}',
data__maintenancePolicy = '{{ maintenancePolicy }}',
data__reservedIpRangeId = '{{ reservedIpRangeId }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a single Instance.

DELETE FROM google.memcache.instances
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND instancesId = '{{ instancesId }}' --required;

Lifecycle Methods

ApplyParameters restarts the set of specified nodes in order to update them to the current set of parameters for the Memcached Instance.

EXEC google.memcache.instances.apply_parameters 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@instancesId='{{ instancesId }}' --required
@@json=
'{
"nodeIds": "{{ nodeIds }}",
"applyAll": {{ applyAll }}
}';