Cloud sandboxes
- post
/v1/cloud/sandboxes /v1/cloud/sandboxes/{id}- DEL
/v1/cloud/sandboxes/{id} - post
/v1/cloud/sandboxes/{id}/exec - post
/v1/cloud/sandboxes/{id}/upload-url
Create cloud sandbox
post
/v1/cloud/sandboxesParameters
Idempotency-Key
Request body · application/json
sizettlSecondslabels
Responses
200
idstatesizelabelscreatedAtexpiresAterror
201
idstatesizelabelscreatedAtexpiresAterror
400
402
403
422
429
502
503
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | The body is not an object, or `size` (`invalid_size`), `ttlSeconds` (`invalid_ttl`) or `labels` (`invalid_labels`) is out of bounds. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 402 | budget_exceeded | Nothing covers 15 minutes of this sandbox's cloud compute (`budget_exceeded`), or the organization is past due (`payment_past_due`). The refusal is recorded. |
| 403 | role_required | Your role does not have this permission |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | This `Idempotency-Key` names another sandbox (`idempotency_key_reused`); send a new key. | |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Gateway runs its most sandboxes (`cloud_capacity`, `NEXUS_CLOUD_MAX_SANDBOXES`), or the provider is busy (`cloud_busy`). There is no queue: try again after `Retry-After`. | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 502 | The cloud provider failed or did not answer (`cloud_provider_error`); try again. | |
| 503 | No provider account on this Gateway (`cloud_unavailable`), or the provider has no free machine (`cloud_capacity`); try again later. |
Example
curl -X POST "$NEXUS_URL/v1/cloud/sandboxes" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"ttlSeconds": 60
}'Get cloud sandbox
/v1/cloud/sandboxes/{id}Parameters
id
Responses
200
idstatesizelabelscreatedAtexpiresAterror
403
404
429
errormessagetypecodeparamnexusminimum
503
Errors
| Status | Code | When |
|---|---|---|
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such sandbox in your organization: another organization's is as absent as a missing one. | |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 503 | No provider account on this Gateway (`cloud_unavailable`); try again later. |
Example
curl "$NEXUS_URL/v1/cloud/sandboxes/<id>" \
-H "Authorization: Bearer $NEXUS_API_KEY"Delete cloud sandbox
DEL
/v1/cloud/sandboxes/{id}Parameters
idIdempotency-Key
Responses
200
iddeleted
403
404
429
errormessagetypecodeparamnexusminimum
502
503
Errors
| Status | Code | When |
|---|---|---|
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such sandbox in your organization: another organization's is as absent as a missing one. | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 502 | The cloud provider failed or did not answer (`cloud_provider_error`); try again. | |
| 503 | No provider account on this Gateway (`cloud_unavailable`); try again later. |
Example
curl -X DELETE "$NEXUS_URL/v1/cloud/sandboxes/<id>" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)"Exec cloud sandbox
post
/v1/cloud/sandboxes/{id}/execParameters
idIdempotency-Key
Request body · application/json
commandtimeoutSeconds
Responses
200
exitCodestdoutstderrtimedOutdurationMsstdoutTruncatedstderrTruncated
400
403
404
409
429
errormessagetypecodeparamnexusminimum
502
503
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | `command` (`invalid_command`) or `timeoutSeconds` (`invalid_timeout`) is out of bounds. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such sandbox in your organization: another organization's is as absent as a missing one. | |
| 409 | The sandbox is not ready yet, or has ended (`sandbox_not_ready`); read it and try again once it is `ready`. | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 502 | The cloud provider failed or did not answer (`cloud_provider_error`). The command may still have run: an answer larger than 1 MiB, or one lost on the way, comes after it ran. Do not send it again unless it is safe to run twice. | |
| 503 | No provider account on this Gateway (`cloud_unavailable`); try again later. |
Example
curl -X POST "$NEXUS_URL/v1/cloud/sandboxes/<id>/exec" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"command": "<command>",
"timeoutSeconds": 1
}'Cloud sandbox upload url
post
/v1/cloud/sandboxes/{id}/upload-urlParameters
idIdempotency-Key
Request body · application/json
pathttlSeconds
Responses
200
url
400
403
404
409
429
errormessagetypecodeparamnexusminimum
502
503
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_request_error | A field is missing or not valid; the message names it |
| 400 | `path` (`invalid_path`) or `ttlSeconds` (`invalid_ttl`) is out of bounds. | |
| 401 | authentication_error | No key, or a key Gateway does not accept |
| 403 | role_required | Your role does not have this permission |
| 404 | not_found | Nothing matches the path in your organization |
| 404 | No such sandbox in your organization: another organization's is as absent as a missing one. | |
| 409 | The sandbox is not ready yet, or has ended (`sandbox_not_ready`). | |
| 409 | idempotency_in_progress | A request with the same Idempotency-Key is still running |
| 409 | idempotency_interrupted | The first request with this Idempotency-Key was cut off and may have run in part |
| 422 | idempotency_key_reused | The Idempotency-Key was used with a different request |
| 429 | Over the caller's rate limit (`rate_limit_error`): retry after `Retry-After` seconds. Also a 429 `concurrency_limit`, with `Retry-After: 1`, when the organization already has its most requests in flight (off unless Gateway sets a cap). | |
| 429 | rate_limit_error | Too many requests from this key in a minute |
| 502 | The cloud provider failed or did not answer (`cloud_provider_error`); try again. | |
| 503 | No provider account on this Gateway (`cloud_unavailable`); try again later. |
Example
curl -X POST "$NEXUS_URL/v1/cloud/sandboxes/<id>/upload-url" \
-H "Authorization: Bearer $NEXUS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"path": "<path>"
}'