Skip to content

Latest commit

 

History

History
258 lines (189 loc) · 6.47 KB

jobs.md

File metadata and controls

258 lines (189 loc) · 6.47 KB

OpenHouse APIs v0.0.1

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:

Terms of service

License: Apache 2.0

Job

Cancel Job

Code samples

PUT /jobs/{jobId}/cancel

Cancels the job given jobId

Parameters

Name In Type Required Description
jobId path string true Job ID

Responses

Status Meaning Description Schema
200 OK Job PUT: UPDATED None
404 Not Found Job PUT: NOT_FOUND None
409 Conflict Job PUT: CONFLICT None
This operation does not require authentication

Submit a Job

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'}"
}

Parameters

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"
}

Responses

Status Meaning Description Schema
201 Created Job POST: CREATED JobResponseBody
400 Bad Request Job POST: BAD_REQUEST JobResponseBody
This operation does not require authentication

Get Job

Code samples

GET /jobs/{jobId}

Returns a Job resource identified by jobId.

Parameters

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"
}

Responses

Status Meaning Description Schema
200 OK Job GET: OK JobResponseBody
404 Not Found Job GET: NOT_FOUND JobResponseBody
This operation does not require authentication

Schemas

CreateJobRequestBody

{
  "jobName": "my_job",
  "clusterId": "my_cluster",
  "jobConf": "{'jobType': 'RETENTION', 'table': 'db.tb'}"
}

Request containing details of the Job to be created

Properties

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

JobConf

"{'jobType': 'RETENTION', 'table': 'db.tb'}"

Job config

Properties

Name Type Required Restrictions Description
jobType string false none none
proxyUser string false none none
args [string] false none none

Enumerated Values

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

JobResponseBody

{
  "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"
}

Properties

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

Enumerated Values

Property Value
state QUEUED
state RUNNING
state CANCELLED
state FAILED
state SUCCEEDED