workspace
Gets or lists a workspace resource.
Overview​
| Name | workspace |
| Type | Resource |
| Id | gitlab.workspaces.workspace |
Fields​
The following fields are returned by SELECT queries:
- get
GraphQL response envelope
| Name | Datatype | Description |
|---|---|---|
id | string | Global ID of the workspace. |
name | string | Name of the workspace in Kubernetes. |
project_id | string | ID of the project that contains the devfile for the workspace. |
actual_state | string | Actual state of the workspace. |
created_at | string | Timestamp of when the workspace was created. |
deployment_resource_version | integer | Version of the deployment resource for the workspace. |
desired_state | string | Desired state of the workspace. |
desired_state_updated_at | string | Timestamp of the last update to the desired state. |
devfile | string | Source YAML of the devfile used to configure the workspace. |
devfile_path | string | Path to the devfile used to configure the workspace. |
namespace | string | Namespace of the workspace in Kubernetes. |
processed_devfile | string | Processed YAML of the devfile used to configure the workspace. |
project_ref | string | Git reference that contains the devfile used to configure the workspace, and that will be cloned into the workspace |
responded_to_agent_at | string | Timestamp of the last response sent to the GitLab agent for Kubernetes for the workspace. |
updated_at | string | Timestamp of the last update to any mutable workspace property. |
url | string | URL of the workspace. |
user | object | UserCore identity (id, username, name) |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | id, host | Find 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.
| Name | Datatype | Description |
|---|---|---|
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) |
id | string | Find a workspace by its ID. |
SELECT examples​
- get
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)
;