Google Cloud AlloyDB for PostgreSQL V1beta Client - Class Instance (0.8.0)

Reference documentation and code samples for the Google Cloud AlloyDB for PostgreSQL V1beta Client class Instance.

An Instance is a computing unit that an end customer can connect to.

It's the main unit of computing resources in AlloyDB.

Generated from protobuf message google.cloud.alloydb.v1beta.Instance

Namespace

Google \ Cloud \ AlloyDb \ V1beta

Methods

__construct

Constructor.

Parameters
NameDescription
data array

Optional. Data for populating the Message object.

↳ name string

Output only. The name of the instance resource with the format: * projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} where the cluster and instance ID segments should satisfy the regex expression [a-z]([a-z0-9-]{0,61}[a-z0-9])?, e.g. 1-63 characters of lowercase letters, numbers, and dashes, starting with a letter, and ending with a letter or number. For more details see https://google.aip.dev/122. The prefix of the instance resource name is the name of the parent resource: * projects/{project}/locations/{region}/clusters/{cluster_id}

↳ display_name string

User-settable and human-readable display name for the Instance.

↳ uid string

Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

↳ create_time Google\Protobuf\Timestamp

Output only. Create time stamp

↳ update_time Google\Protobuf\Timestamp

Output only. Update time stamp

↳ delete_time Google\Protobuf\Timestamp

Output only. Delete time stamp

↳ labels array|Google\Protobuf\Internal\MapField

Labels as key value pairs

↳ state int

Output only. The current serving state of the instance.

↳ instance_type int

Required. The type of the instance. Specified at creation time.

↳ machine_config Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig

Configurations for the machines that host the underlying database engine.

↳ availability_type int

Availability type of an Instance. If empty, defaults to REGIONAL for primary instances. For read pools, availability_type is always UNSPECIFIED. Instances in the read pools are evenly distributed across available zones within the region (i.e. read pools with more than one node will have a node in at least two zones).

↳ gce_zone string

The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances. If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.

↳ database_flags array|Google\Protobuf\Internal\MapField

Database flags. Set at instance level. * They are copied from primary instance on read instance creation. * Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary. This is a list of "key": "value" pairs. "key": The name of the flag. These flags are passed at instance setup time, so include both server options and system variables for Postgres. Flags are specified with underscores, not hyphens. "value": The value of the flag. Booleans are set to on for true and off for false. This field must be omitted if the flag doesn't take a value.

↳ writable_node Google\Cloud\AlloyDb\V1beta\Instance\Node

Output only. This is set for the read-write VM of the PRIMARY instance only.

↳ nodes array<Google\Cloud\AlloyDb\V1beta\Instance\Node>

Output only. List of available read-only VMs in this instance, including the standby for a PRIMARY instance.

↳ query_insights_config Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig

Configuration for query insights.

↳ read_pool_config Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig

Read pool specific config.

↳ ip_address string

Output only. The IP address for the Instance. This is the connection endpoint for an end-user application.

↳ reconciling bool

