Retrieve Build Schedules
Retrieve a build schedule by id
The following query retrieves a build schedule by id:
- Query
- cURL
query GetBuildSchedule($buildScheduleId: ObjectID!) {
node(id: $buildScheduleId) {
... on BuildSchedule {
name
startAt
repetitionRate
nextRunAt
lastRunStartedAt
account {
id
name
}
buildScheduleTestSuites {
nodes {
id
testSuite {
id
name
}
lastRunBuild {
id
status
createdAt
}
}
}
createdAt
updatedAt
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query GetBuildSchedule($buildScheduleId: ObjectID!) { node(id: $buildScheduleId) { ... on BuildSchedule { name startAt repetitionRate nextRunAt lastRunStartedAt account { id name } buildScheduleTestSuites { nodes { id testSuite { id name } lastRunBuild { id status createdAt } } } createdAt updatedAt } } }"}' https://api.lumar.io/graphql
Retrieve all build schedules belonging to a given account
The following query retrieves all build schedules belonging to a given account:
- Query
- cURL
query GetAccountBuildSchedules($accountId: ObjectID!) {
node(id: $accountId) {
... on Account {
buildSchedules {
nodes {
name
startAt
repetitionRate
nextRunAt
lastRunStartedAt
account {
id
name
}
buildScheduleTestSuites {
nodes {
id
testSuite {
id
name
}
lastRunBuild {
id
status
createdAt
}
}
}
createdAt
updatedAt
}
}
}
}
}
curl -X POST -H "Content-Type: application/json" -H "apollographql-client-name: docs-example-client" -H "apollographql-client-version: 1.0.0" -H "x-auth-token: YOUR_API_SESSION_TOKEN" --data '{"query":"query GetAccountBuildSchedules($accountId: ObjectID!) { node(id: $accountId) { ... on Account { buildSchedules { nodes { name startAt repetitionRate nextRunAt lastRunStartedAt account { id name } buildScheduleTestSuites { nodes { id testSuite { id name } lastRunBuild { id status createdAt } } } createdAt updatedAt } } } } }"}' https://api.lumar.io/graphql
caution
buildScheduleTestSuites
is used to obtain all links between the current build schedule and test suites, together with last build executed part of this link (lastRunBuild
).