REST API

This page describes the public REST API of the COT.

The public REST API URL can be accessed any time after COT installation by running the following command:

Copy
Copied!
            

$ cot show --api_url

The following are REST requests to retrieve COT summary reports.

Request

GET /api/v1/report/

Description

API to get list of report IDs.

Response Body

List of strings, each string is an identifier of a COT run.

Response Code

200 OK

Request

GET /api/v1/report/{run_id}

Description

API to get report by run_id.

Path Parameters

Name

Type

Description

run_id

String

Run ID number based on workflow ID. Can be last to get the last report available.

Query Parameters

Name

Type

Description

format

String

Specify the report format. Options: JSON, PDF. Default: JSON.

Response Body

If report is ready:

Name

Type

Description

run_id

String

Identifier of the run

date

String

The date the COT run started

start_time

String

The time the COT run started

total_run_time

String

The total runtime of the COT

switches

Dictionary

Dictionary describing the switches taking part in this run, separated according to topology switch level. Included only if this information has been collected from the relevant jobs.

hosts

String

Hostlist expression describes the hosts which took part in the COT run.

launched_job

String

The name of the workflow/job template that launched.

report_data

Dictionary

Dictionary containing mapping of section name to section data. For example: {'Switch OS': <section_data>}

If report generation is in progress:

Copy
Copied!
            

Report (run ID {run_id}) generation is in progress, please try again in a few seconds.

Otherwise:

Copy
Copied!
            

No Reports Available

Response Code

200 OK404 NOT FOUND – if report does not exist or is in progress

© Copyright 2023, NVIDIA. Last updated on Mar 18, 2024.