feat(coderd): add workspace timings endpoint (#14648)

This commit is contained in:
Bruno Quaresma
2024-09-16 16:31:05 -03:00
committed by GitHub
parent c330af0e4d
commit 705b9ccda8
19 changed files with 640 additions and 2 deletions
+47
View File
@@ -1604,6 +1604,53 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/resolve-autos
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Get workspace timings by ID
### Code samples
```shell
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/timings \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```
`GET /workspaces/{workspace}/timings`
### Parameters
| Name | In | Type | Required | Description |
| ----------- | ---- | ------------ | -------- | ------------ |
| `workspace` | path | string(uuid) | true | Workspace ID |
### Example responses
> 200 Response
```json
{
"provisioner_timings": [
{
"action": "string",
"ended_at": "2019-08-24T14:15:22Z",
"job_id": "453bd7d7-5355-4d6d-a38e-d9e7eb218c3f",
"resource": "string",
"source": "string",
"stage": "string",
"started_at": "2019-08-24T14:15:22Z"
}
]
}
```
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceTimings](schemas.md#codersdkworkspacetimings) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
## Update workspace TTL by ID
### Code samples