Output only. Reconciling (https://google.aip.dev/128#reconciliation). Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.

↳ etag string

For Resource freshness validation (https://google.aip.dev/154)

↳ annotations array|Google\Protobuf\Internal\MapField

Annotations to allow client tools to store small amount of arbitrary data. This is distinct from labels. https://google.aip.dev/128

↳ update_policy Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy

Update policy that will be applied during instance update. This field is not persisted when you update the instance. To use a non-default update policy, you must specify explicitly specify the value in each update request.

↳ client_connection_config Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig

Optional. Client connection specific configurations

getName

Output only. The name of the instance resource with the format:

  • projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} where the cluster and instance ID segments should satisfy the regex expression [a-z]([a-z0-9-]{0,61}[a-z0-9])?, e.g. 1-63 characters of lowercase letters, numbers, and dashes, starting with a letter, and ending with a letter or number. For more details see https://google.aip.dev/122.

The prefix of the instance resource name is the name of the parent resource:

  • projects/{project}/locations/{region}/clusters/{cluster_id}
Returns
TypeDescription
string

setName

Output only. The name of the instance resource with the format:

  • projects/{project}/locations/{region}/clusters/{cluster_id}/instances/{instance_id} where the cluster and instance ID segments should satisfy the regex expression [a-z]([a-z0-9-]{0,61}[a-z0-9])?, e.g. 1-63 characters of lowercase letters, numbers, and dashes, starting with a letter, and ending with a letter or number. For more details see https://google.aip.dev/122.

The prefix of the instance resource name is the name of the parent resource:

  • projects/{project}/locations/{region}/clusters/{cluster_id}
Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDisplayName

User-settable and human-readable display name for the Instance.

Returns
TypeDescription
string

setDisplayName

User-settable and human-readable display name for the Instance.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getUid

Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

Returns
TypeDescription
string

setUid

Output only. The system-generated UID of the resource. The UID is assigned when the resource is created, and it is retained until it is deleted.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getCreateTime

Output only. Create time stamp

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasCreateTime

clearCreateTime

setCreateTime

Output only. Create time stamp

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getUpdateTime

Output only. Update time stamp

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasUpdateTime

clearUpdateTime

setUpdateTime

Output only. Update time stamp

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getDeleteTime

Output only. Delete time stamp

Returns
TypeDescription
Google\Protobuf\Timestamp|null

hasDeleteTime

clearDeleteTime

setDeleteTime

Output only. Delete time stamp

Parameter
NameDescription
var Google\Protobuf\Timestamp
Returns
TypeDescription
$this

getLabels

Labels as key value pairs

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setLabels

Labels as key value pairs

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getState

Output only. The current serving state of the instance.

Returns
TypeDescription
int

setState

Output only. The current serving state of the instance.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getInstanceType

Required. The type of the instance. Specified at creation time.

Returns
TypeDescription
int

setInstanceType

Required. The type of the instance. Specified at creation time.

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getMachineConfig

Configurations for the machines that host the underlying database engine.

Returns
TypeDescription
Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig|null

hasMachineConfig

clearMachineConfig

setMachineConfig

Configurations for the machines that host the underlying database engine.

Parameter
NameDescription
var Google\Cloud\AlloyDb\V1beta\Instance\MachineConfig
Returns
TypeDescription
$this

getAvailabilityType

Availability type of an Instance.

If empty, defaults to REGIONAL for primary instances. For read pools, availability_type is always UNSPECIFIED. Instances in the read pools are evenly distributed across available zones within the region (i.e. read pools with more than one node will have a node in at least two zones).

Returns
TypeDescription
int

setAvailabilityType

Availability type of an Instance.

If empty, defaults to REGIONAL for primary instances. For read pools, availability_type is always UNSPECIFIED. Instances in the read pools are evenly distributed across available zones within the region (i.e. read pools with more than one node will have a node in at least two zones).

Parameter
NameDescription
var int
Returns
TypeDescription
$this

getGceZone

The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances.

If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.

Returns
TypeDescription
string

setGceZone

The Compute Engine zone that the instance should serve from, per https://cloud.google.com/compute/docs/regions-zones This can ONLY be specified for ZONAL instances.

If present for a REGIONAL instance, an error will be thrown. If this is absent for a ZONAL instance, instance is created in a random zone with available capacity.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getDatabaseFlags

Database flags. Set at instance level.

  • They are copied from primary instance on read instance creation.
    • Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary. This is a list of "key": "value" pairs. "key": The name of the flag. These flags are passed at instance setup time, so include both server options and system variables for Postgres. Flags are specified with underscores, not hyphens. "value": The value of the flag. Booleans are set to on for true and off for false. This field must be omitted if the flag doesn't take a value.
Returns
TypeDescription
Google\Protobuf\Internal\MapField

setDatabaseFlags

Database flags. Set at instance level.

  • They are copied from primary instance on read instance creation.
    • Read instances can set new or override existing flags that are relevant for reads, e.g. for enabling columnar cache on a read instance. Flags set on read instance may or may not be present on primary. This is a list of "key": "value" pairs. "key": The name of the flag. These flags are passed at instance setup time, so include both server options and system variables for Postgres. Flags are specified with underscores, not hyphens. "value": The value of the flag. Booleans are set to on for true and off for false. This field must be omitted if the flag doesn't take a value.
Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getWritableNode

Output only. This is set for the read-write VM of the PRIMARY instance only.

Returns
TypeDescription
Google\Cloud\AlloyDb\V1beta\Instance\Node|null

hasWritableNode

clearWritableNode

setWritableNode

Output only. This is set for the read-write VM of the PRIMARY instance only.

Parameter
NameDescription
var Google\Cloud\AlloyDb\V1beta\Instance\Node
Returns
TypeDescription
$this

getNodes

Output only. List of available read-only VMs in this instance, including the standby for a PRIMARY instance.

Returns
TypeDescription
Google\Protobuf\Internal\RepeatedField

setNodes

Output only. List of available read-only VMs in this instance, including the standby for a PRIMARY instance.

Parameter
NameDescription
var array<Google\Cloud\AlloyDb\V1beta\Instance\Node>
Returns
TypeDescription
$this

getQueryInsightsConfig

Configuration for query insights.

Returns
TypeDescription
Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig|null

hasQueryInsightsConfig

clearQueryInsightsConfig

setQueryInsightsConfig

Configuration for query insights.

Parameter
NameDescription
var Google\Cloud\AlloyDb\V1beta\Instance\QueryInsightsInstanceConfig
Returns
TypeDescription
$this

getReadPoolConfig

Read pool specific config.

Returns
TypeDescription
Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig|null

hasReadPoolConfig

clearReadPoolConfig

setReadPoolConfig

Read pool specific config.

Parameter
NameDescription
var Google\Cloud\AlloyDb\V1beta\Instance\ReadPoolConfig
Returns
TypeDescription
$this

getIpAddress

Output only. The IP address for the Instance.

This is the connection endpoint for an end-user application.

Returns
TypeDescription
string

setIpAddress

Output only. The IP address for the Instance.

This is the connection endpoint for an end-user application.

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getReconciling

Output only. Reconciling (https://google.aip.dev/128#reconciliation).

Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.

Returns
TypeDescription
bool

setReconciling

Output only. Reconciling (https://google.aip.dev/128#reconciliation).

Set to true if the current state of Instance does not match the user's intended state, and the service is actively updating the resource to reconcile them. This can happen due to user-triggered updates or system actions like failover or maintenance.

Parameter
NameDescription
var bool
Returns
TypeDescription
$this

getEtag

For Resource freshness validation (https://google.aip.dev/154)

Returns
TypeDescription
string

setEtag

For Resource freshness validation (https://google.aip.dev/154)

Parameter
NameDescription
var string
Returns
TypeDescription
$this

getAnnotations

Annotations to allow client tools to store small amount of arbitrary data.

This is distinct from labels. https://google.aip.dev/128

Returns
TypeDescription
Google\Protobuf\Internal\MapField

setAnnotations

Annotations to allow client tools to store small amount of arbitrary data.

This is distinct from labels. https://google.aip.dev/128

Parameter
NameDescription
var array|Google\Protobuf\Internal\MapField
Returns
TypeDescription
$this

getUpdatePolicy

Update policy that will be applied during instance update.

This field is not persisted when you update the instance. To use a non-default update policy, you must specify explicitly specify the value in each update request.

Returns
TypeDescription
Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy|null

hasUpdatePolicy

clearUpdatePolicy

setUpdatePolicy

Update policy that will be applied during instance update.

This field is not persisted when you update the instance. To use a non-default update policy, you must specify explicitly specify the value in each update request.

Parameter
NameDescription
var Google\Cloud\AlloyDb\V1beta\Instance\UpdatePolicy
Returns
TypeDescription
$this

getClientConnectionConfig

Optional. Client connection specific configurations

Returns
TypeDescription
Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig|null

hasClientConnectionConfig

clearClientConnectionConfig

setClientConnectionConfig

Optional. Client connection specific configurations

Parameter
NameDescription
var Google\Cloud\AlloyDb\V1beta\Instance\ClientConnectionConfig
Returns
TypeDescription
$this