Logo

Command Palette

Search for a command to run...

GET/stacks/:stack_id/environments/:env_var_id

Required Parameters

stack_idstring
The stack UID
env_var_idinteger
The environment variable ID

Get information about a single environment variable.

Related Models:Environment Variable

Request

GET
/stacks/:stack_id/environments/:env_var_id
curl -X GET \
  "https://app.cloud66.com/api/3/stacks/:stack_id/environments/:env_var_id" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": {
    "id": 4153,
    "key": "STACK_PATH",
    "value": "/var/deploy/test-elastic-1/web_head/current",
    "readonly": true,
    "created_at": "2014-08-29T17:21:25Z",
    "updated_at": "2014-08-29T17:21:25Z",
    "is_password": false,
    "is_generated": true,
    "history": [
      {
        "key": 2,
        "value": "/var/deploy/test-elastic-1/web_head/somethingold",
        "created_at": "2015-05-08T14:01:50Z",
        "updated_at": "2015-05-08T14:01:50Z"
      }
    ]
  }
}
GET/stacks/:stack_id/environments

Required Parameters

stack_idstring
The stack UID

Get list of all the environment variables of a stack.

Request

GET
/stacks/:stack_id/environments
curl -X GET \
  "https://app.cloud66.com/api/3/stacks/:stack_id/environments" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": [
    {
      "id": 4152,
      "key": "STACK_GIT_BRANCH",
      "value": "master",
      "readonly": true,
      "created_at": "2014-08-29T17:21:25Z",
      "updated_at": "2014-08-29T17:21:25Z",
      "is_password": false,
      "is_generated": true,
      "history": [
        {
          "key": 1,
          "value": "develop",
          "created_at": "2015-05-08T15:09:50Z",
          "updated_at": "2015-05-08T15:09:50Z"
        }
      ]
    }
  ],
  "count": 30,
  "pagination": {
    "previous": null,
    "next": null,
    "current": 1,
    "per_page": 30,
    "count": 4,
    "pages": 1
  }
}
POST/stacks/:stack_id/environments

Required Parameters

stack_idstring
The stack UID
keystring
The environment variable key/name
valuestring
The environment variable value

Add an environment variable to a stack.

Related Models:Environment Variable

Request

POST
/stacks/:stack_id/environments
curl -X POST \
  "https://app.cloud66.com/api/3/stacks/:stack_id/environments" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "stack_id": "5999b763474b0eafa5fafb64bff0ba80",
  "key": "MY_ENVIRONMENT_VALUE",
  "value": "SOME_VALUE"
}'

Response

{
  "response": {
    "id": 4169,
    "key": "MY_ENVIRONMENT_VALUE",
    "value": "SOME_VALUE",
    "readonly": false,
    "created_at": "2015-01-01T12:00:00Z",
    "updated_at": "2015-01-01T12:00:00Z",
    "is_password": false,
    "is_generated": false,
    "history": []
  }
}
PUT/stacks/:stack_id/environments/:env_var_key

Required Parameters

stack_idstring
The stack UID
env_var_keystring
The environment variable key/name
valuestring
The new environment variable value

Update an environment variable value.

Related Models:Environment Variable

Request

PUT
/stacks/:stack_id/environments/:env_var_key
curl -X PUT \
  "https://app.cloud66.com/api/3/stacks/:stack_id/environments/:env_var_key" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "stack_id": "5999b763474b0eafa5fafb64bff0ba80",
  "env_var_key": "POSTGRESQL_SLAVE_ADDRESSES",
  "value": "127.0.0.1"
}'

Response

{
  "response": {
    "id": 4153,
    "key": "POSTGRESQL_SLAVE_ADDRESSES",
    "value": "127.0.0.1",
    "readonly": false,
    "created_at": "2014-08-29T17:21:25Z",
    "updated_at": "2015-01-01T12:00:00Z",
    "is_password": false,
    "is_generated": true,
    "history": []
  }
}
DELETE/stacks/:stack_id/environments/:env_var_key

Required Parameters

stack_idstring
The stack UID
env_var_keystring
The environment variable key/name

Delete an environment variable from a stack.

Related Models:Environment Variable

Request

DELETE
/stacks/:stack_id/environments/:env_var_key
curl -X DELETE \
  "https://app.cloud66.com/api/3/stacks/:stack_id/environments/:env_var_key" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Response

{
  "response": {
    "ok": true,
    "message": "Environment variable deleted"
  }
}