Skip to content

Create a Read Replica Set

POST/projects/{project_id}/services/{service_id}/replicaSets

Creates a new read replica set for a service. This is an asynchronous operation.

Path ParametersExpand Collapse
project_id: string
service_id: string
Body ParametersJSONExpand Collapse
cpu_millis: number

The initial CPU allocation in milli-cores.

memory_gbs: number

The initial memory allocation in gigabytes.

name: string

A human-readable name for the read replica.

nodes: number

Number of nodes to create in the replica set.

ReturnsExpand Collapse
ReadReplicaSet = object { id, connection_pooler, cpu_millis, 6 more }
id: optional string
connection_pooler: optional ConnectionPooler { endpoint }
endpoint: optional Endpoint { host, port }
host: optional string
port: optional number
cpu_millis: optional number

CPU allocation in milli-cores.

endpoint: optional Endpoint { host, port }
host: optional string
port: optional number
memory_gbs: optional number

Memory allocation in gigabytes.

metadata: optional object { environment }

Additional metadata for the read replica set

environment: optional string

Environment tag for the read replica set

name: optional string
nodes: optional number

Number of nodes in the replica set.

status: optional "creating" or "active" or "resizing" or 2 more
One of the following:
"creating"
"active"
"resizing"
"deleting"
"error"

Create a Read Replica Set

curl http://localhost:8080/projects/$PROJECT_ID/services/$SERVICE_ID/replicaSets \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $TIGER_CLOUD_API_KEY" \
    -d '{
          "cpu_millis": 250,
          "memory_gbs": 1,
          "name": "my-reporting-replica",
          "nodes": 2
        }'
{
  "id": "alb8jicdpr",
  "connection_pooler": {
    "endpoint": {
      "host": "my-service.com",
      "port": 8080
    }
  },
  "cpu_millis": 250,
  "endpoint": {
    "host": "my-service.com",
    "port": 8080
  },
  "memory_gbs": 1,
  "metadata": {
    "environment": "environment"
  },
  "name": "reporting-replica-1",
  "nodes": 2,
  "status": "active"
}
Returns Examples
{
  "id": "alb8jicdpr",
  "connection_pooler": {
    "endpoint": {
      "host": "my-service.com",
      "port": 8080
    }
  },
  "cpu_millis": 250,
  "endpoint": {
    "host": "my-service.com",
    "port": 8080
  },
  "memory_gbs": 1,
  "metadata": {
    "environment": "environment"
  },
  "name": "reporting-replica-1",
  "nodes": 2,
  "status": "active"
}