Skip to content

Docs (Log)

DanDayne edited this page Nov 24, 2019 · 7 revisions

FUNCTIONALITY: retrieve data from log

ENDPOINT: /log

TYPE: GET

URL ARGUMENTS:

  1. ?node=x -> return all unseen data from node x.
  2. ?node=x&time=YYMMDDHHMMSS -> return all data from given time for given node x

POSSIBLE RESPONSES:

  • 200, [data] -> success, return log data in a list ordered from oldest to most recent
  • 400, 'Node_id not provided'-> no node was passed on as an argument in the url (?node_id=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

# obtain all data from time stamp '20191014090837'
requests.get('https://localhost:5000/log?node_id=1&time=20191014090837', verify=False, auth=('user', 'passwd'))

# obtain all previously unseen data
requests.get('https://localhost:5000/log?node_id=1', verify=False, auth=('user', 'passwd'))

where there has to be running node with ID = 1.

Clone this wiki locally