Skip to main content

project_environments

Gets or lists a project_environments resource.

Overview​

Nameproject_environments
TypeResource
Idgitlab.projects.project_environments

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
idstringID of the environment.
namestringHuman-readable name of the environment.
auto_delete_atstringWhen the environment is going to be deleted automatically.
auto_stop_atstringWhen the environment is going to be stopped automatically.
auto_stop_settingstringAuto stop setting of the environment. (ALWAYS, WITH_ACTION)
created_atstringWhen the environment was created.
deployments_display_countstringNumber of deployments in the environment for display. Returns the precise number up to 999, and "999+" for counts exceeding this limit.
descriptionstringDescription of the environment.
environment_typestringFolder name of the environment.
external_urlstringExternal URL of the environment.
flux_resource_pathstringFlux resource path of the environment.
kubernetes_namespacestringKubernetes namespace of the environment.
pathstringPath to the environment.
slugstringSlug of the environment.
statestringState of the environment, for example: available/stopped.
tierstringDeployment tier of the environment. (PRODUCTION, STAGING, TESTING, DEVELOPMENT, OTHER)
updated_atstringWhen the environment was updated.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectfull_path, hostname, search, typeEnvironments 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.

NameDatatypeDescription
full_pathstringFull path of the project, for example gitlab-org/gitlab
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)
namestringName of the environment.
typestringSearch query for environment type.

SELECT examples​

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 }}'
;