Naijacloud
Docs

Deploys

Every /v1 route for deploys. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.

Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.

Get a deploy

GET /v1/deploys/{deployId}

Key scopes: READ and DEPLOYS.

Path parameters

NameTypeRequiredNotes
deployIdstringyesThe deploy's id.

Returns

bash
curl "https://api.naijacloud.com/v1/deploys/$DEPLOY_ID" \ -H "Authorization: Bearer $NC_API_KEY"

Cancel a deploy that has not gone live

POST /v1/deploys/{deployId}/cancel

The version already live keeps serving.

Key scopes: WRITE and DEPLOYS.

Path parameters

NameTypeRequiredNotes
deployIdstringyesThe deploy's id.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/deploys/$DEPLOY_ID/cancel" \ -H "Authorization: Bearer $NC_API_KEY"

A deploy's build log, oldest line first

GET /v1/deploys/{deployId}/logs

Readable once the build has finished.

Key scopes: READ and DEPLOYS.

Path parameters

NameTypeRequiredNotes
deployIdstringyesThe deploy's id.

Query parameters

NameTypeRequiredNotes
limitintegernoRows per page. Ignored when a cursor is given.
cursorstringnoThe nextCursor of the previous page, unchanged.

Returns

  • 200 with a page: { data: V1DeployLogLine[], nextCursor }, where each item is V1DeployLogLine.
bash
curl "https://api.naijacloud.com/v1/deploys/$DEPLOY_ID/logs" \ -H "Authorization: Bearer $NC_API_KEY"

Roll back to a previous deploy's image

POST /v1/deploys/{deployId}/rollback

Replays the stored image rather than rebuilding. Only a deploy that went live can be rolled back to.

Key scopes: WRITE and DEPLOYS.

Path parameters

NameTypeRequiredNotes
deployIdstringyesThe deploy's id.

Headers

NameTypeRequiredNotes
Idempotency-KeystringnoAny unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/deploys/$DEPLOY_ID/rollback" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)"

List a service's deploys, newest first

GET /v1/services/{serviceId}/deploys

Key scopes: READ and DEPLOYS.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Query parameters

NameTypeRequiredNotes
limitintegernoRows per page. Ignored when a cursor is given.
cursorstringnoThe nextCursor of the previous page, unchanged.

Returns

  • 200 with a page: { data: V1Deploy[], nextCursor }, where each item is V1Deploy.
bash
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/deploys" \ -H "Authorization: Bearer $NC_API_KEY"

Deploy a service now

POST /v1/services/{serviceId}/deploys

Builds the tracked branch (or pulls the image) and rolls it out. Also how to restart a service. Poll the deploy until it is RUNNING or FAILED.

Key scopes: WRITE and DEPLOYS.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Headers

NameTypeRequiredNotes
Idempotency-KeystringnoAny unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/services/$SERVICE_ID/deploys" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)"

Types

V1Deploy

FieldTypeNotes
idstring (uuid)
serviceIdstring (uuid)
statusQUEUED, BUILDING, TESTING, DEPLOYING, RUNNING, FAILED, CANCELLED, REPLACED, SUPERSEDED
triggerPUSH, MANUAL, ROLLBACK, FIRST_DEPLOY, SYSTEM, or nullWhat started it: a push, a person, a rollback, …
branchstring, or null
commitShastring, or null
commitMessagestring, or null
authorNamestring, or null
buildCommandstring, or null
startCommandstring, or null
errorstring, or nullWhy it failed, written for you.
errorCodeMISSING_SCRIPT, COMMAND_NOT_FOUND, MODULE_NOT_FOUND, BUILD_FAILED, CRASH, OOM, PORT_NOT_LISTENING, HEALTH_TIMEOUT, IMAGE_REJECTED, BUILD_OOM, NODE_BUSY, NODE_LOW_DISK, DATA_SERVICE_ON_OTHER_NODE, UNKNOWN, or null
durationMsnumber, or nullFrom the start of work (not queueing) to the end, in ms.
createdAtstring (date-time)
startedAtstring (date-time), or null
finishedAtstring (date-time), or null

V1DeployLogLine

FieldTypeNotes
idstring (uuid)
linestring
streamSTDOUT, STDERR, SYSTEM
levelINFO, WARN, ERROR
createdAtstring (date-time)