Skip to main content

ci_minutes_usage

Gets or lists a ci_minutes_usage resource.

Overview​

Nameci_minutes_usage
TypeResource
Idgitlab.ci.ci_minutes_usage

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
minutesintegerTotal number of compute minutes used by all projects in the namespace.
monthstringMonth related to the usage data.
month_iso8601stringMonth related to the usage data in ISO 8601 date format.
shared_runners_durationintegerTotal duration (in seconds) of shared runners use by the namespace for the month.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselecthostdate, namespace_idCompute usage data for a namespace. Generated from the GitLab GraphQL schema field Query.ciMinutesUsage (connection of CiMinutesNamespaceMonthlyUsage nodes).

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
hoststringGitLab host, with an optional port (default gitlab.com). Resolved from the GITLAB_HOST environment variable when it is set (x-stackQL-envVar); a WHERE host value always takes precedence. Self-managed instances: the provider is generated from the gitlab.com schema, so older instances may reject fields they do not serve. (default: gitlab.com, x-stackQL-envVar: GITLAB_HOST)
datestringDate for which to retrieve the usage data, should be the first day of a month.
namespace_idstringGlobal ID of the Namespace for the monthly compute usage.

SELECT examples​

Compute usage data for a namespace. Generated from the GitLab GraphQL schema field Query.ciMinutesUsage (connection of CiMinutesNamespaceMonthlyUsage nodes).

SELECT
minutes,
month,
month_iso8601,
shared_runners_duration
FROM gitlab.ci.ci_minutes_usage
WHERE host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
AND date = '{{ date }}'
AND namespace_id = '{{ namespace_id }}'
;