Skip to content

Get Read Replica Sets

client.projects.services.replicaSets.retrieveReplicaSets(stringserviceID, ReplicaSetRetrieveReplicaSetsParams { project_id } params, RequestOptionsoptions?): ReplicaSetRetrieveReplicaSetsResponse { id, connection_pooler, cpu_millis, 6 more }
GET/projects/{project_id}/services/{service_id}/replicaSets

Retrieves a list of all read replica sets associated with a primary service within a project.

ParametersExpand Collapse
serviceID: string
params: ReplicaSetRetrieveReplicaSetsParams { project_id }
project_id: string

The unique identifier of the project.

ReturnsExpand Collapse
ReplicaSetRetrieveReplicaSetsResponse = Array<ReadReplicaSet { id, connection_pooler, cpu_millis, 6 more } >
id?: string
connection_pooler?: ConnectionPooler { endpoint }
endpoint?: Endpoint { host, port }
host?: string
port?: number
cpu_millis?: number

CPU allocation in milli-cores.

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

Memory allocation in gigabytes.

metadata?: Metadata { environment }

Additional metadata for the read replica set

environment?: string

Environment tag for the read replica set

name?: string
nodes?: number

Number of nodes in the replica set.

status?: "creating" | "active" | "resizing" | 2 more
One of the following:
"creating"
"active"
"resizing"
"deleting"
"error"

Get Read Replica Sets

import TigerCloud from 'tiger-cloud';

const client = new TigerCloud({
  apiKey: process.env['TIGER_CLOUD_API_KEY'], // This is the default and can be omitted
});

const readReplicaSets = await client.projects.services.replicaSets.retrieveReplicaSets(
  'd1k5vk7hf2',
  { project_id: 'rp1pz7uyae' },
);

console.log(readReplicaSets);
[
  {
    "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"
  }
]