cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

REST API access to more variables on the Data Layer

REST API access to more variables on the Data Layer

E_Stapel
Long-established Member

Hello everyone,

is it possible, to access more than one variable from the CtrlX Data Layer with one GET-Request ?

Thank you in advance!

2 REPLIES 2

CodeShepherd
Community Moderator
Community Moderator

Please have a look to the post "Read/write GVL as a block using REST API".

Sgilk
Contributor

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
  }
]

 

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist