Storage API
Storage API provides HTTP API for managing public variables used in Enapter Rule Engine.
List Variables
GET /api/storage/v1/public/variables
Get the list of all public storage variables.
Request
Sample request via cURL
$ curl http://enapter-gateway.local/api/storage/v1/public/variables -X GET -G \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}'
Response
Sample response (200 OK)
{
"variables": [
{
"name": "target_pressure",
"value": "5.5",
"updated_at": "2024-01-21T10:20:00Z"
}
]
}
variables
object#Array of
Variable
objects.Variable.name
string#Variable name.
Variable.value
string#Current variable value.
Variable.updated_at
string#The latest update time of the variable in RFC 3339 format.
Get Variable
GET /api/storage/v1/public/variables/{variable_name}
Get specific public storage variable value.
Request
Sample request via cURL
$ curl http://enapter-gateway.local/api/storage/v1/public/variables/target_pressure -X GET \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}'
Path Parameters
variable_name
string#Name of the variable to retrieve.
Response
Sample response (200 OK)
{
"name": "target_pressure",
"value": "5.5",
"updated_at": "2024-01-21T10:20:00Z"
}
Set Variable
POST /api/storage/v1/public/variables/{variable_name}
Set value for specific variable.
Request
Sample request via cURL
$ curl http://enapter-gateway.local/api/storage/v1/public/variables/target_pressure -X POST \
-H 'X-Enapter-Auth-Token: {ACCESS_TOKEN}' \
-H 'Content-Type: application/json' \
-d '{"value": "5.5"}'
Path Parameters
variable_name
string#Name of the variable to set.
Request Body
value
string#New value for the variable.
Response
Sample response (200 OK)
{
"name": "target_pressure",
"value": "5.5",
"updated_at": "2024-01-21T10:20:00Z"
}