I am configuring a deployment script for some specific use cases, and I need to make a get request which will return the count of robots reporting to each secondary hub. Is there a way to do so?
The minimum UIM Group ACL permissions that user/group needs in order for the REST calls to work depends on the specific REST call you are making, and the required permissions for each REST call are contained within this document:
webservices_rest Call Reference
For UIMAPI usage/consumption, the Web Service ACL permission is required at a global level.
There is no global requirement for a user to be a NimBUS user or an Account user. But there are API level restrictions to not allow for account users for some APIs, and there are additional permissions at each and every API level which are summarized at a high level below:
For accounts, custom property and contacts-related API-> Account Administration, Change Password
For ACL related APIs-> Manage ACL
For Alarms related API-> Alarm Details, Accept, Acknowledge, Assign, Alarm Management, Unassign, Alarm History, Invisible Alarms and Alarm Summary
For devices, profiles,probes, maintenance mode, related APIs-> Basic Management
For policies-> its Policy Basic and Policy Management
For product usage-> Product Usage Data
For MCS related-> its USM Monitoring Configuration Service, MCS Read-Only Access, USM Edit Monitoring Templates
Steps:
1. Deploy the uimapi 23.4.2 and webservices_rest 23.4.2 to the OC Robot.
2. Access the UIMAPI, e.g., http://oc-robot-example:8081/uimapi/swagger-ui/index.html#/
How to define the basic HTTP authentication using cURL correctly?
Curl –s –u username:pw https://hostname/uimapi/robots/ -H “accept: application/json” | grep –oP ‘”hub” : “\K[^”]+’ | uniq –c | egrep –v “undesiredhub1|undesiredhub2” sort | head –n 1 | awk ‘{print $2}’
This will return the secondary hub that has the least amount of robots, excluding servers you don’t want to be considered in there, ie different region hubs, OC server, and Primary hub.