Environment Variables API


Create an environment variable

POST /environment_variables

Parameters

name
required: true
scope: environment_variable
Name of the variable
value
required: true
scope: environment_variable
Value of the variable
application_id
required: true
Id of the application to associate with this variable
environment_id
required: true
Id of the environment to associate with this variable

Request

          Accept: application/vnd.engineyard.v3+json
          Content-Type: application/json
          
            
          {
            "environment_variable": {
              "name": "BASE_SECRET",
              "value": "78ac2299ca2874eed52f435126bd65eb17d01dc55092091f1f7a3d6b1f68174a"
            },
            "application_id": 7,
            "environment_id": 7
          }
            
          

Response

          Status: 201 Created
          Content-Type: application/json; charset=utf-8
          
            
          {
            "environment_variable": {
              "id": 10,
              "application": "https://api.engineyard.com/applications/7",
              "application_id": 7,
              "application_name": "7073baebb249305f9240",
              "environment": "https://api.engineyard.com/environments/7",
              "environment_id": 7,
              "environment_name": "5c65c4",
              "name": "BASE_SECRET",
              "sensitive": false,
              "value": "78ac2299ca2874eed52f435126bd65eb17d01dc55092091f1f7a3d6b1f68174a"
            }
          }
            
          








List all environment variables

GET /environment_variables

Request

          Accept: application/vnd.engineyard.v3+json
          Content-Type: application/json
          
            
          {
          }
            
          

Response

          Status: 200 OK
          Content-Type: application/json; charset=utf-8
          
            
          {
            "environment_variables": [
              {
                "id": 2,
                "application": "https://api.engineyard.com/applications/1",
                "application_id": 1,
                "application_name": "6a4f13871fbbdd8495b7",
                "environment": "https://api.engineyard.com/environments/1",
                "environment_id": 1,
                "environment_name": "a94936",
                "name": "SECRET_BASE",
                "sensitive": false,
                "value": "775e2fce8052c236f8048cadb26ac04f"
              },
              {
                "id": 2,
                "application": "https://api.engineyard.com/applications/1",
                "application_id": 1,
                "application_name": "6a4f13871fbbdd8495b7",
                "environment": "https://api.engineyard.com/environments/1",
                "environment_id": 1,
                "environment_name": "a94936",
                "name": "SECRET_BASE",
                "sensitive": false,
                "value": "775e2fce8052c236f8048cadb26ac04f"
              }
            ]
          }
            
          








List environment variables associated with application

GET /applications/:application_id/environment_variables

Parameters

application_id
required: true
Id of application

Request

          Accept: application/vnd.engineyard.v3+json
          Content-Type: application/json
          
            
          {
          }
            
          

Response

          Status: 200 OK
          Content-Type: application/json; charset=utf-8
          
            
          {
            "environment_variables": [
              {
                "id": 3,
                "application": "https://api.engineyard.com/applications/2",
                "application_id": 2,
                "application_name": "f46fc0a821f87d6f51f3",
                "environment": "https://api.engineyard.com/environments/2",
                "environment_id": 2,
                "environment_name": "5507e3",
                "name": "TWITTER_SECRET",
                "sensitive": false,
                "value": "fcb77b529799692e8e42b82171537009"
              }
            ]
          }
            
          








List environment variables associated with environment

GET /environments/:environment_id/environment_variables

Parameters

environment_id
required: true
Id of environment

Request

          Accept: application/vnd.engineyard.v3+json
          Content-Type: application/json
          
            
          {
          }
            
          

Response

          Status: 200 OK
          Content-Type: application/json; charset=utf-8
          
            
          {
            "environment_variables": [
              {
                "id": 8,
                "application": "https://api.engineyard.com/applications/5",
                "application_id": 5,
                "application_name": "4215944ec535bfd7a5b3",
                "environment": "https://api.engineyard.com/environments/5",
                "environment_id": 5,
                "environment_name": "05b3e0",
                "name": "DB_PASSWORD",
                "sensitive": false,
                "value": "601eca024e"
              },
              {
                "id": 8,
                "application": "https://api.engineyard.com/applications/5",
                "application_id": 5,
                "application_name": "4215944ec535bfd7a5b3",
                "environment": "https://api.engineyard.com/environments/5",
                "environment_id": 5,
                "environment_name": "05b3e0",
                "name": "DB_PASSWORD",
                "sensitive": false,
                "value": "601eca024e"
              }
            ]
          }
            
          








Show an environment variable

GET /environment_variables/:environment_variable_id

Parameters

environment_variable_id
required: true
Id of requested environment variable

Request

          Accept: application/vnd.engineyard.v3+json
          Content-Type: application/json
          
            
          {
          }
            
          

Response

          Status: 200 OK
          Content-Type: application/json; charset=utf-8
          
            
          {
            "environment_variable": {
              "id": 9,
              "application": "https://api.engineyard.com/applications/6",
              "application_id": 6,
              "application_name": "b5a59b40eca36dae90a5",
              "environment": "https://api.engineyard.com/environments/6",
              "environment_id": 6,
              "environment_name": "c866c8",
              "name": "MY_VAR",
              "sensitive": false,
              "value": "123"
            }
          }