Environment REST APIs
About XPRESSO Environment REST APIs
XPRESSO provides the following public REST APIs to retrieve environment-related (test harness and execution engine) information.
Build Polaris Docker Image
Builds a Polaris Docker Image
- URL:
/api/v2/images/polaris_build - Method:
POST - Permission Required:
add_docker_image. - Group: retrieved from
headers - Request Payload
{ "name": "polaris-image", "tag": "polaris-tag", "git_ref": "<branch or tag to checkout before building image>", "base_ref": "<optional: additional git ref to perform 3-way merge>", "groups": ['group1', 'group2', 'group3'] } - Success Response
- Condition: Authorized User.
- Code:
200 OK - Response example:
{ "credentials": null, "uuid": "abcde12-abcde12-abcde12-abcde12-abcde12", "name": "polaris-image", "tag": "polaris-tag", "data": "{'name': 'polaris-image', 'tag': 'polaris-tag', 'group': 'myGroup', 'git_ref': 'git_ref_191', 'retention_day': 6, 'submitter': 'pokeke', 'is_nfs_storage': True, 'nfs_path': '/auto/taas-dev/built_images/myGroup/polaris-image/polaris-tag.tar', 'is_polaris_image': True}", "status": "building", "group": "myGroup", "git_ref": "git_ref_191", "date_created": "2021-08-25T19:35:14.765536Z", "date_updated": "2021-08-25T19:35:14.766765Z", "container_details": null, "yaml_content": null, "worker_meta": null, "size": 0, "virtual_size": 0, "image_id": "0", "jobs": null, "manifests": null, "push_url": null, "pin_version": null, "is_nfs_storage": true, "nfs_path": "/auto/taas-dev/built_images/myGroup/polaris-image/polaris-tag.tar", "is_deleted": false, "is_polaris_image": true, "base_ref": null, "meta": null, "type": "genie", "custom": true }
Retrieve Test Harnesses
Returns test harness instances defined under group.
- URL:
/api/v2/harnesses - Method:
GET - Permission Required: No permission required.
- Group: retrieved from
headers - Success Response
- Condition: Authorized User.
- Code:
200 OK - Response example:
[ { "id": "94f03015-5f0d-4c2e-a6e6-49ca71442a36", "name": "TestHarness", "harness": "pyATS", "path": "/path/to/pyATS", "supporting_path": "", "configuration_state": "ENABLED", "operational_state": "ONLINE", "site": "OTT", "bldg": "ALL", "created_by": "test_user", "date_created": "2019-05-30T17:22:12.733397Z", "date_modified": "2019-05-30T20:41:35.288635Z", "deleted": false } ]
Retrieve Test Harness
Return test harness instance information.
- URL:
/api/v2/harnesses/:id - Method:
GET - Permission Required: No permission required. User needs to be a member of the group that owns the test harness instance.
- Group: retrieved from
headers - Success Response
- Condition: If test harness instance exists and Authorized User is a member of the group.
- Code:
200 OK - Response example:
{ "id": "94f03015-5f0d-4c2e-a6e6-49ca71442a36", "name": "TestHarness", "harness": "pyATS", "path": "/path/to/pyATS", "supporting_path": "", "configuration_state": "ENABLED", "operational_state": "ONLINE", "site": "OTT", "bldg": "ALL", "created_by": "test_user", "date_created": "2019-05-30T17:22:12.733397Z", "date_modified": "2019-05-30T20:41:35.288635Z", "deleted": false }
- Error Response
- Condition: If test harness instance does not exist with provided
harness_id - Code:
404 NOT FOUND - Response example:
{ detail: 'Not Found' }
- Condition: If test harness instance does not exist with provided
Retrieve Execution Engines
Returns execution engine instance defined under group.
- URL:
/api/v2/engines - Method:
GET - Permission Required: No permission required.
- Group: retrieved from
headers - Success Response
- Condition: Authorized User.
- Code:
200 OK - Response example:
[ { "type": "jenkins", "created_by": "test_user", "id": "421be594-34fa-4ea6-922a-678f3ca404f1", "configuration_state": "ENABLED", "base_url": "https://my-jenkins.mycompany.com", "site": "OTT", "bldg": "ALL", "deleted": false, "date_created": "2019-05-30T18:39:28.606540Z", "date_modified": "2019-05-31T18:48:26.498353Z", "operational_state": "ONLINE", "name": "ExecEngine" } ]
Retrieve Execution Engine
Return execution engine instance information.
- URL:
/api/v2/engines/:id - Method:
GET - Permission Required: No permission required. User needs to be a member of the group that owns the execution engine instance.
- Group: retrieved from
headers - Success Response
- Condition: If execution engine instance exists and Authorized User is a member of the group.
- Code:
200 OK - Response example:
{ "type": "jenkins", "created_by": "test_user", "id": "421be594-34fa-4ea6-922a-678f3ca404f1", "configuration_state": "ENABLED", "base_url": "https://my-jenkins.mycompany.com", "site": "OTT", "bldg": "ALL", "deleted": false, "date_created": "2019-05-30T18:39:28.606540Z", "date_modified": "2019-05-31T18:48:26.498353Z", "operational_state": "ONLINE", "name": "ExecEngine" }
- Error Response
- Condition: If execution engine instance does not exist with provided
engine_id - Code:
404 NOT FOUND - Response example:
{ detail: 'Not Found' }
- Condition: If execution engine instance does not exist with provided