GET /schedule/list

This operation gets a list of schedules.

HTTP Verb

Resource

Description

GET

/v3/schedule/list

Gets a list of schedules.

Sample Response

Status: 200 OK  

{
  "schedules": [
    {
      "created_at": "2020-12-31T11:22:33.000Z",
      "cron": "string",
      "database": "Alpha",
      "delay": 5,
      "engine_version": "stable",
      "name": "string",
      "priority": 1,
      "query": "string",
      "retry_limit": 3,
      "timezone": "UTC",
      "type": "string",
      "user_name": "Jake Becker"
    }
  ]
}

POST /schedule/create/:schedule_name

This operation creates a scheduled query.

HTTP Verb

Resource

Description

POST

/v3/schedule/create/:schedule_name

Create a scheduled query

Parameter Name

Required

Type

Description

schedule_name

Yes

String

Name of a schedule

Request Body

Property Name

Required

Type

Description

cron

No

string

nullable

database

Yes

string

 

database name

delay

No

integer

 Example: >= 0 Nullable

engine_version

No

string

 

the version of the query engine for the query, can be a version release name (e.g 'stable') or version number (e.g '0.205')

pool_name

No

string

 

resource pool name

priority

No

integer

Example:  [ -2 .. 2 ]

retry_limit

No

integer

Example:  [ 0 .. 32 ]

query

Yes

string

 

result

No

string

 

url of the result

timezone

No

string (Timezone)

 

type

Yes

string

 

Sample Response

Status: 200 OK  

{
  "created_at": "2020-12-31T11:22:33.000Z",
  "cron": "string",
  "database": "Alpha",
  "delay": 5,
  "name": "string",
  "query": "string",
  "timezone": "UTC",
  "type": "string",
  "user_name": "Jake Becker"
}

POST /schedule/delete/:schedule_name

This operation deletes a scheduled query.

HTTP Verb

Resource

Description

POST 

/v3/schedule/delete/:schedule_name

 Delete scheduled query

Parameter Name

Required

Type

Description

schedule_name

Yes

String

Name of a schedule

Sample Response

Status: 200 OK  

{
  "created_at": "2020-12-31T11:22:33.000Z",
  "cron": "string",
  "database": "Alpha",
  "delay": 5,
  "name": "string",
  "query": "string",
  "timezone": "UTC",
  "type": "string",
  "user_name": "Jake Becker"
}

POST /schedule/update/:schedule_name

This operation updates a scheduled query.

HTTP Verb

Resource

Description

POST 

/v3/schedule/update/:schedule_name

 Update a scheduled query

Parameter Name

Required

Type

Description

schedule_name

Yes

String

Name of a schedule

Request Body

Property Name

Required

Type

Description

cron

No

string

nullable

database

Yes

string

 

database name

delay

No

integer

Example: >= 0 Nullable

engine_version

No

string

 

the version of the query engine for the query, can be a version release name (e.g 'stable') or version number (e.g '0.205')

pool_name

No

string

 

resource pool name

priority

No

integer

Example:  [ -2 .. 2 ]

retry_limit

No

integer

Example:  [ 0 .. 32 ]

query

Yes

string

 

result

No

string

 

URL of the result

timezone

No

string (Timezone)

 

type

Yes

string

 

Sample Response

Status: 200 OK  

{
"created_at": "2020-12-31T11:22:33.000Z",
"cron": "string",
"database": "Alpha",
"delay": 5,
"name": "string",
"query": "string",
"timezone": "UTC",
"type": "string",
"user_name": "Jake Becker"
}

POST /schedule/run/:schedule_name/:schedule_time

This operation runs a scheduled query.

HTTP Verb

Resource

Description

POST 

/v3/schedule/run/:schedule_name/:schedule_time

 Run a scheduled query

Parameter Name

Required

Type

Description

schedule_name

Yes

String

Name of a schedule

 schedule_time

 Yes

Integer(Timestamp)

Time of the Schedule

Sample Response

Status: 200 OK  

{
  "jobs": [
    {
      "job_id": 19,
      "type": "presto",
      "scheduled_at": "2020-12-31 11:22:33 UTC"
    }
  ]
}

GET /schedule/history/:schedule_name

This operation shows the history of the execution of the specified scheduled query.

HTTP Verb

Resource

Description

GET 

/v3/schedule/history/:schedule_name

Get the history of scheduled execution

Parameter Name

Required

Type

Description

schedule_name

Yes

String

Name of a schedule

Sample Response

Status: 200 OK  

{
  "count": 20,
  "from": 5,
  "to": 15,
  "history": [
    {
      "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": null,
      "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": "Jake Becker",
      "scheduled_at": "2020-12-31 11:22:33 UTC"
    }
  ]
}

 

  • No labels