Jobs

Get jobs

Retrieves a list of jobs.

SecurityApiKeyAuth
Responses
200

OK

get/job/list
Request samples
Response samples
application/json
{
  • "jobs": [
    ],
  • "count": 0,
  • "from": 0,
  • "to": 0
}

Get job

Retrieves a list of jobs with specified job id.

SecurityApiKeyAuth
Request
path Parameters
job_id
required
integer (JobId)

the job id

Example: 19
Responses
200

OK

get/job/show/{job_id}
Request samples
Response samples
application/json
{
  • "cpu_time": 0,
  • "created_at": "2020-12-31 11:22:33 UTC",
  • "database": "string",
  • "duration": 10,
  • "end_at": "2020-12-31 11:22:33 UTC",
  • "hive_result_schema": "string",
  • "job_id": "19",
  • "linked_result_export_job_id": 19,
  • "num_records": 100,
  • "organization": "string",
  • "priority": 0,
  • "query": "string",
  • "result": "string",
  • "result_export_target_job_id": 19,
  • "result_size": 1048576,
  • "retry_limit": 3,
  • "start_at": "2020-12-31 11:22:33 UTC",
  • "status": "success",
  • "type": "presto",
  • "updated_at": "2020-12-31 11:22:33 UTC",
  • "url": "string",
  • "user_name": "Treasure Data",
  • "debug": {
    }
}

Get job status by id

Show the status information of the given job id at last execution as well as other related information.

SecurityApiKeyAuth
Request
path Parameters
job_id
required
integer (JobId)

the job id

Example: 19
Responses
200

OK

get/job/status/{job_id}
Request samples
Response samples
application/json
{
  • "job_id": "19",
  • "cpu_time": 0,
  • "created_at": "2020-12-31 11:22:33 UTC",
  • "end_at": "2020-12-31 11:22:33 UTC",
  • "duration": 10,
  • "num_records": 100,
  • "result_size": 1048576,
  • "start_at": "2020-12-31 11:22:33 UTC",
  • "status": "success",
  • "updated_at": "2020-12-31 11:22:33 UTC"
}

Get job status by domain_key

Checks the status of a job using the domain key.

SecurityApiKeyAuth
Request
path Parameters
domain_key
required
string (DomainKey)
Example: domain_key_123
Responses
200

OK

get/job/status_by_domain_key/{domain_key}
Request samples
Response samples
application/json
{
  • "job_id": "19",
  • "cpu_time": 0,
  • "created_at": "2020-12-31 11:22:33 UTC",
  • "end_at": "2020-12-31 11:22:33 UTC",
  • "duration": 10,
  • "num_records": 100,
  • "result_size": 1048576,
  • "start_at": "2020-12-31 11:22:33 UTC",
  • "status": "success",
  • "updated_at": "2020-12-31 11:22:33 UTC"
}

Get job statistics by id

Show the statistics of the job, including records inserted.

SecurityApiKeyAuth
Request
path Parameters
job_id
required
integer (JobId)

the job id

Example: 19
Responses
200

OK

get/job/statistics/{job_id}
Request samples
Response samples
application/json
{
  • "records_inserted": "28345"
}

Create job

Creates a job of a given type under a specified database.

SecurityApiKeyAuth
Request
path Parameters
job_type
required
string

the job type

Example: presto
database_name
required
string

database name

Example: Alpha
Request Body schema: application/json
query
string

the raw SQL query

priority
integer [ -2 .. 2 ]

job execution priority

result
string

Export Connector location

retry_limit
integer [ 0 .. 32 ]

the number of automatic retries on failure

pool_name
string

resource pool name

property name*
additional property
any
Responses
200

OK

post/job/issue/{job_type}/{database_name}
Request samples
application/json
{
  • "query": "SELECT COUNT(1) FROM www_access",
  • "priority": 0,
  • "result": "string",
  • "retry_limit": 0,
  • "pool_name": "string"
}
Response samples
application/json
{
  • "job": "19",
  • "job_id": "19",
  • "database": "Alpha"
}

kill job by id

Stops a specified job ID.

SecurityApiKeyAuth
Request
path Parameters
job_id
required
integer (JobId)

the job id

Example: 19
Responses
200

OK

post/job/kill/{job_id}
Request samples
Response samples
application/json
{ }

Set result export

Sets the results of a specified job ID.

SecurityApiKeyAuth
Request
path Parameters
job_id
required
integer (JobId)

