project_environments
Gets or lists a project_environments resource.
Overview​
| Name | project_environments |
| Type | Resource |
| Id | gitlab.projects.project_environments |
Fields​
The following fields are returned by SELECT queries:
- list
GraphQL response envelope
| Name | Datatype | Description |
|---|---|---|
id | string | ID of the environment. |
name | string | Human-readable name of the environment. |
auto_delete_at | string | When the environment is going to be deleted automatically. |
auto_stop_at | string | When the environment is going to be stopped automatically. |
auto_stop_setting | string | Auto stop setting of the environment. (ALWAYS, WITH_ACTION) |
created_at | string | When the environment was created. |
deployments_display_count | string | Number of deployments in the environment for display. Returns the precise number up to 999, and "999+" for counts exceeding this limit. |
description | string | Description of the environment. |
environment_type | string | Folder name of the environment. |
external_url | string | External URL of the environment. |
flux_resource_path | string | Flux resource path of the environment. |
kubernetes_namespace | string | Kubernetes namespace of the environment. |
path | string | Path to the environment. |
slug | string | Slug of the environment. |
state | string | State of the environment, for example: available/stopped. |
tier | string | Deployment tier of the environment. (PRODUCTION, STAGING, TESTING, DEVELOPMENT, OTHER) |
updated_at | string | When the environment was updated. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | full_path, host | name, search, type | Environments of the project. This field can only be resolved for one project in any single request. Generated from the GitLab GraphQL schema field Project.environments (connection of Environment 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.
| Name | Datatype | Description |
|---|---|---|
full_path | string | Full path of the project, for example gitlab-org/gitlab |
host | string | GitLab 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) |
name | string | Name of the environment. |
search | string | Search query for environment name. |
type | string | Search query for environment type. |
SELECT examples​
- list
Environments of the project. This field can only be resolved for one project in any single request. Generated from the GitLab GraphQL schema field Project.environments (connection of Environment nodes).
SELECT
id,
name,
auto_delete_at,
auto_stop_at,
auto_stop_setting,
created_at,
deployments_display_count,
description,
environment_type,
external_url,
flux_resource_path,
kubernetes_namespace,
path,
slug,
state,
tier,
updated_at
FROM gitlab.projects.project_environments
WHERE full_path = '{{ full_path }}' -- required
AND host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
AND name = '{{ name }}'
AND search = '{{ search }}'
AND type = '{{ type }}'
;