Managing Jobs

Understand Platform API operations for viewing and managing jobs

Overview

A job is a long-running process that consumes significant system resources, such as modeling a location, importing exposure data, or updating portfolios in bulk.

The Platform APIs are a collection of APIs that support catastrophe modeling and other workflows on the Intelligent Risk Platform. Each Platform API exposes operations for creating, fetching, and updating different types of platform jobs.

A Platform API will generally support four operations for managing jobs within an API: Create Job, Search Jobs, Get Job, and Update Job.

OperationMethodEndpointDescription
Create JobPOST/platform/{api}/v1/jobsCreates a job.
Search JobsGET/platform/{api}/v1/jobsReturns filtered list of jobs.
Get JobGET/platform/{api}/v1/jobs/{jobId}Returns specific job.
Update JobPATCH/platform/{api}/v1/jobs/{jobId}Cancels or updates priority of specific job.

The following sections describe in general terms how to use Platform API operations to manage the lifecycle of platform jobs.

Creating Jobs

A Create Job operation is an operation that defines and initiates a job on the Intelligent Risk Platform.

In general, every Create Job operation is identified by a name that consists of three parts: the word create, the name of API, and the word job. For example, the Create Model Job is a Model Job API operation that creates different types of catastrophe modeling jobs, e.g. ALM, DLM, and HD jobs.

