mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add healthy filter for workspace queries (#21743)
Adds support for filtering workspaces by health status using healthy:true or healthy:false in the search query. This is done by changing `has-agent` to accept a list of statuses and aliasing `health:true` to `has-agent:connected` and `healthy:false` to `has-agent:timeout,disconnected`. Fixes #21623
This commit is contained in:
Generated
+5
-5
@@ -981,11 +981,11 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | In | Type | Required | Description |
|
||||
|----------|-------|---------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `q` | query | string | false | Search query in the format `key:value`. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before, has-ai-task, has_external_agent. |
|
||||
| `limit` | query | integer | false | Page limit |
|
||||
| `offset` | query | integer | false | Page offset |
|
||||
| Name | In | Type | Required | Description |
|
||||
|----------|-------|---------|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `q` | query | string | false | Search query in the format `key:value`. Available keys are: owner, template, name, status, has-agent, dormant, last_used_after, last_used_before, has-ai-task, has_external_agent, healthy. |
|
||||
| `limit` | query | integer | false | Page limit |
|
||||
| `offset` | query | integer | false | Page offset |
|
||||
|
||||
### Example responses
|
||||
|
||||
|
||||
@@ -66,8 +66,9 @@ The following filters are supported:
|
||||
- `dormant` - Filters workspaces based on the dormant state, e.g `dormant:true`
|
||||
- `has-agent` - Only applicable for workspaces in "start" transition. Stopped
|
||||
and deleted workspaces don't have agents. List of supported values
|
||||
`connecting|connected|timeout`, e.g, `has-agent:connecting`
|
||||
`connecting|connected|timeout|disconnected`, e.g, `has-agent:connecting`
|
||||
- `id` - Workspace UUID
|
||||
- `healthy` - Only applicable for workspaces in "start" transition. `healthy:false` is an alias for `has-agent:timeout,disconnected`, `healthy:true` is an alias for `has-agent:connected`.
|
||||
|
||||
## Updating workspaces
|
||||
|
||||
|
||||
Reference in New Issue
Block a user