# Environment Variables Controller Resource

The API allows you to view, list, create and edit environment variables.

### GET /env-variables

Returns list of environment variables filtered by specified query parameters.

Request Parameters
name | type | description
--- | --- | ---
application | query |
direction | query |
filter | query |
nameLike | query |
orderBy | query |
page | query |
size | query |

Response Body
media type | data type | description
--- | --- | ---
application/json | array of EnvVariableDetails (JSON) | list of environment variables filtered by specified query parameters

#### Example

##### Request

    GET /env-variables
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    [ {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67"
    } ]

### POST /env-variables

Create environment variable.

Request Body
media type | data type | description
--- | --- | ---
application/json | EnvVariableRequest (JSON) | specify details for new environment variable

Response Body
media type | data type | description
--- | --- | ---
application/json | EnvVariableDetails (JSON) | details of newly created environment variable

#### Example

##### Request

    POST /env-variables
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

    HTTP/1.1 201 Created
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67"
    }

### DELETE /env-variables/{guid}

Remove environment variable.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for environment variable (use by vProtect)

#### Example

##### Request

    DELETE /env-variables/{guid}
    Content-Type: */*

    ...

##### Response

    HTTP/1.1 204 No Content

### GET /env-variables/{guid}

Get a single environment variable.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for environment variable (use by vProtect)

Response Body
media type | data type | description
--- | --- | ---
application/json | EnvVariableDetails (JSON) | environment variable details

#### Example

##### Request

    GET /env-variables/{guid}
    Content-Type: */*
    Accept: application/json

    ...

##### Response

    HTTP/1.1 200 OK
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67"
    }

### PUT /env-variables/{guid}

Change environment variable.

Request Parameters
name | type | description
--- | --- | ---
guid | path | specify local unique identifier for environment variable (use by vProtect)

Request Body
media type | data type | description
--- | --- | ---
application/json | EnvVariableRequest (JSON) | specify environment variable details to update

Response Body
media type | data type | description
--- | --- | ---
application/json | EnvVariableDetails (JSON) | updated details of environment variable

#### Example

##### Request

    PUT /env-variables/{guid}
    Content-Type: application/json
    Accept: application/json

    { }

##### Response

    HTTP/1.1 204 No Content
    Content-Type: application/json

    {
      "guid" : "f8f73bf9-2445-4bce-a7dd-753be3b40a67"
    }