Skip to main content

workspace

Gets or lists a workspace resource.

Overview​

Nameworkspace
TypeResource
Idgitlab.workspaces.workspace

Fields​

The following fields are returned by SELECT queries:

GraphQL response envelope

NameDatatypeDescription
idstringGlobal ID of the workspace.
namestringName of the workspace in Kubernetes.
project_idstringID of the project that contains the devfile for the workspace.
actual_statestringActual state of the workspace.
created_atstringTimestamp of when the workspace was created.
deployment_resource_versionintegerVersion of the deployment resource for the workspace.
desired_statestringDesired state of the workspace.
desired_state_updated_atstringTimestamp of the last update to the desired state.
devfilestringSource YAML of the devfile used to configure the workspace.
devfile_pathstringPath to the devfile used to configure the workspace.
namespacestringNamespace of the workspace in Kubernetes.
processed_devfilestringProcessed YAML of the devfile used to configure the workspace.
project_refstringGit reference that contains the devfile used to configure the workspace, and that will be cloned into the workspace
responded_to_agent_atstringTimestamp of the last response sent to the GitLab agent for Kubernetes for the workspace.
updated_atstringTimestamp of the last update to any mutable workspace property.
urlstringURL of the workspace.
userobjectUserCore identity (id, username, name)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectid, hostFind a workspace. Generated from the GitLab GraphQL schema field Query.workspace (Workspace).

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)
idstringFind a workspace by its ID.

SELECT examples​

Find a workspace. Generated from the GitLab GraphQL schema field Query.workspace (Workspace).

SELECT
id,
name,
project_id,
actual_state,
created_at,
deployment_resource_version,
desired_state,
desired_state_updated_at,
devfile,
devfile_path,
namespace,
processed_devfile,
project_ref,
responded_to_agent_at,
updated_at,
url,
user
FROM gitlab.workspaces.workspace
WHERE id = '{{ id }}' -- required
AND host = '{{ host }}' -- required (defaults to gitlab.com; or set GITLAB_HOST)
;