FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
Dear Community User! We have started the migration process.
This community is now in READ ONLY mode.
Read more: Important
information on the platform change.
06-04-2024 03:05 PM
Hello everyone,
is it possible, to access more than one variable from the CtrlX Data Layer with one GET-Request ?
Thank you in advance!
Solved! Go to Solution.
06-04-2024 03:28 PM
Please have a look to the post "Read/write GVL as a block using REST API".
06-04-2024 03:40 PM
Hello @E_Stapel ,
Yes, it is possible to execute multiple operations using a single request with the bulk endpoint.
Here is an example curl request generated from the linked Swagger UI.
curl -X 'PUT' \
'https://127.0.0.1:8443/automation/api/v2/bulk?type=read' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJleHAiOjE3MTc1MzcwNjEsImlhdCI6MTcxNzUwODI2MSwiaWQiOiIxMDAwIiwibmFtZSI6ImJvc2NocmV4cm90aCIsIm5vbmNlIjoiZTY2ZDBjNDEtYTE1Zi00NTI0LWI3YjAtNmFjYjBhYzA1NjM5IiwicGxjaGFuZGxlIjowLCJyZW1vdGVhdXRoIjoiIiwic2NvcGUiOlsicmV4cm90aC1kZXZpY2UuYWxsLnJ3eCJdfQ.UrlnBCcFUJHGWHUuBBRS1JiqXYOfrldkpH7s_6wVxyuNNliBADg8_NTUEoWFPnhP8rrRQ1Xy0N_jZK5dqYu1_aeeh3-v0byvdED8u6Sx8MkA8wYRxG6rPNWd-qCHLKUv' \
-H 'Content-Type: application/json' \
-d '[
{
"address": "framework/metrics/system/cpu-utilisation-percent"
},
{
"address": "framework/metrics/system/memused-percent"
}
]'
Here is the response body from the ctrlX REST API server.
[
{
"address": "framework/metrics/system/cpu-utilisation-percent",
"result": "DL_OK",
"timestamp": "133619818963378058",
"type": "double",
"value": 4.7
},
{
"address": "framework/metrics/system/memused-percent",
"result": "DL_OK",
"timestamp": "133619818963386645",
"type": "double",
"value": 58.8
}
]