Run App Remotely

Run remotely with Cloud API

A tutorial for running an app remotely with Nextmv Cloud API.

Note, all requests must be authenticated with Bearer Authentication. Make sure your request has a header containing your Nextmv Cloud API key, as such:

  • Key: Authorization
  • Value: Bearer <YOUR-API-KEY>
Authorization: Bearer <YOUR-API-KEY>
Copy

Export your API key as an environment variable:

export NEXTMV_API_KEY="<YOUR-API-KEY>"
Copy

New run

Submit a new run. The run_id is returned.

POSThttps://api.cloud.nextmv.io/v1/applications/{application_id}/runs

New application run.

Create new application run.

curl -sS -L -X POST \
  "https://api.cloud.nextmv.io/v1/applications/$APP_ID/runs?instance_id=$INSTANCE_ID" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $NEXTMV_API_KEY" \
  -d $(cat $INPUT_FILE | jq '{"input": ., "options": {"duration": "2"}}' -c) | jq
Copy

Run metadata

Get a run metadata. The metadata.status key will contain the status of the run. Use the run_id obtained from submitting a run.

GEThttps://api.cloud.nextmv.io/v1/applications/{application_id}/runs/{run_id}/metadata

Get run status without output.

Get the status of a run without the output.

curl -sS -L -X GET \
  "https://api.cloud.nextmv.io/v1/applications/$APP_ID/runs/$RUN_ID/metadata" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $NEXTMV_API_KEY" | jq
Copy

Run result

Get a run result. The output key will contain the actual output of the run. Use the run_id obtained from submitting a run.

GEThttps://api.cloud.nextmv.io/v1/applications/{application_id}/runs/{run_id}

Get run result.

Get the result of a run.

curl -sS -L -X GET \
  "https://api.cloud.nextmv.io/v1/applications/$APP_ID/runs/$RUN_ID" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $NEXTMV_API_KEY" | jq
Copy

Cancel a run

To cancel a run, use the following endpoint.

PATCHhttps://api.cloud.nextmv.io/v1/applications/{application_id}/runs/{run_id}/cancel

Cancel a run that is not yet completed.

Cancel a run that is not yet completed.

curl -L -X PATCH \
  "https://api.cloud.nextmv.io/v1/applications/$APP_ID/runs/$RUN_ID/cancel" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $NEXTMV_API_KEY"
Copy

Account queue

Get the queue of runs for the account using this endpoint. A run is queued when the status_v2 in the metadata is queued.

GEThttps://api.cloud.nextmv.io/v1/account/queue

List queued and active runs.

Retrieves a list of queued and active runs.

curl -L -X GET \
  "https://api.cloud.nextmv.io/v1/account/queue" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $NEXTMV_API_KEY"
Copy

Page last updated

Go to on-page nav menu