Skip to content

Set Environment for a Service

client.projects.services.setEnvironment(stringserviceID, ServiceSetEnvironmentParams { project_id, environment } params, RequestOptionsoptions?): ServiceSetEnvironmentResponse { message }
POST/projects/{project_id}/services/{service_id}/setEnvironment

Sets the environment type for the service.

ParametersExpand Collapse
serviceID: string
params: ServiceSetEnvironmentParams { project_id, environment }
project_id: string

Path param: The unique identifier of the project.

environment: "PROD" | "DEV"

Body param: The target environment for the service.

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

Set Environment for a Service

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.setEnvironment('d1k5vk7hf2', {
  project_id: 'rp1pz7uyae',
  environment: 'PROD',
});

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