Retrieve All Asynchronous Jobs or Based on Matching Filters

get

/r-scripts/v2/jobs

Retrieves the status, job id, elapsed time of the asynchronous jobs matching all supplied filters. If no filter is specified, it will return all the asynchronous jobs.

Request

Query Parameters

There's no request body for this operation.

Back to Top

Response

Supported Media Types

200 Response

List of asynchronous jobs.
Body ()
Root Schema : JSONObject
Type: object
Show Source

400 Response

Invalid parameters specified.
Body ()
Root Schema : InvalidParameterValueException
Type: object
Show Source

401 Response

When the user doesn't have privileges to perform the action.
Body ()
Root Schema : UnauthorizedException
Type: object
Show Source

500 Response

Problem connecting to Broker, finding the job id or other unexpected error.
Body ()
Root Schema : ComputeContainerException
Type: object
Show Source
Back to Top

Examples

Use the asynchronous jobs endpoint to retrieve jobs and filter the results by creation time, completion time, status, or comments. Each example below shows an independent request and a sample response.

Example 1: Retrieve all asynchronous jobs

The following example retrieves all asynchronous jobs.

curl -i -X GET \
    --header "Authorization: Bearer ${token}" \
    --header 'Accept: application/json' \
    "<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs"

The response body in JSON format is the following:

{
    "result": [
        {
            "createdDate": "2026-01-14 15:50:13 UTC",
            "job_id": "<job_id>",
            "status": "ERROR",
            "elapsedTime": "00:00:16"
        }
    ]
}

Example 2: Retrieve jobs based on filters

You can filter jobs using one or more of the following criteria:

  • Jobs created within the last 30 minutes
  • Jobs created more than 1,200 seconds ago
  • Jobs finished more than 1,200 seconds ago.
  • Jobs with a specified status.
  • Jobs whose comments match a pattern.

Each example includes the request and a sample response.

Jobs created within the last 30 minutes

To retrieve list of jobs created within the last 30 minutes, set createdWithinSeconds to 1800.

curl -i -k -X GET \
    --header "Authorization: Bearer ${token}" \
    --header 'Accept: application/json' \
    "<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?createdWithinSeconds=1800"

The response contains jobs created within the last 1,800 seconds.

{
    "result": [
        {
            "createdDate": "2026-09-10 15:58:18 UTC",
            "comments": "Predict IRIS with LinearRegression model and stores it in an OML4R datastore",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        },
        {
            "createdDate": "2026-09-10 16:42:31 UTC",
            "comments": "Return the mean of a set of random numbers",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        }
    ]
}

Jobs created more than 1,200 seconds ago.

To retrieve list of jobs created more than 1,200 seconds ago, set createdOlderThanSeconds to 1200.

curl -i -k -X GET \
    --header "Authorization: Bearer ${token}" \
    --header 'Accept: application/json' \
    "<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?createdOlderThanSeconds=1200"

The response contains jobs created more than 1,200 seconds ago.

{
    "result": [
        {
            "createdDate": "2026-09-10 15:58:18 UTC",
            "comments": "Predict IRIS with LinearRegression model and stores it in an OML4R datastore",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        },
        {
            "createdDate": "2026-09-10 16:42:31 UTC",
            "comments": "Return the mean of a set of random numbers",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        }
    ]
}

Jobs finished more than 1,200 seconds ago.

To retrieve list of jobs finished more than 1,200 seconds ago, set finishedOlderThanSeconds to 1200.

curl -i -k -X GET \
    --header "Authorization: Bearer ${token}" \
    --header 'Accept: application/json' \
    "<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?finishedOlderThanSeconds=1200"

The response contains jobs finished more than 1,200 seconds ago.

{
    "result": [
        {
            "createdDate": "2026-09-10 15:58:18 UTC",
            "comments": "Predict IRIS with LinearRegression model and stores it in an OML4R datastore",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        },
        {
            "createdDate": "2026-09-10 16:42:31 UTC",
            "comments": "Return the mean of a set of random numbers",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        }
    ]
}

List jobs with a specified status

To retrieve list of jobs with a specified status, set status to that status. The example below uses cancelled.

curl -i -k -X GET \
    --header "Authorization: Bearer ${token}" \
    --header 'Accept: application/json' \
    "<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?status=cancelled"

The response contains jobs with the CANCELLED status.

{
    "result": [
        {
            "createdDate": "2026-09-08 20:27:41 UTC",
            "comments": "long running job that sleeps 33mins",
            "job_id": "<job_id>",
            "status": "CANCELLED",
            "elapsedTime": "00:00:42"
        }
    ]
}

Jobs matching a comments pattern

To retrieve jobs whose comments match a text pattern, set commentsPattern to that pattern. The example below uses random.

curl -i -k -X GET \
    --header "Authorization: Bearer ${token}" \
    --header 'Accept: application/json' \
    "<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?commentsPattern=random"

The response contains jobs whose comments match the random pattern.

{
    "result": [
        {
            "createdDate": "2026-09-10 16:42:31 UTC",
            "comments": "Return the mean of a set of random numbers",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        }
    ]
}

List jobs matching two filters: status and comments pattern

To retrieve jobs using both status and comment pattern, send a GET request to the jobs endpoint with the status and commentsPattern query parameters. This example retrieves jobs whose status is finish and whose comments match random.

curl -i -k -X GET \
    --header "Authorization: Bearer ${token}" \
    --header 'Accept: application/json' \
    "<oml-cloud-service-location-url>/oml/api/r-scripts/v2/jobs?status=FINISH&commentsPattern=random"

The response contains matching jobs. For example:

{
    "result": [
        {
            "createdDate": "2026-09-10 16:42:31 UTC",
            "comments": "Return the mean of a set of random numbers",
            "job_id": "<job_id>",
            "status": "FINISH",
            "elapsedTime": "00:00:07"
        }
    ]
}
Back to Top