Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
API description for OpenHouse API
Base URLs:
License: Apache 2.0
Code samples
PUT /jobs/{jobId}/cancel
Cancels the job given jobId
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Job ID |
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Job PUT: UPDATED | None |
404 | Not Found | Job PUT: NOT_FOUND | None |
409 | Conflict | Job PUT: CONFLICT | None |
Code samples
POST /jobs
Submits a Job and returns a Job resource.
Body parameter
{
"jobName": "my_job",
"clusterId": "my_cluster",
"jobConf": "{'jobType': 'RETENTION', 'table': 'db.tb'}"
}
Name | In | Type | Required | Description |
---|---|---|---|---|
body | body | CreateJobRequestBody | true | none |
Example responses
201 Response
{
"jobId": "my_job_8347adee-65b7-4e05-86fc-196af04f4e68",
"jobName": "my_job",
"clusterId": "my_cluster",
"state": "SUCCEEDED",
"creationTimeMs": 1651002318265,
"startTimeMs": 1651002318265,
"finishTimeMs": 1651002318265,
"lastUpdateTimeMs": 1651002318265,
"jobConf": "{'jobType': 'RETENTION', 'table': 'db.tb'}",
"executionId": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
201 | Created | Job POST: CREATED | JobResponseBody |
400 | Bad Request | Job POST: BAD_REQUEST | JobResponseBody |
Code samples
GET /jobs/{jobId}
Returns a Job resource identified by jobId.
Name | In | Type | Required | Description |
---|---|---|---|---|
jobId | path | string | true | Job ID |
Example responses
200 Response
{
"jobId": "my_job_8347adee-65b7-4e05-86fc-196af04f4e68",
"jobName": "my_job",
"clusterId": "my_cluster",
"state": "SUCCEEDED",
"creationTimeMs": 1651002318265,
"startTimeMs": 1651002318265,
"finishTimeMs": 1651002318265,
"lastUpdateTimeMs": 1651002318265,
"jobConf": "{'jobType': 'RETENTION', 'table': 'db.tb'}",
"executionId": "string"
}
Status | Meaning | Description | Schema |
---|---|---|---|
200 | OK | Job GET: OK | JobResponseBody |
404 | Not Found | Job GET: NOT_FOUND | JobResponseBody |
{
"jobName": "my_job",
"clusterId": "my_cluster",
"jobConf": "{'jobType': 'RETENTION', 'table': 'db.tb'}"
}
Request containing details of the Job to be created
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
jobName | string | true | none | Name of a job, doesn't need to be unique |
clusterId | string | true | none | Unique identifier for the cluster |
jobConf | JobConf | false | none | Job config |
"{'jobType': 'RETENTION', 'table': 'db.tb'}"
Job config
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
jobType | string | false | none | none |
proxyUser | string | false | none | none |
args | [string] | false | none | none |
Property | Value |
---|---|
jobType | NO_OP |
jobType | SQL_TEST |
jobType | RETENTION |
jobType | ORPHAN_FILES_DELETION |
jobType | SNAPSHOTS_EXPIRATION |
jobType | STAGED_FILES_DELETION |
jobType | ORPHAN_DIRECTORY_DELETION |
{
"jobId": "my_job_8347adee-65b7-4e05-86fc-196af04f4e68",
"jobName": "my_job",
"clusterId": "my_cluster",
"state": "SUCCEEDED",
"creationTimeMs": 1651002318265,
"startTimeMs": 1651002318265,
"finishTimeMs": 1651002318265,
"lastUpdateTimeMs": 1651002318265,
"jobConf": "{'jobType': 'RETENTION', 'table': 'db.tb'}",
"executionId": "string"
}
Name | Type | Required | Restrictions | Description |
---|---|---|---|---|
jobId | string | true | none | Unique auto-generated identifier for job prefixed with jobName |
jobName | string | true | none | Name of a job, doesn't need to be unique |
clusterId | string | true | none | Unique identifier for the cluster |
state | string | true | none | Current job state, possible states: QUEUED, ACTIVE, CANCELLED, FAILED, SUCCEEDED |
creationTimeMs | integer(int64) | true | none | Job creation time in unix epoch milliseconds |
startTimeMs | integer(int64) | false | none | Job start time in unix epoch milliseconds |
finishTimeMs | integer(int64) | false | none | Job finish time in unix epoch milliseconds |
lastUpdateTimeMs | integer(int64) | false | none | Job contents last update time in unix epoch milliseconds |
jobConf | JobConf | false | none | Job config |
executionId | string | false | none | Execution ID generated from engine where job is submitted |
Property | Value |
---|---|
state | QUEUED |
state | RUNNING |
state | CANCELLED |
state | FAILED |
state | SUCCEEDED |