REST Resource: projects.locations.clusters.instances

Resource: Instance

An Instance is a computing unit that an end customer can connect to. It's the main unit of computing resources in AlloyDB.

JSON representation
{
  "name": string,
  "displayName": string,
  "uid": string,
  "createTime": string,
  "updateTime": string,
  "deleteTime": string,
  "labels": {
    string: string,
    ...
  },
  "state": enum (State),
  "instanceType": enum (InstanceType),
  "machineConfig": {
    object (MachineConfig)
  },
  "availabilityType": enum (AvailabilityType),
  "gceZone": string,
  "databaseFlags": {
    string: string,
    ...
  },
  "writableNode": {
    object (Node)
  },
  "nodes": [
    {
      object (Node)
    }
  ],
  "queryInsightsConfig": {
    object (QueryInsightsInstanceConfig)
  },
  "observabilityConfig": {
    object (ObservabilityInstanceConfig)
  },
  "readPoolConfig": {
    object (ReadPoolConfig)
  },
  "ipAddress": string,
  "publicIpAddress": string,
  "reconciling": boolean,
  "etag": string,
  "annotations": {
    string: string,
    ...
  },
  "updatePolicy": {
    object (UpdatePolicy)
  },
  "clientConnectionConfig": {
    object (ClientConnectionConfig)
  },
  "satisfiesPzs": boolean,
  "pscInstanceConfig": {
    object (PscInstanceConfig)
  },
  "networkConfig": {
    object (InstanceNetworkConfig)
  },
  "geminiConfig": {
    object (GeminiInstanceConfig)
  },
  "outboundPublicIpAddresses": [
    string
  ]
}
Fields
name

string

Output only. The name of the instance resource with the format: * projects/{project}/locations/{region}/clusters/{clusterId}/instances/{instanceId} 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/{clusterId}

displayName

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.

createTime

string (Timestamp format)

Output only. Create time stamp

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

updateTime

string (Timestamp format)

Output only. Update time stamp

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

deleteTime

string (Timestamp format)

Output only. Delete time stamp

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

labels

map (key: string, value: string)

Labels as key value pairs

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

state

enum (State)

Output only. The current serving state of the instance.

instanceType

enum (InstanceType)

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

machineConfig

object (MachineConfig)

Configurations for the machines that host the underlying database engine.

availabilityType

enum (AvailabilityType)

Availability type of an Instance. If empty, defaults to REGIONAL for primary instances. For read pools, availabilityType 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).

gceZone

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.

databaseFlags

map (key: string, value: string)

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.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

writableNode

object (Node)

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

nodes[]

object (Node)

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

queryInsightsConfig

object (QueryInsightsInstanceConfig)

Configuration for query insights.

observabilityConfig

object (ObservabilityInstanceConfig)

Configuration for observability.

readPoolConfig

object (ReadPoolConfig)

Read pool instance configuration. This is required if the value of instanceType is READ_POOL.

ipAddress

string

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

publicIpAddress

string

Output only. The public IP addresses for the Instance. This is available ONLY when enablePublicIp is set. This is the connection endpoint for an end-user application.

reconciling

boolean

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

map (key: string, value: string)

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

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

updatePolicy

