REST API
Note
This page is a work-in-progress as the OpenAPI spec is not yet complete.
- GET /api/tenant/{tenant}/badge
Get a badge describing the result of the latest buildset found.
- Parameters:
tenant (string) – The tenant name
- Query Parameters:
project (string) – A project name
pipeline (string) – A pipeline name
branch (string) – A branch name
Example request:
GET /api/tenant/{tenant}/badge HTTP/1.1 Host: example.com
- Status Codes:
200 OK – Badge describing the result of the latest buildset found.
404 Not Found – No buildset found
- GET /api/tenant/{tenant}/builds
List the executed builds
- Parameters:
tenant (string) – The tenant name
- Query Parameters:
project (string) – A project name
pipeline (string) – A pipeline name
job_name (string) – A job name
branch (string) – A branch name
change (string) – A change number
patchset (string) – A patchset number
ref (string) – A ref
newrev (string) – A new revision hash
uuid (string) – A build uuid
voting (string) – A build voting status
result (string) – A build result
limit (string) – The limit count (default 50)
skip (string) – Skip number of results
Example request:
GET /api/tenant/{tenant}/builds HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Returns the list of builds
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "branch": "string", "change": 1, "duration": 1, "end_time": "string", "job_name": "string", "log_url": "string", "newrev": "string", "patchset": 1, "pipeline": "string", "project": "string", "ref": "string", "ref_url": "string", "result": "string", "start_time": "string", "uuid": "string", "voting": true } ]
404 Not Found – Tenant not found
- GET /api/tenant/{tenant}/buildsets
List the executed builds
- Parameters:
tenant (string) – The tenant name
- Query Parameters:
project (string) – A project name
pipeline (string) – A pipeline name
branch (string) – A branch name
change (string) – A change number
patchset (string) – A patchset number
ref (string) – A ref
newrev (string) – A new revision hash
uuid (string) – A buildset uuid
result (string) – A buildset result
limit (string) – The limit count (default 50)
skip (string) – Skip number of results
Example request:
GET /api/tenant/{tenant}/buildsets HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Returns the list of builds
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "project": "string", "event_id": "string", "uuid": "string", "branch": "string", "ref_url": "string", "newrev": "string", "result": "string", "change": 1, "patchset": 1, "ref": "string", "pipeline": "string", "message": {} } ]
404 Not Found – Tenant not found
- GET /api/tenant/{tenant}/jobs
List available jobs
- Parameters:
tenant (string) – The tenant name
Example request:
GET /api/tenant/{tenant}/jobs HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Returns the list of jobs
Example response:
HTTP/1.1 200 OK Content-Type: application/json [ { "description": "string", "name": "string" } ]
404 Not Found – Tenant not found
- GET /api/tenant/{tenant}/key/{project}.pub
Get a project public key
- Parameters:
tenant (string) – The tenant name
project (string) – The project name
Example request:
GET /api/tenant/{tenant}/key/{project}.pub HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Returns the project public key
Example response:
HTTP/1.1 200 OK Content-Type: text/plain -----BEGIN PUBLIC KEY----- MIICI... -----END PUBLIC KEY-----
404 Not Found – Tenant or Project not found
- GET /api/tenant/{tenant}/status
Get tenant status
- Parameters:
tenant (string) – The tenant name
Example request:
GET /api/tenant/{tenant}/status HTTP/1.1 Host: example.com
- Status Codes:
200 OK –
Returns the list of tenants
Example response:
HTTP/1.1 200 OK Content-Type: application/json { "last_reconfigured": 1, "pipelines": [ { "change_queues": [ { "heads": [ [ { "active": true, "enqueue_time": 1, "failing_reasons": [ "string" ], "id": "string", "item_ahead": [ "string" ], "item_behind": [ "string" ], "jobs": [ { "canceled": true, "elapsed_time": 1, "launch_time": 1, "name": "string", "number": 1, "pipeline": "string", "remaining_time": 1, "result": "string", "retry": 1, "start_time": 1, "url": "string", "uuid": "string", "voting": true, "worker": { "fqdn": "string", "hostname": "string", "ips": [ "string" ], "name": "string", "program": "string", "version": "string" } } ], "live": true, "owner": "string", "project": "string", "remaining_time": 1, "url": "string", "zuul_ref": "string" } ] ], "name": "string", "window": 1 } ], "description": "string", "name": "string" } ], "trigger_event_queue": 1, "zuul_version": "string" }
404 Not Found – Tenant not found