Skip to Content
Variables

Get a variable by ID

GET
/variables/{variable_id}

Path Parameters

variable_id*integer

The ID of the variable.

Range1 <= value

Header Parameters

Accept*string

application/json

Authorization*string

Bearer {{access_token}}

Content-Type*string

application/json

Response Body

Ok

application/json
  1. response
id*integer

The ID of the given variable

key*string

The unique key used to identify the variable on the target, or the filesystem path for configuration files and symlinks

type*VariableType

The type of the key/value pair

Value in"file""symlink""variable"
description*|

A text describing the variable, provided by the end user

value*|

The value to be assigned to this variable when deployed to its target. For configuration files this is the file content; for symlinks this is the symlink target path

target*VariableTarget

The target defining how the variable key/value pair will be deployed

Value in"my-cnf""newrelic-infra-yml""nginx-http-server""nginx-http""nginx-main""os-env-var""php-cli_php-ini""php-fpm_php-fpm-conf""php-fpm_php-ini""php-fpm_pool-d-www-conf""redis-conf""resource-config-file""resource-symlink""supervisord-conf""sysctl-conf"
target_human_readable*string

Human readable version of target

resource_id*|

The ID of the resource this variable is linked to

resource_type*string

The name of the resource this variable is linked to

hidden*boolean

Indicates if the variable value should be visible or not in the deployment logs

created_by_user?|null
created_at*string

The date and time when the record was created

updated_at*string

The date and time when the record was last updated

Example Request
curl -X GET 'https://api.devopness.com/variables/123' \  -H 'Accept: application/json' \  -H 'Authorization: Bearer <your_api_token>' \  -H 'Content-Type: application/json'
Example Response
{  "id": 93023,  "key": "APP_URL",  "type": "file",  "description": "Sample variable description",  "value": "https://staging.devopness.com",  "target": "resource-config-file",  "target_human_readable": "Resource Configuration File",  "resource_id": 3426,  "resource_type": "application",  "hidden": false,  "created_by_user": {    "id": 1,    "name": "string",    "email": "user@example.com",    "url_slug": "someone",    "language": "en",    "active": true,    "created_at": "2019-09-25T15:50:48.000000Z",    "updated_at": "2019-09-25T13:52:04.000000Z"  },  "created_at": "2022-09-26T15:30:31.000000Z",  "updated_at": "2022-09-26T15:30:58.000000Z"}