Skip to main content

replicas

Overview

Namereplicas
TypeResource
Iddigitalocean.databases.replicas

Fields

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference a database replica.
namestringThe name to give the read-only replicating
connectionobject
created_atstringA time value given in ISO8601 combined date and time format that represents when the database cluster was created.
private_connectionobject
private_network_uuidstringA string specifying the UUID of the VPC to which the read-only replica will be assigned. If excluded, the replica will be assigned to your account's default VPC for the region.
regionstringA slug identifier for the region where the read-only replica will be located. If excluded, the replica will be placed in the same region as the cluster.
sizestringA slug identifier representing the size of the node for the read-only replica. The size of the replica must be at least as large as the node size for the database cluster from which it is replicating.
statusstringA string representing the current status of the database cluster.
tagsarrayA flat array of tag names as strings to apply to the read-only replica after it is created. Tag names can either be existing or new tags.

Methods

NameAccessible byRequired ParamsDescription
get_replicaSELECTdatabase_cluster_uuid, replica_nameTo show information about an existing database replica, send a GET request to /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME.

Note: Read-only replicas are not supported for Redis clusters.

The response will be a JSON object with a replica key. This will be set to an object containing the standard database replica attributes.
list_replicasSELECTdatabase_cluster_uuidTo list all of the read-only replicas associated with a database cluster, send a GET request to /v2/databases/$DATABASE_ID/replicas.

Note: Read-only replicas are not supported for Redis clusters.

The result will be a JSON object with a replicas key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes.
create_replicaINSERTdatabase_cluster_uuid, data__name, data__sizeTo create a read-only replica for a PostgreSQL or MySQL database cluster, send a POST request to /v2/databases/$DATABASE_ID/replicas specifying the name it should be given, the size of the node to be used, and the region where it will be located.

Note: Read-only replicas are not supported for Redis clusters.

The response will be a JSON object with a key called replica. The value of this will be an object that contains the standard attributes associated with a database replica. The initial value of the read-only replica's status attribute will be forking. When the replica is ready to receive traffic, this will transition to active.
_get_replicaEXECdatabase_cluster_uuid, replica_nameTo show information about an existing database replica, send a GET request to /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME.

Note: Read-only replicas are not supported for Redis clusters.

The response will be a JSON object with a replica key. This will be set to an object containing the standard database replica attributes.
_list_replicasEXECdatabase_cluster_uuidTo list all of the read-only replicas associated with a database cluster, send a GET request to /v2/databases/$DATABASE_ID/replicas.

Note: Read-only replicas are not supported for Redis clusters.

The result will be a JSON object with a replicas key. This will be set to an array of database replica objects, each of which will contain the standard database replica attributes.
destroy_replicaEXECdatabase_cluster_uuid, replica_nameTo destroy a specific read-only replica, send a DELETE request to /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME.

Note: Read-only replicas are not supported for Redis clusters.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.
promote_replicaEXECdatabase_cluster_uuid, replica_nameTo promote a specific read-only replica, send a PUT request to /v2/databases/$DATABASE_ID/replicas/$REPLICA_NAME/promote.

Note: Read-only replicas are not supported for Redis clusters.

A status of 204 will be given. This indicates that the request was processed successfully, but that no response body is needed.