Skip to content

Set Environment for a Read Replica

client.projects.services.replicaSets.setEnvironment(stringreplicaSetID, ReplicaSetSetEnvironmentParams { project_id, service_id, environment } params, RequestOptionsoptions?): ReplicaSetSetEnvironmentResponse { message }
POST/projects/{project_id}/services/{service_id}/replicaSets/{replica_set_id}/setEnvironment

Sets the environment type for the read replica set.

ParametersExpand Collapse
replicaSetID: string
params: ReplicaSetSetEnvironmentParams { project_id, service_id, environment }
project_id: string

Path param: The unique identifier of the project.

service_id: string

Path param: The unique identifier of the service.

environment: "PROD" | "DEV"

Body param: The target environment for the service.

One of the following:
"PROD"
"DEV"
ReturnsExpand Collapse
ReplicaSetSetEnvironmentResponse { message }
message?: string

Set Environment for a Read Replica

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 response = await client.projects.services.replicaSets.setEnvironment('alb8jicdpr', {
  project_id: 'rp1pz7uyae',
  service_id: 'd1k5vk7hf2',
  environment: 'PROD',
});

console.log(response.message);
{
  "message": "Action completed successfully."
}
Returns Examples
{
  "message": "Action completed successfully."
}