-
Notifications
You must be signed in to change notification settings - Fork 1
Docs (Add device)
DanDayne edited this page Nov 24, 2019
·
8 revisions
FUNCTIONALITY: Add device to an existing node
ENDPOINT: /add_device
TYPE: POST
URL ARGUMENTS: ?node_id=x
POSSIBLE RESPONSES:
-
200, 1
-> device was added to requested node -
400, [errors]
-> the provided protocol is invalid and or other problems with the request occured. Returns list of errors -
401, 'Invalid Credentials'
-> invalid credentials in the auth argument in post request -
500, error message
-> error occurred on PBRcontrol, report immediately
DATA: Dictionary of a device specified in Protocol.
Example
import requests
requests.post('https://localhost:5000/add_device?node_id=1', str(dev), verify=False, auth=('user', 'passwd'))
where dev
is defined in example of protocol. Please note in order to use node_id=1
, the node with ID = 1
must exist.