the job id

Example: 19
Request Body schema: application/x-www-form-urlencoded
domain_key
string (DomainKey)
pool_name
string

resource pool name

priority
integer [ -2 .. 2 ]

job execution priority

query
string (QueryAsString)

the raw SQL query

retry_limit
integer [ 0 .. 32 ]
Default: 0

automatically retry this many times on failure

scheduled_time
string (DateTimeISO8601) \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(([+-]\d{2...

Datetime in ISO 8601 format (2020-12-31T11:22:33-05:00 or 2020-12-31T11:22:33Z for UTC)

target_job_id
integer (JobId)

unique identifier of job

result_connection_id
integer (ConnectionId)

the connection id

result
string

...?

database
string

database name

table
string
Responses
200

OK

post/job/result_export/{job_id}
Request samples
application/x-www-form-urlencoded
domain_key=domain_key_123&pool_name=pool_1&priority=0&query=SELECT%20%2A%20FROM%20my_table%3B&retry_limit=3&scheduled_time=2020-12-31T11%3A22%3A33Z&target_job_id=19&result_connection_id=17&result=string&database=Alpha&table=Bravo
Response samples
application/json
{
  • "cpu_time": 0,
  • "created_at": "2020-12-31 11:22:33 UTC",
  • "database": "string",
  • "duration": 10,
  • "end_at": "2020-12-31 11:22:33 UTC",
  • "hive_result_schema": "string",
  • "job_id": "19",
  • "linked_result_export_job_id": 19,
  • "num_records": 100,
  • "organization": "string",
  • "priority": 0,
  • "query": "string",
  • "result": "string",
  • "result_export_target_job_id": 19,
  • "result_size": 1048576,
  • "retry_limit": 3,
  • "start_at": "2020-12-31 11:22:33 UTC",
  • "status": "success",
  • "type": "presto",
  • "updated_at": "2020-12-31 11:22:33 UTC",
  • "url": "string",
  • "user_name": "Treasure Data",
  • "debug": {
    }
}

Create export job

Creates an export job.

SecurityApiKeyAuth
Request
path Parameters
database_name
required
string

database name

Example: Alpha
table_name
required
string
Example: Bravo
Request Body schema: application/x-www-form-urlencoded
access_key_id
string
assume_role
string
bucket
string
domain_key
string (DomainKey)
encryption
string
file_format
string
Enum: "jsonl.gz" "tsv.gz" "json.gz" "line-json.gz"
file_prefix
string
from
integer (Timestamp)
pool_name
string
secret_access_key
string
storage_type
string
Value: "s3"
to
integer (Timestamp)
Responses
200

OK

post/export/run/{database_name}/{table_name}
Request samples
application/x-www-form-urlencoded
access_key_id=a_key&assume_role=string&bucket=test_bucket&domain_key=domain_key_123&encryption=string&file_format=json.gz&file_prefix=string&from=1356998400&pool_name=pool_1&secret_access_key=secret_abc&storage_type=s3&to=1356998400
Response samples
application/json
{
  • "job": "19",
  • "job_id": "19",
  • "database": "Alpha"
}

Create partial delete job

Creates a partial delete job.

SecurityApiKeyAuth
Request
path Parameters
database_name
required
string

database name

Example: Alpha
table_name
required
string
Example: Bravo
Request Body schema: application/x-www-form-urlencoded
domain_key
string (DomainKey)
Timestamp (integer) or DateTimeAsString (string) or DateTimeISO8601 (string)
pool_name
string
Timestamp (integer) or DateTimeAsString (string) or DateTimeISO8601 (string)
Responses
200

OK

post/table/partialdelete/{database_name}/{table_name}
Request samples
application/x-www-form-urlencoded
domain_key=domain_key_123&from=1356998400&pool_name=pool_1&to=1356998400
Response samples
application/json
{
  • "job_id": 19,
  • "database": "Alpha",
  • "table": "Bravo",
  • "from": 1356998400,
  • "to": 1356998400
}

Get job results

Retrieves job results.

SecurityApiKeyAuth
Request
path Parameters
job_id
required
integer (JobId)

the job id

Example: 19
query Parameters
header
boolean

whether to show the headers or not

nullify_special
boolean

convert NaN and Infinity values into null. Not available for formats msgpack or msgpack.gz

Responses
200

OK

get/job/result/{job_id}
Request samples