object (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.

clientConnectionConfig

object (ClientConnectionConfig)

Optional. Client connection specific configurations

satisfiesPzs

boolean

Output only. Reserved for future use.

pscInstanceConfig

object (PscInstanceConfig)

Optional. The configuration for Private Service Connect (PSC) for the instance.

networkConfig

object (InstanceNetworkConfig)

Optional. Instance level network configuration.

geminiConfig

object (GeminiInstanceConfig)

Optional. Configuration parameters related to the Gemini in Databases add-on.

outboundPublicIpAddresses[]

string

Output only. All outbound public IP addresses configured for the instance.

State

Instance State

Enums
STATE_UNSPECIFIED The state of the instance is unknown.
READY The instance is active and running.
STOPPED The instance is stopped. Instance name and IP resources are preserved.
CREATING The instance is being created.
DELETING The instance is being deleted.
MAINTENANCE The instance is down for maintenance.
FAILED The creation of the instance failed or a fatal error occurred during an operation on the instance. Note: Instances in this state would tried to be auto-repaired. And Customers should be able to restart, update or delete these instances.
BOOTSTRAPPING Index 7 is used in the producer apis for ROLLED_BACK state. Keeping that index unused in case that state also needs to exposed via consumer apis in future. The instance has been configured to sync data from some other source.
PROMOTING The instance is being promoted.

InstanceType

Type of an Instance

Enums
INSTANCE_TYPE_UNSPECIFIED The type of the instance is unknown.
PRIMARY PRIMARY instances support read and write operations.
READ_POOL READ POOL instances support read operations only. Each read pool instance consists of one or more homogeneous nodes. * Read pool of size 1 can only have zonal availability. * Read pools with node count of 2 or more can have regional availability (nodes are present in 2 or more zones in a region).
SECONDARY SECONDARY instances support read operations only. SECONDARY instance is a cross-region read replica

MachineConfig

MachineConfig describes the configuration of a machine.

JSON representation
{
  "cpuCount": integer
}
Fields
cpuCount

integer

The number of CPU's in the VM instance.

AvailabilityType

The Availability type of an instance. Potential values:

  • ZONAL: The instance serves data from only one zone. Outages in that zone affect instance availability.
  • REGIONAL: The instance can serve data from more than one zone in a region (it is highly available).
Enums
AVAILABILITY_TYPE_UNSPECIFIED This is an unknown Availability type.
ZONAL Zonal available instance.
REGIONAL Regional (or Highly) available instance.

Node

Details of a single node in the instance. Nodes in an AlloyDB instance are ephemereal, they can change during update, failover, autohealing and resize operations.

JSON representation
{
  "zoneId": string,
  "id": string,
  "ip": string,
  "state": string
}
Fields
zoneId

string

The Compute Engine zone of the VM e.g. "us-central1-b".

id

string

The identifier of the VM e.g. "test-read-0601-407e52be-ms3l".

ip

string

The private IP address of the VM e.g. "10.57.0.34".

state

string

Determined by state of the compute VM and postgres-service health. Compute VM state can have values listed in https://cloud.google.com/compute/docs/instances/instance-life-cycle and postgres-service health can have values: HEALTHY and UNHEALTHY.

QueryInsightsInstanceConfig

QueryInsights Instance specific configuration.

JSON representation
{
  "queryStringLength": integer,
  "recordApplicationTags": boolean,
  "recordClientAddress": boolean,
  "queryPlansPerMinute": integer
}
Fields
queryStringLength

integer (uint32 format)

Query string length. The default value is 1024. Any integer between 256 and 4500 is considered valid.

recordApplicationTags

boolean

Record application tags for an instance. This flag is turned "on" by default.

recordClientAddress

boolean

Record client address for an instance. Client address is PII information. This flag is turned "on" by default.

queryPlansPerMinute

integer (uint32 format)

Number of query execution plans captured by Insights per minute for all queries combined. The default value is 5. Any integer between 0 and 20 is considered valid.

ObservabilityInstanceConfig

Observability Instance specific configuration.

JSON representation
{
  "enabled": boolean,
  "preserveComments": boolean,
  "trackWaitEvents": boolean,
  "trackWaitEventTypes": boolean,
  "maxQueryStringLength": integer,
  "recordApplicationTags": boolean,
  "queryPlansPerMinute": integer,
  "trackActiveQueries": boolean,
  "trackClientAddress": boolean
}
Fields
enabled

boolean

Observability feature status for an instance. This flag is turned "off" by default.

preserveComments

boolean

Preserve comments in query string for an instance. This flag is turned "off" by default.

trackWaitEvents

boolean

Track wait events during query execution for an instance. This flag is turned "on" by default but tracking is enabled only after observability enabled flag is also turned on.

trackWaitEventTypes

boolean

Output only. Track wait event types during query execution for an instance. This flag is turned "on" by default but tracking is enabled only after observability enabled flag is also turned on. This is read-only flag and only modifiable by producer API.

maxQueryStringLength

integer

Query string length. The default value is 10k.

recordApplicationTags

boolean

Record application tags for an instance. This flag is turned "off" by default.

queryPlansPerMinute

integer

Number of query execution plans captured by Insights per minute for all queries combined. The default value is 200. Any integer between 0 to 200 is considered valid.

trackActiveQueries

boolean

Track actively running queries on the instance. If not set, this flag is "off" by default.

trackClientAddress

boolean

Track client address for an instance. If not set, default value is "off".

ReadPoolConfig

Configuration for a read pool instance.

JSON representation
{
  "nodeCount": integer
}
Fields
nodeCount

integer

Read capacity, i.e. number of nodes in a read pool instance.

UpdatePolicy

Policy to be used while updating the instance.

JSON representation
{
  "mode": enum (Mode)
}
Fields
mode

enum (Mode)

Mode for updating the instance.

Mode

Specifies the available modes of update.

Enums
MODE_UNSPECIFIED Mode is unknown.
DEFAULT Least disruptive way to apply the update.
FORCE_APPLY Performs a forced update when applicable. This will be fast but may incur a downtime.

ClientConnectionConfig

Client connection configuration

JSON representation
{
  "requireConnectors": boolean,
  "sslConfig": {
    object (SslConfig)
  }
}
Fields
requireConnectors

boolean

Optional. Configuration to enforce connectors only (ex: AuthProxy) connections to the database.

sslConfig

object (SslConfig)

Optional. SSL config option for this instance.

PscInstanceConfig

PscInstanceConfig contains PSC related configuration at an instance level.

JSON representation
{
  "serviceAttachmentLink": string,
  "allowedConsumerProjects": [
    string
  ],
  "pscDnsName": string
}
Fields
allowedConsumerProjects[]

string

Optional. List of consumer projects that are allowed to create PSC endpoints to service-attachments to this instance.

pscDnsName

string

Output only. The DNS name of the instance for PSC connectivity. Name convention: ...alloydb-psc.goog

InstanceNetworkConfig

Metadata related to instance level network configuration.

JSON representation
{
  "authorizedExternalNetworks": [
    {
      object (AuthorizedNetwork)
    }
  ],
  "enablePublicIp": boolean,
  "enableOutboundPublicIp": boolean
}
Fields
authorizedExternalNetworks[]

object (AuthorizedNetwork)

Optional. A list of external network authorized to access this instance.

enablePublicIp

boolean

Optional. Enabling public ip for the instance.

enableOutboundPublicIp

boolean

Optional. Enabling an outbound public IP address to support a database server sending requests out into the internet.

AuthorizedNetwork

AuthorizedNetwork contains metadata for an authorized network.

JSON representation
{
  "cidrRange": string
}
Fields
cidrRange

string

CIDR range for one authorzied network of the instance.

GeminiInstanceConfig

Instance level configuration parameters related to the Gemini in Databases add-on.

JSON representation
{
  "entitled": boolean
}
Fields
entitled

boolean

Output only. Whether the Gemini in Databases add-on is enabled for the instance. It will be true only if the add-on has been enabled for the billing account corresponding to the instance. Its status is toggled from the Admin Control Center (ACC) and cannot be toggled using AlloyDB's APIs.

Methods

create

Creates a new Instance in a given project and location.

createsecondary

Creates a new SECONDARY Instance in a given project and location.

delete

Deletes a single Instance.

failover

Forces a Failover for a highly available instance.

get

Gets details of a single Instance.

getConnectionInfo

Get instance metadata used for a connection.

injectFault

Injects fault in an instance.

list

Lists Instances in a given project and location.

patch

Updates the parameters of a single Instance.

restart

Restart an Instance in a cluster.