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 -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": {"solve.duration": "10s", "solve.iterations": "20"}}' -c)
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 -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"
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 -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"
Copy

Page last updated

Go to on-page nav menu