Skip to content

Docs (End)

DanDayne edited this page Nov 24, 2019 · 3 revisions

FUNCTIONALITY: end device, node or whole program

ENDPOINT: /end

TYPE: GET

URL ARGUMENTS:

  1. - -> ends the program
  2. ?node_id=x -> ends node x and its devices
  3. ?node_id=x&device_type=xyz -> ends device xyz on 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.

Clone this wiki locally