Common operations
Here is a list of common operations that you can perform using the Fleet Control API.
Pagination
Many queries that return a list of items support pagination. You can use the limit
, page
and sort
arguments to
control the number and order of items returned.
The limit
argument specifies the number of items to return per page, and the page
argument specifies the page number
to return. The page
argument is 1-based, so the first page is 1. The total number of items and pages is returned in
the pageInfo
object.
Use sort
argument to sort the items. It has field
and order
properties. The field
specifies the item field name
to sort by, and the order
property specifies either ascending or descending order.
Example Queries
List resources with pagination and sorted by name descending
query {
resources(limit: 10, page: 1, sort: { field: NAME, order: DESC }) {
result {
id
name
}
pageInfo {
pages
count
}
}
}
List events started after a specific date
query {
events(
page: 1
limit: 10
sort: { field: START_TIME, order: ASC }
filter: {
filterBy: {
field: START_TIME
operator: GE
values: "2024-02-22T04:00:00+00:00"
}
}
) {
result {
id
name
startTime
plan {
id
name
}
status
}
pageInfo {
pages
count
}
}
}
Get AWS onboarding template
query {
awsOnboardingTemplate
}
Get Azure onboarding script
query {
azureOnboardingScript(subscriptionId: "azure-subscription-id")
}
Example mutations
Trigger a scan of a cloud account
mutation {
scanCloudAccount(id: "cloud-account-id")
}
Trigger manual plan execution
mutation {
triggerPlan(id: "plan-id")
}
Approve event action in plan execution
mutation {
approveEventAction(eventId: "event-id", eventActionId: "event-action-id")
}