NDT Plugin REST API
Following authentication types are supported:
basic (/ufmRest)
client (/ufmRestV2)
token (/ufmRestV3)
Description: Uploads NDT file to UFM
URL: POST ufmRestV2/plugin/ndt/upload_metadata
Request Data:
[ { "file_name": "topo1.ndt", "file": base64 string, "file_type": "switch_to_host", "sha-1": "xxx" }, { "file_name": "topo2.ndt", "file": base64 string, "file_type": "switch_to_switch", "sha-1": "xxx" } ]
Response: N/A
Status Codes:
200 – Ok.
400 – bad request (bad or missing parameters).
500 - insufficient resources (disk space)
Description: Deletes NDT files from UFM
URL: POST ufmRestV2/plugin/ndt/delete
Request Content Type – Application/json
Request Data:
[ { "file_name": "topo1.ndt" }, { "file_name": "topo2.ndt" } ]
Response: N/A
Status Codes:
200 – Ok.
400 – bad request (bad or missing parameters).
404 – not found.
Description: Get list of uploaded NDT files
URL: GET ufmRestV2/plugin/ndt/list
Request Data: N/A
Response:
[ { "file_name": "topo1.ndt", "last_uploaded": "2020-09-13 10:57:09.253", "sha-1”: "c3499c2729730a7f807efb8676a92dcb6f8a3f8f", "file_type": "switch_to_host" }, { "file_name": "topo2.ndt", "last_uploaded": "2020-08-15 11:55:19.203", "sha-1": "a94a8fe5ccb19ba61c4c0873d391e987982fbbd3", "file_type": "switch_to_switch" } ]
Status Codes:
200 – Ok.
400 – bad request (bad or missing parameters).
Description: Run NDT topo compare and save last X reports
URL: POST ufmRestV2/plugin/ndt/compare
Request Data (Optional):
{ "run": { "startTime": "2020-10-01 16:40:59", "endTime": "2020-10-01 18:45:59", "interval": 3600 } }
Warningrequest data is needed only to define periodic execution
startTime - when to start the first run
endTime - the time of the last run
interval - interval between the runs in minutes
Response: N/A
Status Codes:
200 – Ok
400 – bad request (bad or missing parameters).
Description: Cancels periodic NDT comparison
URL: GET ufmRestV2/plugin/ndt/cancel
Request: N/A
Response: N/A
Status Codes:
200 – Ok.
400 – bad request (bad or missing parameters).
Description: Get reports list
URL: GET ufmRestV2/plugin/ndt/reports
Request: N/A
Response Content Type – Application/json
Response:
[ { "report_id": "1", "report_scope": "Periodic", "timestamp": "2021-06-22 11:00:00" }, { "report_id": "2", "report_scope": "Periodic", "timestamp": "2021-06-22 11:05:00" }, { "report_id": "3", "report_scope": "Periodic", "timestamp": "2021-06-22 11:10:00" }, ]
Status Codes:
200 – Ok.
400 – bad request (bad or missing parameters).
Description: Get a specific report
URL: GET ufmRestV2/plugin/ndt/reports/
Request: N/A
Response Content Type – Application/json
Response:
{ "error”: "", "timestamp": "2020-09-13 10:57:09.253", "report": { "miss-wired": [ { "expected": "DSM09-0101-0617-001IB2/P2 - DSM09-0101-0721-001IB4/P2" "actual": “DSM09-0101-0617-001IB2/P2 - DSM09-0101-0721-001IB4/P3" }, { "expected": "DSM09-0101-0721-001IB4/P3 - DSM09-0101-0617-001IB2/P2" "actual": "DSM09-0101-0721-001IB4/P3 - DSM09-0101-0617-001IB2/P4" } ], "missing_in_ufm": [ "DSM09-0101-0617-001IB2/P2-DSM09-0101 - 0721-001IB4/P2", "DSM09-0101-0617-001IB2/P3-DSM09-0101 - 0721-001IB4/P3" ], "missing_in_ndt": [ "DSM09-0101-0617-001IB2/P6-DSM09-0101 - 0721-001IB4/P6", "DSM09-0101-0617-001IB2/P5-DSM09-0101 - 0721-001IB4/P5" ] } }
WarningIn case the report can’t be generated, the error would be raised:
{ "errors": "Can’t parse file topo1.ndt", "timestamp": "2020-09-13 10:57:09.253" }
Status Codes:
WarningThe report can have three types of link and should be limited to the first 10K error events:
miss-wired links - links that are connected differently than specified in the NDTs
missing_in_ufm - links that are specified in the NDT files, but missing in the UFM
missing_in_ndt - links that aren’t specified in the NDT, but found by the UFM
200 – Ok.
400 – bad request (bad or missing parameters).