Lab Equipment REST APIs
About XPRESSO Lab Equipment REST APIs
XPRESSO provides the following public REST APIs to retrieve lab equipment-related (testbeds and topologies) information.
Retrieve Testbeds
Returns testbeds defined under group.
- URL:
/api/v2/testbeds - Method:
GET - Permission Required: No permission required.
- Group: retrieved from
headers - Success Response
- Condition: Authorized User.
- Code:
200 OK - Response example:
[ { "id": "24276d46-e652-4fd8-addc-1ad0830a6008", "topology": { "name": "My-Topo", "id": "8604a664-37b2-4850-a6fd-446197dea87b" }, "name": "My-Testbed", "description": "This is my awesome testbed!", "date_created": "2019-06-02T15:35:04.642772Z", "link_id": "c7b43224-ee38-4a33-9a1e-2a95c22c4a6f", "max_reservation_time": 86400, "max_retention_period": 43200, "site": "SITE", "bldg": "ALL", "reservation_disabled": false, "devices": [ { "name": "P1", "source": 0, "id": "cfe9effb-938a-454b-a6fc-b4ec0a40d744", "description": null, "operational_state": "FREE", "type": "router", "entity_type": "Device", "configuration_state": "ENABLED", "os": "nxos", "date_created": "2019-06-02T15:35:05.163101Z", "connections": [ { "name": "a", "port": 2043, "ip": "1.2.3.4", "protocol": "telnet", "entity_type": "Connection", "created_time": "2019-06-02T15:35:05.165408Z", "id": "febd391b-5fbd-4d29-bd7a-f0f2121c848d", }, { "name": "b", "port": 2044, "ip": "1.2.3.4", "protocol": "telnet", "entity_type": "Connection", "created_time": "2019-06-02T15:35:05.174043Z", "id": "f8769c73-9872-4828-a7ad-9ae94bd91ec9", } ], "platform": "n7000" } ], "created_by": "test_user", "deleted_at": null, "operational_state": "FREE", "configuration_state": "ENABLED", "reservation_state": "AVAILABLE", "backend": "static" } ]
Retrieve Testbed
Return testbed information.
- URL:
/api/v2/testbeds/:id - Method:
GET - Permission Required: No permission required. User needs to be a member of the group that owns the testbed.
- Group: retrieved from
headers - Success Response
- Condition: If testbed exists and Authorized User is a member of the group.
- Code:
200 OK - Response example:
{ "id": "24276d46-e652-4fd8-addc-1ad0830a6008", "topology": { "name": "My-Topo", "id": "8604a664-37b2-4850-a6fd-446197dea87b" }, "name": "My-Testbed", "description": null, "content": "<Raw Testbed YAML string>", "date_created": "2019-06-02T15:35:04.642772Z", "link_id": "c7b43224-ee38-4a33-9a1e-2a95c22c4a6f", "max_reservation_time": 86400, "max_retention_period": 43200, "site": "SITE", "bldg": "ALL", "reservation_disabled": false, "qmgr_reservation_id": null, "clean": [], "tcl_conf": null, "tcl_control": null, "devices": [ { "name": "P1", "source": 0, "id": "cfe9effb-938a-454b-a6fc-b4ec0a40d744", "description": null, "operational_state": "FREE", "type": "router", "entity_type": "Device", "configuration_state": "ENABLED", "os": "nxos", "date_created": "2019-06-02T15:35:05.163101Z", "connections": [ { "name": "a", "port": 2043, "ip": "1.2.3.4", "protocol": "telnet", "entity_type": "Connection", "created_time": "2019-06-02T15:35:05.165408Z", "id": "febd391b-5fbd-4d29-bd7a-f0f2121c848d", }, { "name": "b", "port": 2044, "ip": "1.2.3.4", "protocol": "telnet", "entity_type": "Connection", "created_time": "2019-06-02T15:35:05.174043Z", "id": "f8769c73-9872-4828-a7ad-9ae94bd91ec9", } ], "platform": "n7000" } ], "created_by": "test_user", "deleted_at": null, "operational_state": "FREE", "configuration_state": "ENABLED", "reservation_state": "AVAILABLE", "backend": "static", "reservations": [] }
- Error Response
- Condition: If testbed does not exist with provided
id - Code:
404 NOT FOUND - Response example:
{ detail: 'Not Found' }
- Condition: If testbed does not exist with provided
Retrieve Testbed Clean Instructions
Return testbed clean instructions.
URL:
/api/v2/testbeds/:id/cleansMethod:
GETPermission Required: No permission required. User needs to be a member of the group that owns the testbed.
Group: retrieved from
headersSuccess Response
- Condition: If testbed/clean exists and Authorized User is a member of the group.
- Code:
200 OK - Response example:
TBD
Error Response
- Condition: If testbed/clean does not exist with provided testbed
idor cleanid - Code:
404 NOT FOUND - Response example:
{}
- Condition: If testbed/clean does not exist with provided testbed
Retrieve Topologies
Returns topologies defined under group.
- URL:
/api/v2/topologies - Method:
GET - Permission Required: No permission required.
- Group: retrieved from
headers - Success Response
- Condition: Authorized User.
- Code:
200 OK - Response example:
[ { "id": "dcbc4e2c-6330-42a7-8793-4d8a43e16d39", "backend": "back", "name": "MyTopology", "description": "synced from back", "content": { "path": "Static Topologies/MyTopology", "image": "http://my.server.com:1234/images/e6acb9e9-9e11-43d8-89c1-4abf5c7145d4.jpg", "virl": "/some_dir/topologies/MyTopology/topology.virl", "image_file_name": "3c8a5868-2527-44d4-bed4-30e9079300e9.jpeg" }, "date_created": "2019-05-31T23:13:09.787665Z", "link_id": "3c8a5868-2527-44d4-bed4-30e9079300e9", "deleted_at": null, "manually_uploaded_image": false, "is_virtual": false } ]
Retrieve Topology
Return topology information.
- URL:
/api/v2/topologies/:id - Method:
GET - Permission Required: No permission required. User needs to be a member of the group that owns the topology.
- Group: retrieved from
headers - Success Response
- Condition: If topology exists and Authorized User is a member of the group.
- Code:
200 OK - Response example:
{ "id": "dcbc4e2c-6330-42a7-8793-4d8a43e16d39", "backend": "laas", "name": "MyTopology", "description": "synced from laas", "content": { "path": "Static Topologies/MyTopology", "image": "http://my.server:1234/images/e6acb9e9-9e11-43d8-89c1-4abf5c7145d4.jpg", "virl": "/some_dir/topologies/MyTopology/topology.virl", "image_file_name": "3c8a5868-2527-44d4-bed4-30e9079300e9.jpeg" }, "date_created": "2019-05-31T23:13:09.787665Z", "link_id": "3c8a5868-2527-44d4-bed4-30e9079300e9", "deleted_at": null, "manually_uploaded_image": false, "is_virtual": false }
- Error Response
- Condition: If topology does not exist with provided
id - Code:
404 NOT FOUND - Response example:
{}
- Condition: If topology does not exist with provided