Skip to main content
This document provides a comprehensive overview of the Wherobots Runs REST API, a programming interface for managing job runs. If you are orchestrating jobs with Apache Airflow, an open-source platform for scheduling and managing complex data workflows, we recommend using the WherobotsRunOperator. For more information on this constructor, see the documentation for the WherobotsRunOperator
Track your Job Runs in Wherobots CloudUsage History in Wherobots Cloud provides insights into job progress, resource consumption, execution timelines, and configuration settings. For more information, see Usage History.

Before you start

Before using the Runs REST API, ensure that you have the following required resources:

HTTP Request

Example
In line 4, replace YOUR-API-KEY with a Wherobots API key.

Response codes

The following table details a comprehensive listing of response codes encountered during a run’s execution.

Run statuses

A run’s status field has one of the following values: PENDING, RUNNING, COMPLETED, FAILED, CANCELLED, TIMED_OUT

Create Run

The Create Run endpoint allows you to create a new run in Wherobots. A request needs a name and exactly one entrypoint: runPython to run a Python file, or runJar to run a JAR file. A request with neither entrypoint, or with both, returns 422. Optional parameters set the runtime, the timeout, and the runtime environment. Route: POST https://api.cloud.wherobots.com/runs To choose the compute region, add the region query parameter, for example POST https://api.cloud.wherobots.com/runs?region=aws-us-west-2. region is a query parameter; don’t put it in the request body.

Request parameters

The following parameters are associated with the Create run endpoint. Query parameters: Request body schema:
ParameterTypeRequired or OptionalParameter
description
Rules for
Accepted Values
namestrRequiredThe user-assigned name of the run.8 to 255 characters. Letters, digits, _, -, and . are allowed.
runtimestrOptionalWherobots runtime.

When omitted, a default runtime is assigned.
micro, tiny, small, medium, large, x-large, 2x-large, 4x-large, medium-himem, large-himem, x-large-himem, 2x-large-himem, 4x-large-himem, x-large-hicpu, 2x-large-hicpu

Which runtimes you can use depends on your Organization’s edition and the region. See Runtimes.
versionstrOptionalString literals that map to a specific Wherobots version.

“latest” refers to the most recent, stable production version available.

”preview” refers to the most recent pre-release or testing version available.

Defaults to “latest”

You can find additional available versions in Environment Presets.
latest, preview
runPythondictRequired unless runJar is setUsed to run a Python file.An S3 path to Python file. Wherobots Managed Storage and Storage Integration S3 paths are supported.

Takes the following keys: uri:str specifying the file path to your script and args:list[str] an optional list of arguments to pass to the script.

You can use either runPython or runJar, not both.
runJardictRequired unless runPython is setUsed to run a JAR file.An S3 path to Java Archive (JAR) file. Wherobots Managed Storage and Storage Integration S3 paths are supported.

Takes the following keys: uri:str specifying the file path to your script and args:list[str] an optional list of arguments to pass to the script.

You can use either runPython or runJar, not both.
timeoutSecondsintOptionalThe timeout of the run, in seconds. Defaults to 3600.If the value is greater than Max Workload Alive Hours multiplied by 3600, the API server will change this value to the maximum value allowed.
environmentdictOptionalThe model for runtime environment configs, include spark cluster configs, dependencies. Defaults to .See Environment keys.

Environment keys

Environment
parameter
TypeRequired or OptionalParameter descriptionRules for
Accepted Values
sparkDriverDiskGBintOptionalThe driver disk size of the Spark cluster.
sparkExecutorDiskGBintOptionalThe executor disk size of the Spark cluster.
sparkConfigsdict{str:str}OptionalThe user specified spark configs.
dependencieslist[dict[str, Any]]OptionalIndicates the 3rd party dependencies need to
add to the runtime. Defaults to an empty list.
Must be an array (list) of objects (dictionaries). Each object must represent either a Python Package Index or a File Dependency.

Run Python

The following code snippet details a Job Run request that runs a Python file. In practice, replace S3-PATH-TO-FILE with the S3 path of your Python file in Wherobots. Wherobots Managed Storage and Storage Integration S3 paths are supported.
args returns an empty list, [], if uri: "YOUR-S3-PATH" is used in the runPython request without args: list[str].

Run JAR

The following code snippet details a Jobs run request that runs a JAR file. In practice, replace S3-PATH-TO-FILE with the S3 path of your JAR file in Wherobots. Wherobots Managed Storage and Storage Integration S3 paths are supported.

Dependencies

The following details information on the third-party dependencies that can be added to the runtime environment.
Python Package Index (PyPI) dependency object
Python Package Index dependency objects are used to represent third-party Python packages that need to be added to the runtime environment.
File dependency object
The file dependency object allows you to specify a file to be added to the runtime environment.
Dependencies example

Request example

This is an example of a Jobs run request that runs a Python file.
This is an example of a Jobs run request that runs a JAR file.

Successful response example

The following is an example of a successful response. A successful response returns the 201 status code.

Get Run

The Get Run endpoint allows you to get the details of a Wherobots Job Run. In practice, replace <RUN_ID>, with the ID of an existing run, which can be found by querying List Runs. Route: GET https://api.cloud.wherobots.com/runs/<RUN_ID>

Successful response example

Cancel Run

The Cancel Run endpoint allows you to cancel a Wherobots Job Run. In practice, replace <RUN_ID>, with the ID of an existing run, which can be found by querying List Runs. Route: POST https://api.cloud.wherobots.com/runs/<RUN_ID>/cancel

Successful response

Returns 200 when request cancels successfully. It can take a minute before the status changes to CANCELLED. Query Get Run to check a Job Run’s status.

Get Run Logs

The Get Run Logs endpoint allows you to see the logs for a Wherobots Job Run. In practice, replace <RUN_ID>, with the ID of an existing run, which can be found by querying List Runs. Route: GET https://api.cloud.wherobots.com/runs/<RUN_ID>/logs

Request query parameters schema

Example: https://api.cloud.wherobots.com/runs/<RUN_ID>/logs?size=100

Successful response example

List Runs

The List Runs endpoint allows you to see all of the Wherobots runs in your Organization. Route: GET https://api.cloud.wherobots.com/runs

Request parameters

The following query parameters can be provided to refine the search:

Response fields

Successful response example