curl --request POST \
     --url https://api-euw1.rms.com/platform/model/v1/jobs \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-rms-resource-group-id: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \
     --data '
{ // Body Paramerters}
'

Most Create Job operations require that the client specify the ID number of a resource group in a mandatory x-rms-resource-group-id header parameter. A header parameter is a parameter passed in an HTTP request header that specifies information about the client making the request or about the requested resource.

The Intelligent Risk Platform manages and tracks all job-related resource quotas via resource groups. The resource group manages and tracks the number of jobs that the tenant runs. It defines the maximum number concurrent of primary jobs, the maximum number of concurrent secondary jobs, and the total number of jobs that the tenant may run during the day. For information see Resource Groups.

A Create Job will return either a 201 Created or 202 Accepted HTTP status code and the URI of a newly created job that has been added to a workflow queue. The client application can use this URI to poll the status of the job during processing. For details, see Polling Jobs

Searching Jobs

Platform APIs support operations that enable tenants to search lists of jobs created using the API. These operations are identified by a name that consists of three parts: the word search, the name of API, and the word jobs, e.g. Search Model Jobs.

In general,Search operations support filtering of response data using query parameters that are appended as query strings to the endpoint of the request.

curl --request GET \
     --url 'https://api-euw1.rms.com/platform/model/v1/jobs?limit=20&offset=0' \
     --header 'accept: application/json'

A filter consists of a single expression that defines a property, a condition (a property value), and an operator (e.g. = or LIKE). The filter keyword also supports comparison operators, logical operators, list operators, and identity operators. The same query string supports sorting and pagination of results. To learn more, see Filtering and Pagination

Search Job operations return high-level information about a list of jobs. For each job, the response may return the jobId, status, type, progress, and other information.

[
  {
    "jobId": "54",
    "userName": "[email protected]",
    "status": "QUEUED",
    "submittedAt": "2024-01-01T00:00:00.000Z",
    "startedAt": "2024-01-01T00:00:00.000Z",
    "endedAt": "2024-01-01T00:00:00.000Z",
    "name": "DLM_model",
    "type": "DLM",
    "progress": 0,
    "priority": "medium",
    "entitlement": "RI-RISKMODELER",
    "resourceGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "details": { // details},
    "warnings": [ //warnings]
  },
  {
    "jobId": "55",
    "userName": "[email protected]",
    "status": "FINISHED",
    "submittedAt": "2024-01-01T00:00:00.000Z",
    "startedAt": "2024-01-01T00:00:00.000Z",
    "endedAt": "2024-01-01T00:00:00.000Z",
    "name": "HD_model",
    "type": "HD",
    "progress": 100,
    "priority": "high",
    "entitlement": "RI-RISKMODELER",
    "resourceGroupId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "details": { // details},
    "warnings": [ //warnings]
  }
]

A Search Job operation may return different job properties depending on the API. In general, a request will return the following information for each job returned:

PropertyTypeDescription
jobIdStringID of the job.
userNameStringLogin the principal (user or client) that submitted the job.
statusStringStatus of the job. Each status marks a stage in the workflow progress from submission to completion. One of CANCELLED, CANCELING, CANCEL_REQUESTED, FAILED, FINISHED, PENDING, QUEUED, or RUNNING.
submittedAtStringDate and time that the job was submitted in ISO 8601 format, e.g. 2020-01-01T00:00:00.000Z. Begins when job status is QUEUED.
startedAtStringDate and time that job was started in ISO 8601 format, e.g. 2020-01-01T00:00:00.000Z. Begins when job status is RUNNING.
endedAtStringDate and time that job ended in ISO 8601 format, e.g. 2020-01-01T00:00:00.000Z. Begins when job status is CANCELLED, FAILED, or FINISHED.
nameStringUser-defined name of the job.
typeStringType of the job. Some Platform APIs support multiple job types, e.g. the Model API supports ALM, DLM, and HD jobs.
priorityStringPriority of the job. One of Very High, High, Medium, Low, Very Low. By default, Medium.
progressStringPercentage of job completion. Once the job is RUNNING, the progress value increases until it reaches 100, i.e. FINISHED. `
entitlementStringEntitlement of the principal that submitted the job.
resourceGroupIdStringID of the resource group charged the usage of the job quota.
detailsObjectObject that returns detailed information about the job. Contents depends on the API, e.g. resources, summary.
warningsArrayList of warnings.

Search Jobs by API

The job details returned depend on the operation. In general, the job returned are limited to the jobs created using a specific Platform API. The Search Risk Data Jobs operation return information about risk data jobs only.

APIOperationJobs
Accumulation APISearch Accumulation JobsACCUMULATION
Admin Data APISearch Admin Data JobsARCHIVE_EDM, ARCHIVE_SECURABLE, COPY_TO_ARCHIVEPY, DELETE_ARCHIVE, DELETE_SECURABLE
Batch APISearch Batch JobsEXPOSURE_BATCH_EDIT
Clone APISearch Clone Jobs
Copy APISearch Copy JobsCOPY_ACCOUNT, COPY_AGGREGATE_PORTFOLIO, COPY_PORTFOLIO
Currency Conversion APISearch Currency Conversion JobsCONVERT_ACCOUNT_CURRENCY, CONVERT_AGGREGATE_PORTFOLIO_CURRENCY, CONVERT_PORTFOLIO_CURRENCY, CONVERT_RESULT_CURRENCY, CONVERT_TREATY_CURRENCY
ESG Data APISearch ESG Jobs
Enrich Exposure APISearch Enrich Exposure Jobs
Export APISearch Export JobsBH_ROLLUP_DOWNLOAD_CSV, BULK_EDIT, BULK_EXPORT, DOWNLOAD_EDM, DOWNLOAD_RDM, DOWNLOAD_PEQT, DOWNLOAD_REPORT, DOWNLOAD_RESULTS, DOWNLOAD_LOCATION_RESULTS, DOWNLOAD_EXPOSURE_RESOURCE
Geohaz APISearch Geohaz JobsGEOHAZ
Grouping APISearch Grouping JobsGROUPING
Import APISearch Import JobsALM_IMPORT, OED_IMPORT, MRI_IMPORT, UPLOAD_EDM, UPLOAD_RDM
Model APISearch Model JobsALM, DLM, HD
Risk Data APISearch Risk Data JobsBULK_EDIT, CLIMATE_CHANGE, CREATE_EDM, DELETE_ACCOUNT, DELETE_AGGREGATE_PORTFOLIO, DELETE_PORTFOLIO, DELETE_RDM, DEREGISTER_DATA_BRIDGE_EDM EDM2EDM, MAP_PERSPECTIVE, MARGINAL_IMPACT, PATE, PLT_TO_ELT, RENAME_ANALYSIS, REPORT_GENERATION, RERUN_EP, SIMULATE_LOSSES
Rollup APISearch Rollup Jobs
STEP APISearch STEP JobsSTEP_TOOL

Search All Jobs

The Search Tenant Job operation is special in that it returns a list of all jobs initiated by any Platform API. The Search Tenant Jobs operation returns information about all tenant jobs regardless of the Platform API used to create the job.

Uniquely, the Search Tenant Job operation supports the platformOperationType query parameter which supports filtering jobs by operation type. The following platformOperationType values are supported: platform-accumulation, platform-batch, platform-export, platform-geohaz, platform-grouping, platform-import, platform-model, platform-riskdata, platform-rollupo, platform-variation, platfrom-currencyconversion

Getting Jobs

Every Platform API that exposes an operation for initiating a job, also supports operations for "polling" the status of that job. These operations are identified by a name that consists of three parts: the word get, the name of API, and the word job, e.g. Get Model Job.

A Get Job operation is an operation that returns detailed information about a single job. These operations are typically used in polling the status during processing.

Polling is a technique that enables applications to make non-blocking requests that is useful when the application needs to use services that require long-running processes, such as Intelligent Risk Platform jobs.

Each Platform API exposes distinct resources for tracking the status of API jobs. Platform jobs have their own namespace but are globally identifiable. For example, An import job is identifiable with its URI: /platform/import/v1/jobs/123 ; And the job 123 is also globally unique (Operations at tenant level is scheduled for future release

APIOperation
Accumulation APIGet Accumulation Job
Admin Data APIGet Admin Data ob
Batch APIGet Batch ob
Bulk Geohaz APIGet Bulk Geohaz Job
Clone APIGet Clone Job
Copy APIGet Copy Job
Currency Conversion APIGet Currency Conversion ob
Enrich Exposure APIGet Enrich Exposure Job
Export APIGet Export Job
Geohaz APIGet Geohaz Job
Grouping APIGet Grouping Job
Import APIGet Import Job
Model APIGet primary job
Risk Data APIGet Risk Data Job
Rollup APIGet Rollup Job
STEP APIGet STEP Job
Variation APIGet Variation Job

Responses

The response object returned depends on the API.

For example, the Get Risk Data Job operation returns information about a single job created using Risk Data API operations. The response returns metadata about that job including its ID, status, and progress:

{
  "jobId": "string",
  "userName": "string",
  "status": "QUEUED",
  "submittedAt": "string",
  "startedAt": "string",
  "endedAt": "string",
  "name": "string",
  "type": "string",
  "progress": 0,
  "details": {
    "resources": [
      {
        "uri": "string"
      }
    ],
    "summary": "string"
  },
  "tasks": [
    {
      "taskId": "string",
      "guid": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "jobId": "string",
      "status": "QUEUED",
      "submittedAt": "string",
      "createdAt": "string",
      "name": "string",
      "percentComplete": 0,
      "priorTaskGuids": ["3fa85f64-5717-4562-b3fc-2c963f66afa6"],
      "output": {
        "summary": "string",
        "errors": [
          {
            "message": "string"
          }
        ],
        "log": {
          "additionalProp": "string"
        }
      }
    }
  ]
}

The properties returned depend on the API.

PropertyDescription
detailsObject that returns detailed information about the job. Contents of this object differs depends on the API.
endedAtDate and time that job ended.
entitlementEntitlement of the principal that created the job.
jobIdID of the job. Use the ID to view detailed information about a specific job.
nameUser-defined name of the job.
priorityPriority of the job.
progressCurrent progress of the job.
resourceGroupIdResource group ID specified in the job request.
startedAtDate and time that job was started.
statusStatus of the job. One of CANCELED, CANCELING, CANCEL_REQUESTED, FAILED, FINISHED, PENDING, QUEUED, or RUNNING.
submittedAtDate and time that the job was submitted.
tasksA list of tasks processed within a job.
typeType of the job. Some Platform APIs support multiple job types, e.g. the Risk Data API.
userNameLogin the principal that submitted the job.
warningsObject returned by some APIs.

Polling Job Status

A successful response returns the job object, which provides detailed information about this job including the submitTime, startTime, type, job details, and its status:

StatusDefinition
PENDINGThe job is pending. Follow by the QUEUED status.
QUEUEDThe job has been added to the queue. Follow by the RUNNING status.
RUNNINGThe platform is processing the job. Follow by the FINISHED or FAILED status.
FINISHEDThe job is finished.
FAILEDThe job has failed.
CANCEL_REQUESTEDThe platform has received a request to cancel the job. Follow by the CANCELING status.
CANCELINGThe platform is canceling the job. Follow by the CANCELING status.
CANCELEDThe job has been canceled.

Updating Jobs

Platform APIs support operations for updating the status or priority of a job. These operations are identified by a name that consists of three parts: the word update, the name of API, and the word job, e.g. Update Model Job.

Update Job operations support two primary functions: changing the priority of a job and changing the status of a job.

Platform API operations that support updating the priority and status of jobs.

APIOperation
Accumulation APIUpdate Accumulation Job
Admin Data APIUpdate Admin Data Job
Batch APIUpdate Batch Job
Bulk Geohaz APIUpdate Bulk Geohaz Job
Clone APIUpdate Clone Job
Copy APIUpdate Copy Job
Currency Conversion APIUpdate Currency Conversion Job
Enrich Exposure APIUpdate Enrich Exposure Job
ESG Data APIUpdate ESG Data Job
Export APIUpdate Export Job
Geohaz APIUpdate Geohaz Job
Grouping APIUpdate Grouping Job
Import APIUpdate Import Job
Model APIUpdate primary job
Risk Data APIUpdate Risk Data Job
Rollup APIUpdate Rollup Job
STEP APIUpdate STEP Job
Variation APIUpdate Variation Job

Changing Job Priority

An Update Job operation can be used to change the priority of a job.

The priority of a job indicates its relevant importance compared to the other jobs in that job queue. One of Very High, High, Medium, Low, Very Low. In general, a job with a lower priority (e.g. Very Low) is run later than a job with a higher priority (e.g. Very High). By default, every job added to a job queue is assigned a Medium priority.

This operation enables the client to change the priority of job.

curl --request PATCH \
     --url https://api-euw1.rms.com/platform/riskdata/v1/jobs/578 \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "priority": "veryhigh"
}
'

Every job added to a job queue is assigned the same priority: Medium. This means that the Scheduler does not take the priority of a job into account when it schedules a job for processing. In general, jobs are processed in the order submitted using a best-effort, FIFO policy. The Scheduler will also take the tenant's resource quota into account.

Most Platform APIs offer an operation for updating the priority jobs in the workflow queue. For example, the Update Risk Data Job operation supports updating the priority of jobs.

Principals assigned to a group with the Portfolio Manager or Cat Modeler role can change the priority of jobs.

Cancelling Jobs

An Update Job operation can be used to change the status of a job.

Any job can be canceled if its current status is QUEUED. Once canceled, the job progresses through the following job statuses in order: CANCEL_REQUESTED, CANCELING, CANCELED.

curl --request PATCH \
     --url https://api-euw1.rms.com/platform/riskdata/v1/jobs/jobId \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "status": "CANCELLED"
}
'

In general, a Platform API job can only be cancelled if it has a QUEUED status. A subset of Risk Data API jobs can be canceled if it has a PENDING or RUNNING job status: ALM, BATCH, CLIMATE_CHANGE, CONVERT_RESULT_CURRENCY, DLM, HD, DOWNLOAD_RDM.

A canceled job does not count against the tenant’s entitlement resource quota.

Most Platform APIs expose an operation that supports the cancellation of a job in the workflow queue. For example, the Update Risk Data Job operation supports canceling a variety of risk data jobs.