0.16.0 (latest) 0.15.0 0.14.0 0.13.3 0.12.0 0.10.0 0.9.0 0.8.0 0.7.0 0.6.2 0.5.1 0.4.2 0.3.0 0.2.0 0.1.1

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Cloud Memorystore V1beta Client class CrossInstanceReplicationConfig.

Cross instance replication config.

Generated from protobuf message `google.cloud.memorystore.v1beta.CrossInstanceReplicationConfig`

## Namespace

Google \\ Cloud \\ Memorystore \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ instance_role` | `int` Required. The role of the instance in cross instance replication. |
| `↳ primary_instance` | `https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.RemoteInstance` Optional. Details of the primary instance that is used as the replication source for this secondary instance. This field is only set for a secondary instance. |
| `↳ secondary_instances` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.RemoteInstance>` Optional. List of secondary instances that are replicating from this primary instance. This field is only set for a primary instance. |
| `↳ update_time` | `Google\Protobuf\Timestamp` Output only. The last time cross instance replication config was updated. |
| `↳ membership` | `https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.Membership` Output only. An output only view of all the member instances participating in the cross instance replication. This view will be provided by every member instance irrespective of its instance role(primary or secondary). A primary instance can provide information about all the secondary instances replicating from it. However, a secondary instance only knows about the primary instance from which it is replicating. However, for scenarios, where the primary instance is unavailable(e.g. regional outage), a Getinstance request can be sent to any other member instance and this field will list all the member instances participating in cross instance replication. |

### getInstanceRole

Required. The role of the instance in cross instance replication.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [InstanceRole](https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.InstanceRole). |

### setInstanceRole

Required. The role of the instance in cross instance replication.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [InstanceRole](https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.InstanceRole). |

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

### getPrimaryInstance

Optional. Details of the primary instance that is used as the replication
source for this secondary instance.

This field is only set for a secondary instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.RemoteInstance|null` |   |

### hasPrimaryInstance

### clearPrimaryInstance

### setPrimaryInstance

Optional. Details of the primary instance that is used as the replication
source for this secondary instance.

This field is only set for a secondary instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.RemoteInstance` |

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

### getSecondaryInstances

Optional. List of secondary instances that are replicating from this
primary instance.

This field is only set for a primary instance.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.RemoteInstance>` |   |

### setSecondaryInstances

Optional. List of secondary instances that are replicating from this
primary instance.

This field is only set for a primary instance.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.RemoteInstance>` |

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

### getUpdateTime

Output only. The last time cross instance replication config was updated.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\Timestamp|null` |   |

### hasUpdateTime

### clearUpdateTime

### setUpdateTime

Output only. The last time cross instance replication config was updated.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Protobuf\Timestamp` |

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

### getMembership

Output only. An output only view of all the member instances participating
in the cross instance replication. This view will be provided by every
member instance irrespective of its instance role(primary or secondary).

A primary instance can provide information about all the secondary
instances replicating from it. However, a secondary instance only knows
about the primary instance from which it is replicating. However, for
scenarios, where the primary instance is unavailable(e.g. regional outage),
a Getinstance request can be sent to any other member instance and this
field will list all the member instances participating in cross instance
replication.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.Membership|null` |   |

### hasMembership

### clearMembership

### setMembership

Output only. An output only view of all the member instances participating
in the cross instance replication. This view will be provided by every
member instance irrespective of its instance role(primary or secondary).

A primary instance can provide information about all the secondary
instances replicating from it. However, a secondary instance only knows
about the primary instance from which it is replicating. However, for
scenarios, where the primary instance is unavailable(e.g. regional outage),
a Getinstance request can be sent to any other member instance and this
field will list all the member instances participating in cross instance
replication.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/cloud-memorystore/latest/V1beta.CrossInstanceReplicationConfig.Membership` |

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