Document toolboxDocument toolbox

Job requests

All query requests that forward their results to data storage systems like HDFS, Kafka, or S3 are assigned job IDs so that they can be monitored and managed. The job ID for a query is contained in the notification message returned to the query sender when the request is launched. This ID is used to monitor the status of the query or to manage it.

The request action is specified by appending the following paths to the endpoint URL:

All requests must use one of the three supported authorization methods. In the example requests below, we use the API key + API secret authorization method.

GET /job/${jobId}

This returns the current status of the query and some other basic information. 

Parameters

Parameter

Type

Description

Parameter

Type

Description

jobId *required

String (path)

The job ID of the query. This appears in the url parameter.

Content-Type *required

String (header)

This must always be application/json.

x-logtrust-apikey *required

String (header)

The API key of the Devo domain. You can find this in the Access Keys tab of the Administration → Credentials window.

x-logtrust-sign *required

String (header)

HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp.

x-logtrust-timestamp *required

String (header)

Timestamp in milliseconds.

Example

import requests url = "https://apiv2-us.devo.com/search/job/3f6002a9-69cb-4495-9745-d47216fc58bf" headers = { 'Content-Type': "application/json", 'x-logtrust-apikey': "my api key", 'x-logtrust-timestamp': "1530010004072", 'x-logtrust-sign': "e5841c4ee56a58d2918cc052136799b42c8a95aa2b947b06a91d3827f4178136", 'Cache-Control': "no-cache", } response = requests.request("GET", url, headers=headers) print(response.text)

Response

The response may contain the following fields. 

Field name

Type

Description

Field name

Type

Description

success

Boolean

Indicates if the request was successful or not. Possible values are true (OK) or false (error)

msg

String

In the case of error, this describes what type of error occurred.

status

Integer

Numeric value that specifies the error code.

  • 0 - OK

  • 1 - Invalid request

cid

String

This is the ID that uniquely identifies the request.

timestamp

String

Indicates the moment when a certain event occurred.

object

Object

Job_Status object containing the current status of the job, the job id, events processed, and information about any errors generated.

Example

{ "status": 0, "cid": "Yh7lwm6VWq", "timestamp": 1530010004752, "object": { "status": "COMPLETED", "id": "3f6002a9-69cb-4495-9745-d47216fc58bf", "eventGenerated": 13572, "eventsSent": 13572, "lastDatetime": 1528278403836, "error": [] } }

GET /jobs

This returns the status of all the queries that the account has launched and which are currently running.

Parameters

Parameter

Type

Description

Parameter

Type

Description

x-logtrust-apikey *required

String (header)

The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window.

Content-Type *required

String (header)

This must always be application/json.

x-logtrust-sign *required

String (header)

HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp.

x-logtrust-timestamp *required

String (header)

Timestamp in milliseconds.

Example

import requests url = "https://apiv2-us.devo.com/search/jobs" headers = { 'Content-Type': "application/json", 'x-logtrust-apikey': "my api key", 'x-logtrust-timestamp': "1530009038403", 'x-logtrust-sign': "662b2178b8857956cb63e6e68684a9b196e66b1d31ccdd04fd1aa60f00dcf9b3", 'Cache-Control': "no-cache", } response = requests.request("GET", url, headers=headers) print(response.text)

Response

Field name

Type

Description

Field name

Type

Description

success

Boolean

Indicates if the request was successful or not. Possible values are true (OK) or false (error).

msg

String

In the case of error, this describes what type of error occurred.

status

Integer

Numeric value that specifies the error code.

  • 0 - OK

  • 1 - Invalid request

cid

String

This is the ID that uniquely identifies the request.

timestamp

String

Indicates the moment when a certain event occurred.

object

Object

List of all the active jobs, including their current status, job IDs, and more.

Example

GET /job/stop/${jobId}

This stops a currently running query.  Once stopped, a lastDatetime value is saved so that when the job is started again, it will pick up where it left off.  The lastDatetime parameter is contained in the object returned in the response.

Parameters

Parameter

Type

Description

Parameter

Type

Description

jobId *required

String (path)

The job ID of the query. This appears in the url parameter

Content-Type *required

String (header)

This must always be application/json

x-logtrust-apikey *required

String (header)

The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window.

x-logtrust-sign *required

String (header)

HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp.

x-logtrust-timestamp *required

String (header)

Timestamp in milliseconds.

Example

Response

Field name

Type

Description

Field name

Type

Description

success

Boolean

Indicates if the request was successful or not. Possible values are true (OK) or false (error).

msg

String

In the case of error, this describes what type of error occurred.

status

Integer

Numeric value that specifies the error code.

  • 0 - OK

  • 1 - Invalid request

cid

String

This is the ID that uniquely identifies the request.

timestamp

String

Indicates the moment when a certain event occurred.

object

Object

Job_Status object containing the current status of the job, the job id, events processed, and information about any errors generated.

Example

GET /job/start/${jobId}

This starts a query that was previously stopped. The query will continue from the time saved as the lastDatetime.

Parameters

Parameter

Type

Description

Parameter

Type

Description

jobId *required

String (path)

The job ID of the query. This appears in the url parameter.

Content-Type *required

String (header)

This must always be application/json.

x-logtrust-apikey *required

String (header)

The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window.

x-logtrust-sign *required

String (header)

HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp.

x-logtrust-timestamp *required

String (header)

Timestamp in milliseconds.

Example

Response

Field name

Type

Description

Field name

Type

Description

success

Boolean

Indicates if the request was successful or not. Possible values are true (OK) or false (error).

msg

String

In the case of error, this describes what type of error occurred.

status

Integer

Numeric value that specifies the error code.

  • 0 - OK

  • 1 - Invalid request

cid

String

This is the ID that uniquely identifies the request.

timestamp

String

Indicates the moment when a certain event occurred.

object

Object

Details of the selected job, including its current status, job ID, last time active (lastDatetime), and more.

Example

GET /job/remove/${jobId}

Removes a query.

Parameters

Parameter

Type

Description

Parameter

Type

Description

jobId *required

String (path)

The job ID of the query. This appears in the url parameter.

Content-Type *required

String (header)

This must always be application/json

x-logtrust-apikey *required

String (header)

The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window.

x-logtrust-sign *required

String (header)

HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp.

x-logtrust-timestamp *required

String (header)

Timestamp in milliseconds.

Example

Response

Field name

Type

Description

Field name

Type

Description

success

Boolean

Indicates if the request was successful or not. Possible values are true (OK) or false (error).

msg

String

In the case of error, this describes what type of error occurred.

status

Integer

Numeric value that specifies the error code.

  • 0 - OK

  • 1 - Invalid request

cid

String

This is the ID that uniquely identifies the request.

timestamp

String

Indicates the moment when a certain event occurred.

object

Object

ExampleDetails of the selected job, including its current status, job ID, last time active (lastDatetime), and more.

Example