Update an existing variable
variable_id*integerThe ID of the variable.
1 <= valueAccept*stringapplication/json
Content-Type*stringapplication/json
A JSON object containing the resource data
application/json- body
id*integerThe unique ID of the given Variable.
key*stringThe unique key used to identify the variable on the target.
For resource-config-file, use a relative path such as .env or storage/oauth-public.key.
For resource-symlink, key is the link path and value is the destination path, for example node_modules -> ${APP_SHARED_DIR}/node_modules. Must not be greater than 100 characters.
value*stringThe value to be assigned to this variable when deployed to its target.
When variable is of type file, this is the file content.
When variable is of type symlink, this is the destination path, for example ${APP_SHARED_DIR}/node_modules. Must not be greater than 21504 characters.
description?stringA text describing the variable, provided by the end user. Must not be greater than 255 characters.
target*VariableTargetThe target defining how the variable key/value pair will be deployed
"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"type*VariableTypeThe type of the key/value pair
"file""symlink""variable"hidden*booleanIndicates if the variable value should be visible or not in the deployment logs.
No Content
curl -X PUT 'https://api.devopness.com/variables/123' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer <your_api_token>' \ -H 'Content-Type: application/json' \ -H 'Content-Type: application/json' \ -d '{ "id": 1, "key": "APP_URL", "value": "https://staging.devopness.com", "target": "resource-config-file", "type": "file", "hidden": false}'