Skip to content

Commit

Permalink
Add the Usage API to the GraphQL cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
jameshill committed Jun 19, 2023
1 parent 2ca38c2 commit 5e9ba55
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions pages/apis/graphql/graphql_cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,53 @@ mutation UpdateSessionIPAddressPinning {
}
```

### Query the Usage API

Use the Usage API to query your organizations usage by pipleine or test suite
at daily granularity.

```graphql
query Usage {
organization(slug: "organization-slug") {
id
name
usage(
aggregatedOnFrom: "2023-04-01"
aggregatedOnTo: "2023-05-01"
resource:[JOB_MINUTES, TEST_EXECUTIONS]
) {
edges {
node {
__typename ... on JobMinutesUsage {
aggregatedOn
seconds
pipeline {
name
id
}
}
}

node {
__typename ... on TestExecutionsUsage {
Time:aggregatedOn
executions
suite {
name
id
}
}
}
}
pageInfo {
endCursor
hasNextPage
}
}
}
}
```

### Create a user, add them to a team, and set user permissions

Invite a new user to the organization, add them to a team, and set their role.
Expand Down

0 comments on commit 5e9ba55

Please sign in to comment.