Query Data Jobs details using GraphQL
List data Jobs with GraphQL like query. By choosing which field to be returned you can control the output. You can learn more about the GraphQL queries by visiting GraphQL official website Query should be provided as GET parameter, not by POST body. Don't worry about the spaces and tabs Keep in mind that each aditional field <b>could make query response time slower, for instance deployments</b>, it's best if you request only what you need <br/><br/>
The <b>pageNumber</b> and <b>pageSize</b> arguments are required! Page number should be a <b>number greater than 1</b>, and pageSize <b>should be greater than 1</b> (per page) Check the latest example for the full list of supported query fields.<br/><br/>
Simplest query that you could make is to fetch the job names
{
jobs(pageNumber: 1, pageSize: 25) {
content {
jobName
}
}
}
You could also use filtering and sorting function. Filter object has <b>property, pattern and sort</b> fields.<br/>
- <b>property</b> points out which field you want to filter, if you point out some other field that is not supported, an invalid response will be return.<br/>
- <b>pattern</b> should be a non-empty string which the provided property should contains [ignoring cases], for instance: starshot pattern will match <b>import-starshot-sql, StarShot-servers and notify-starshot</b> job names, but it won't match <b>stars-shot-daily-prune`</b> If a pattern string is not provided, then you must atleast provide the property field<br/>
- <b>sort</b> should be an enum value - ASC (ascending) or DESC (descending) option [not required, default is ASC] Multiple filters could be applied, but <b>maximum one should contain sorting</b>!
{
jobs(
pageNumber: 1,
pageSize: 25,
filter: [{
property: "jobName",
pattern: "starshot",
sort: DESC
}],
) {
content {
jobName
}
}
}
You could also search for a string into the properties that you are requesting, for instance: This query will search for job names, team names and descriptions which contains the provided "starshot" string
{
jobs(
pageNumber: 1,
pageSize: 25,
search: "starshot"
) {
content {
jobName,
config {
team
description
}
}
}
}
Data jobs execution could also be searched by providing arguments to the <b>execution</b> field. Same as parent query arguments, the <b>pageNumber</b> and <b>pageSize</b> arguments are required! Page number should be a <b>number greater than 1</b>, and pageSize <b>should be between 1 and 100 results</b> (per page). You can also <b>filter</b> using the similar object structure as the parent query, but currently <b>filtering is not supported</b>, you can only provide field for sorting. This query will search
{
jobs(
pageNumber: 1,
pageSize: 25,
) {
content {
jobName,
deployments {
id
executions(
pageNumber: 1,
pageSize: 5,
filter: [{
teamNameIn: ["starshot"]
}],
order: {
property: "startTime",
direction: DESC
}
) {
id
status
startTime
endTime
{
}
}
}
}
Full example of currently available for fetching fields. Note that if you combine searching and filtering, first it will apply filters and then within filtered jobs it will apply the search, vice versa is currently not supported:
{
jobs(
pageNumber: 1,
pageSize: 25,
search: "daily",
filter: [{
property: "jobName",
pattern: "import-sql",
},{
property: "team",
pattern: "starshot",
sort: DESC
},{
property: "deployments.enabled",
pattern: "enabled",
}],
) {
content {
jobName
config {
team
description
sourceUrl
schedule {
scheduleCron
nextRunEpochSeconds
}
contacts {
notifiedOnJobFailureUserError
notifiedOnJobFailurePlatformError
notifiedOnJobSuccess
notifiedOnJobDeploy
}
}
deployments {
id
enabled
jobVersion
mode
executions(
pageNumber: 1,
pageSize: 25,
filter: [{
teamNameIn: ["starshot"]
}],
order: {
property: "startTime",
direction: DESC
}
) {
id
type
status
message
startTime
endTime
opId
vkdVersion
jobVersion
jobSchedule
resourcesCpuRequest
resourcesCpuLimit
resourcesMemoryRequest
resourcesMemoryLimit
deployedDate
deployedBy
startedBy
logsUrl
}
}
}
totalPages
totalItems
}
}
}
Path parameters
The Team which owns the Data Job
Query parameters
Request a GraphQL-like query.
If the query is specified and contains several named operations, an operation_name query parameter can be used to control which one should be executed
If query is specified then variables can be sent as a JSON-encoded string in an additional query parameter called variables
Response
Data Job query response
Example response
{
"data": {
"totalItems": 100,
"totalPages": 5
}
}