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 |
---|---|---|
| String (path) | The job ID of the query. This appears in the url parameter. |
| String (header) | This must always be |
| String (header) | The API key of the Devo domain. You can find this in the Access Keys tab of the Administration → Credentials window. |
| String (header) | HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp. |
| 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 |
---|---|---|
| Boolean | Indicates if the request was successful or not. Possible values are |
| String | In the case of error, this describes what type of error occurred. |
| Integer | Numeric value that specifies the error code.
|
| String | This is the ID that uniquely identifies the request. |
| String | Indicates the moment when a certain event occurred. |
| 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 |
---|---|---|
| String (header) | The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window. |
| String (header) | This must always be |
| String (header) | HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp. |
| 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 |
---|---|---|
| Boolean | Indicates if the request was successful or not. Possible values are |
| String | In the case of error, this describes what type of error occurred. |
| Integer | Numeric value that specifies the error code.
|
| String | This is the ID that uniquely identifies the request. |
| String | Indicates the moment when a certain event occurred. |
| 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 |
---|---|---|
| String (path) | The job ID of the query. This appears in the url parameter |
| String (header) | This must always be |
| String (header) | The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window. |
| String (header) | HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp. |
| String (header) | Timestamp in milliseconds. |
Example
Response
Field name | Type | Description |
---|---|---|
| Boolean | Indicates if the request was successful or not. Possible values are |
| String | In the case of error, this describes what type of error occurred. |
| Integer | Numeric value that specifies the error code.
|
| String | This is the ID that uniquely identifies the request. |
| String | Indicates the moment when a certain event occurred. |
| 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 |
---|---|---|
| String (path) | The job ID of the query. This appears in the url parameter. |
| String (header) | This must always be |
| String (header) | The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window. |
| String (header) | HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp. |
| String (header) | Timestamp in milliseconds. |
Example
Response
Field name | Type | Description |
---|---|---|
| Boolean | Indicates if the request was successful or not. Possible values are |
| String | In the case of error, this describes what type of error occurred. |
| Integer | Numeric value that specifies the error code.
|
| String | This is the ID that uniquely identifies the request. |
| String | Indicates the moment when a certain event occurred. |
| Object | Details of the selected job, including its current status, job ID, last time active ( |
Example
GET /job/remove/${jobId}
Removes a query.
Parameters
Parameter | Type | Description |
---|---|---|
| String (path) | The job ID of the query. This appears in the url parameter. |
| String (header) | This must always be |
| String (header) | The API key of the Devo domain. You can find this in Access Keys tab of the Administration → Credentials window. |
| String (header) | HMAC SHA-256 using the API secret to sign the concatenation of the API key, body message and timestamp. |
| String (header) | Timestamp in milliseconds. |
Example
Response
Field name | Type | Description |
---|---|---|
| Boolean | Indicates if the request was successful or not. Possible values are |
| String | In the case of error, this describes what type of error occurred. |
| Integer | Numeric value that specifies the error code.
|
| String | This is the ID that uniquely identifies the request. |
| String | Indicates the moment when a certain event occurred. |
| Object | ExampleDetails of the selected job, including its current status, job ID, last time active ( |