Skip to content

REST API

Marina Golosova edited this page Oct 8, 2020 · 26 revisions

NOTE: The page is under construction.


DKB REST API is available (from CERN network) at: http://aiatlas172.cern.ch:5080/

Table of Contents

Methods

Common parameters (for all methods):

  • ?rtype=... -- response format. Allowed values: json (default), img (only for /task/hist);
  • ?pretty -- pretty-print JSON.
JSON response format:
{
  "status": "OK"|"Fail",
  "took_total_ms": <ms>,
  "took_storage_ms": <ms>,
  "data": <method response>,
  "error": <error details>,
  "warning": <warning or list of warnings>,
  "errors": <warning or list of warnings>,
  "exception": <exception name>,
  "details": <exception details>
}

NOTE: not all fields are presented simultaneously; e.g. if "status" is "Fail", "data" clause will be missed. And vice versa: if "status" is "OK", "error" details won't be provided (while "warning" or "errors" can be presented).

NOTE: "errors" field will eventually be renamed to "warning".

NOTE: field "exception" and its "details" appears for unhandled exceptions; some of them are OK (as "MethodNotFound" here), but if you see some native Python exception -- please open an issue.

↑up

Server info

Method name: /server_info

URL: http://aiatlas172.cern.ch:5080/server_info?pretty

URL (nested demo): http://aiatlas172.cern.ch:5080/nested/server_info?pretty

Parameters: none

Response format:

{
  "status": "OK", 
  "took_total_ms": 0, 
  "data": {
    "version": 0.3.1, 
    "name": "DKB API server"
  }
}

↑up

Method/category info

NOTE: available for all categories, but not for methods.

Method name: [/path/to/category]/info

URL: http://aiatlas172.cern.ch:5080/info?pretty

URL: http://aiatlas172.cern.ch:5080/task/info?pretty

URL (nested demo): http://aiatlas172.cern.ch:5080/nested/task/info?pretty

Parameters: none

Response format:

{
  "status": "OK", 
  "took_total_ms": 0, 
  "data": {
    "path": <path/to/category>, 
    "methods": ["method_name1", ...]
    "categories": ["subcategory1", ...]
  }
}

↑up

Task chain reconstruction

Method name: /task/chain

URL: http://aiatlas172.cern.ch:5080/task/chain?tid=16655409&pretty

Parameters:

  • ?tid=... -- task ID for which chain will be reconstructed.
Response format: ...

↑up

Tasks distribution over time (by steps)

Method name: /task/hist

URL: http://aiatlas172.cern.ch:5080/task/hist?htags=mc16e_cp&pretty

Parameters:

  • ?rtype=... -- response format: JSON (`json`) or PNG image (`img`);
  • ...
Response format: ...

↑up

Derivation efficiency

Method name: /task/deriv

URL: http://aiatlas172.cern.ch:5080/task/deriv?project=data18_13TeV&amitag=p3553&pretty

Parameters:

  • ?amitag=... -- ...;
  • ?project=... -- ... .
Response format: ...

↑up

Campaign statistics

Method name: /campaign/stat

URL: http://aiatlas172.cern.ch:5080/campaign/stat?pretty&htag=draw_reprocessing012020&step_type=ctag_format&events_src=task

Parameters: ...

Response format: ...

↑up

Steps statistics

Method name: /step/stat

URL: http://aiatlas172.cern.ch:5080/step/stat?pretty&htag=newfastcalosimntuponly

Parameters: ...

Response format: ...

↑up