-
Notifications
You must be signed in to change notification settings - Fork 1
Docs (End)
DanDayne edited this page Nov 24, 2019
·
3 revisions
FUNCTIONALITY: end device, node or whole program
ENDPOINT: /end
TYPE: GET
URL ARGUMENTS:
-
--> ends the program -
?node_id=x-> ends nodexand its devices -
?node_id=x&device_type=xyz-> ends devicexyzon specified node
POSSIBLE RESPONSES:
-
200, ''-> success 400, 'Requested node is not initialized'400, 'Device doesnt exist on node x'-
401, 'Invalid Credentials'-> invalid credentials in the auth argument in post request -
500, error message-> error occurred on PBRcontrol, report immediately
Example
import requests
# end node
requests.get('https://localhost:5000/end?node_id=1', verify=False, auth=('user', 'passwd'))
# end device
requests.get('https://localhost:5000/end?node_id=1&device_type=PBR', verify=False, auth=('user', 'passwd'))
# end program
requests.get('https://localhost:5000/end', verify=False, auth=('user', 'passwd'))assuming the node with ID = 1 was running.