# Memorystore for Memcached V1 Client - Class Instance (2.1.2)

2.1.2 (latest) 2.1.1 2.0.4 1.3.5 1.2.2 1.1.1 1.0.5 Reference documentation and code samples for the Memorystore for Memcached V1 Client class Instance.

A Memorystore for Memcached instance

Generated from protobuf message `google.cloud.memcache.v1.Instance`

## Namespace

Google \\ Cloud \\ Memcache \\ V1

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ name` | `string` Required. 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](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance#_Google_Cloud_Memcache_V1_Instance__getZones__) field for more details. |
| `↳ display_name` | `string` User provided name for the instance, which is only used for display purposes. Cannot be more than 80 characters. |
| `↳ labels` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. <https://cloud.google.com/compute/docs/labeling-resources> |
| `↳ authorized_network` | `string` The full name of the Google Compute Engine [network](https://docs.cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the instance is connected. If left unspecified, the `default` network will be used. |
| `↳ zones` | `string[]` Zones 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. |
| `↳ node_count` | `int` Required. Number of nodes in the Memcached instance. |
| `↳ node_config` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.NodeConfig` Required. Configuration for Memcached nodes. |
| `↳ memcache_version` | `int` The 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. |
| `↳ parameters` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MemcacheParameters` User defined parameters to apply to the memcached process on each node. |
| `↳ memcache_nodes` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.Node>` Output only. List of Memcached nodes. Refer to [Node](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.Node) message for more details. |
| `↳ create_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the instance was created. |
| `↳ update_time` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` Output only. The time the instance was updated. |
| `↳ state` | `int` Output only. The state of this Memcached instance. |
| `↳ memcache_full_version` | `string` Output 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". |
| `↳ instance_messages` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.InstanceMessage>` List of messages that describe the current state of the Memcached instance. |
| `↳ discovery_endpoint` | `string` Output only. Endpoint for the Discovery API. |
| `↳ maintenance_policy` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MaintenancePolicy` The maintenance policy for the instance. If not provided, the maintenance event will be performed based on Memorystore internal rollout schedule. |
| `↳ maintenance_schedule` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MaintenanceSchedule` Output only. Published maintenance schedule. |

### getName

Required. 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](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance#_Google_Cloud_Memcache_V1_Instance__getZones__) field for more details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Required. 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](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance#_Google_Cloud_Memcache_V1_Instance__getZones__) field for more details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisplayName

User provided name for the instance, which is only used for display
purposes. Cannot be more than 80 characters.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDisplayName

User provided name for the instance, which is only used for display
purposes. Cannot be more than 80 characters.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLabels

Resource labels to represent user-provided metadata.

Refer to cloud documentation on labels for more details.
<https://cloud.google.com/compute/docs/labeling-resources>

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |   |

### setLabels

Resource labels to represent user-provided metadata.

Refer to cloud documentation on labels for more details.
<https://cloud.google.com/compute/docs/labeling-resources>

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array|https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Internal/MapField` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getAuthorizedNetwork

The full name of the Google Compute Engine
[network](https://docs.cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
instance is connected. If left unspecified, the `default` network
will be used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setAuthorizedNetwork

The full name of the Google Compute Engine
[network](https://docs.cloud.google.com/compute/docs/networks-and-firewalls#networks) to which the
instance is connected. If left unspecified, the `default` network
will be used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getZones

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<string>` |   |

### setZones

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string[]` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNodeCount

Required. Number of nodes in the Memcached instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` |   |

### setNodeCount

Required. Number of nodes in the Memcached instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getNodeConfig

Required. Configuration for Memcached nodes.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.NodeConfig|null` |   |

### hasNodeConfig

### clearNodeConfig

### setNodeConfig

Required. Configuration for Memcached nodes.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.NodeConfig` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMemcacheVersion

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

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [MemcacheVersion](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MemcacheVersion). |

### setMemcacheVersion

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [MemcacheVersion](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MemcacheVersion). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getParameters

User defined parameters to apply to the memcached process
on each node.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MemcacheParameters|null` |   |

### hasParameters

### clearParameters

### setParameters

User defined parameters to apply to the memcached process
on each node.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MemcacheParameters` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMemcacheNodes

Output only. List of Memcached nodes.

Refer to [Node](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.Node) message for more details.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.Node>` |   |

### setMemcacheNodes

Output only. List of Memcached nodes.

Refer to [Node](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.Node) message for more details.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.Node>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getCreateTime

Output only. The time the instance was created.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasCreateTime

### clearCreateTime

### setCreateTime

Output only. The time the instance was created.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getUpdateTime

Output only. The time the instance was updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The time the instance was updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getState

Output only. The state of this Memcached instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.State). |

### setState

Output only. The state of this Memcached instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [State](https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.State). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMemcacheFullVersion

Output 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".

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setMemcacheFullVersion

Output 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".

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInstanceMessages

List of messages that describe the current state of the Memcached instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.InstanceMessage>` |   |

### setInstanceMessages

List of messages that describe the current state of the Memcached instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.Instance.InstanceMessage>` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDiscoveryEndpoint

Output only. Endpoint for the Discovery API.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDiscoveryEndpoint

Output only. Endpoint for the Discovery API.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMaintenancePolicy

The maintenance policy for the instance. If not provided,
the maintenance event will be performed based on Memorystore
internal rollout schedule.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MaintenancePolicy|null` |   |

### hasMaintenancePolicy

### clearMaintenancePolicy

### setMaintenancePolicy

The maintenance policy for the instance. If not provided,
the maintenance event will be performed based on Memorystore
internal rollout schedule.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MaintenancePolicy` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMaintenanceSchedule

Output only. Published maintenance schedule.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MaintenanceSchedule|null` |   |

### hasMaintenanceSchedule

### clearMaintenanceSchedule

### setMaintenanceSchedule

Output only. Published maintenance schedule.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-memcache/latest/V1.MaintenanceSchedule` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |