5.13. Actions¶
Actions allow administrative users to perform certain operations, as described below.
5.13.1. Available Actions¶
5.13.1.1. discover_nodes
¶
Ngenea Hub monitors for when new nodes come online.
The discover_nodes
action can be used to manually scan for nodes. This may be necessary if a node was previously manually removed from Ngenea Hub
This action takes no arguments.
5.13.2. REST API¶
Actions are submitted via the /api/actions/
endpoint, and typically execute asynchronously. The state of the action can be viewed via the same endpoint.
Note
The actions endpoint does not support client key authentication. You must use JWT Authentication.
To submit an action, make a POST
request against the /api/actions/
endpoint
$ curl -s -X POST 'http://example.com/api/actions/' -H 'Accept: application/json' -H "Authorization: Bearer $JWT_ACCESS_TOKEN" -H 'Content-Type: application/json' -d '{"action": "discover_nodes"}'
{
"id": 12345,
...
}
This returns a unique id, which can be used to check the status and results of the action
$ curl -s 'http://example.com/api/actions/12345/' -H 'Accept: application/json' -H "Authorization: Bearer $JWT_ACCESS_TOKEN"
{
"action": "discover_nodes",
"user": "myuser",
"state": "SUCCESS"
"results": {...}
}