mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add API support for workspace automatic updates (#10099)
* Added automatic_updates to workspaces table Signed-off-by: Spike Curtis <spike@coder.com> * Queries and API updates Signed-off-by: Spike Curtis <spike@coder.com> * Golden files Signed-off-by: Spike Curtis <spike@coder.com> * Enable automatic updates on autostart Signed-off-by: Spike Curtis <spike@coder.com> * db migration number Signed-off-by: Spike Curtis <spike@coder.com> * fix imports and ts mock Signed-off-by: Spike Curtis <spike@coder.com> * code review updates Signed-off-by: Spike Curtis <spike@coder.com> --------- Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
Generated
+42
@@ -18,6 +18,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member
|
||||
|
||||
```json
|
||||
{
|
||||
"automatic_updates": "always",
|
||||
"autostart_schedule": "string",
|
||||
"name": "string",
|
||||
"rich_parameter_values": [
|
||||
@@ -46,6 +47,7 @@ curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/member
|
||||
|
||||
```json
|
||||
{
|
||||
"automatic_updates": "always",
|
||||
"autostart_schedule": "string",
|
||||
"created_at": "2019-08-24T14:15:22Z",
|
||||
"deleting_at": "2019-08-24T14:15:22Z",
|
||||
@@ -253,6 +255,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam
|
||||
|
||||
```json
|
||||
{
|
||||
"automatic_updates": "always",
|
||||
"autostart_schedule": "string",
|
||||
"created_at": "2019-08-24T14:15:22Z",
|
||||
"deleting_at": "2019-08-24T14:15:22Z",
|
||||
@@ -463,6 +466,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces \
|
||||
"count": 0,
|
||||
"workspaces": [
|
||||
{
|
||||
"automatic_updates": "always",
|
||||
"autostart_schedule": "string",
|
||||
"created_at": "2019-08-24T14:15:22Z",
|
||||
"deleting_at": "2019-08-24T14:15:22Z",
|
||||
@@ -667,6 +671,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace} \
|
||||
|
||||
```json
|
||||
{
|
||||
"automatic_updates": "always",
|
||||
"autostart_schedule": "string",
|
||||
"created_at": "2019-08-24T14:15:22Z",
|
||||
"deleting_at": "2019-08-24T14:15:22Z",
|
||||
@@ -919,6 +924,42 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/autostart \
|
||||
|
||||
To perform this operation, you must be authenticated. [Learn more](authentication.md).
|
||||
|
||||
## Update workspace automatic updates by ID
|
||||
|
||||
### Code samples
|
||||
|
||||
```shell
|
||||
# Example request using curl
|
||||
curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/autoupdates \
|
||||
-H 'Content-Type: application/json' \
|
||||
-H 'Coder-Session-Token: API_KEY'
|
||||
```
|
||||
|
||||
`PUT /workspaces/{workspace}/autoupdates`
|
||||
|
||||
> Body parameter
|
||||
|
||||
```json
|
||||
{
|
||||
"automatic_updates": "always"
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Name | In | Type | Required | Description |
|
||||
| ----------- | ---- | ------------------------------------------------------------------------------------------------------------ | -------- | ------------------------- |
|
||||
| `workspace` | path | string(uuid) | true | Workspace ID |
|
||||
| `body` | body | [codersdk.UpdateWorkspaceAutomaticUpdatesRequest](schemas.md#codersdkupdateworkspaceautomaticupdatesrequest) | true | Automatic updates request |
|
||||
|
||||
### Responses
|
||||
|
||||
| Status | Meaning | Description | Schema |
|
||||
| ------ | --------------------------------------------------------------- | ----------- | ------ |
|
||||
| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | No Content | |
|
||||
|
||||
To perform this operation, you must be authenticated. [Learn more](authentication.md).
|
||||
|
||||
## Update workspace dormancy status by id.
|
||||
|
||||
### Code samples
|
||||
@@ -954,6 +995,7 @@ curl -X PUT http://coder-server:8080/api/v2/workspaces/{workspace}/dormant \
|
||||
|
||||
```json
|
||||
{
|
||||
"automatic_updates": "always",
|
||||
"autostart_schedule": "string",
|
||||
"created_at": "2019-08-24T14:15:22Z",
|
||||
"deleting_at": "2019-08-24T14:15:22Z",
|
||||
|
||||
Reference in New Issue
Block a user