From d704ff457076da514cc051cfaf0f0e36e932b8d7 Mon Sep 17 00:00:00 2001 From: Cian Johnston Date: Mon, 11 Mar 2024 22:50:38 +0000 Subject: [PATCH] chore(codersdk): explain format of codersdk.UpdateWorkspaceAutostartRequest.Schedule (#12539) --- coderd/apidoc/docs.go | 1 + coderd/apidoc/swagger.json | 1 + codersdk/workspaces.go | 3 +++ docs/api/schemas.md | 6 +++--- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 79e24f32d0..1ed25f09fc 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -12573,6 +12573,7 @@ const docTemplate = `{ "type": "object", "properties": { "schedule": { + "description": "Schedule is expected to be of the form ` + "`" + `CRON_TZ=\u003cIANA Timezone\u003e \u003cmin\u003e \u003chour\u003e * * \u003cdow\u003e` + "`" + `\nExample: ` + "`" + `CRON_TZ=US/Central 30 9 * * 1-5` + "`" + ` represents 0930 in the timezone US/Central\non weekdays (Mon-Fri). ` + "`" + `CRON_TZ` + "`" + ` defaults to UTC if not present.", "type": "string" } } diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index 20934d817b..fce1864aa8 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -11396,6 +11396,7 @@ "type": "object", "properties": { "schedule": { + "description": "Schedule is expected to be of the form `CRON_TZ=\u003cIANA Timezone\u003e \u003cmin\u003e \u003chour\u003e * * \u003cdow\u003e`\nExample: `CRON_TZ=US/Central 30 9 * * 1-5` represents 0930 in the timezone US/Central\non weekdays (Mon-Fri). `CRON_TZ` defaults to UTC if not present.", "type": "string" } } diff --git a/codersdk/workspaces.go b/codersdk/workspaces.go index d5008b3234..ecdc99d777 100644 --- a/codersdk/workspaces.go +++ b/codersdk/workspaces.go @@ -253,6 +253,9 @@ func (c *Client) UpdateWorkspace(ctx context.Context, id uuid.UUID, req UpdateWo // UpdateWorkspaceAutostartRequest is a request to update a workspace's autostart schedule. type UpdateWorkspaceAutostartRequest struct { + // Schedule is expected to be of the form `CRON_TZ= * * ` + // Example: `CRON_TZ=US/Central 30 9 * * 1-5` represents 0930 in the timezone US/Central + // on weekdays (Mon-Fri). `CRON_TZ` defaults to UTC if not present. Schedule *string `json:"schedule"` } diff --git a/docs/api/schemas.md b/docs/api/schemas.md index 8dbc25d371..890cd0fd85 100644 --- a/docs/api/schemas.md +++ b/docs/api/schemas.md @@ -6547,9 +6547,9 @@ If the schedule is empty, the user will be updated to use the default schedule.| ### Properties -| Name | Type | Required | Restrictions | Description | -| ---------- | ------ | -------- | ------------ | ----------- | -| `schedule` | string | false | | | +| Name | Type | Required | Restrictions | Description | +| ---------- | ------ | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `schedule` | string | false | | Schedule is expected to be of the form `CRON_TZ= * * ` Example: `CRON_TZ=US/Central 30 9 * * 1-5` represents 0930 in the timezone US/Central on weekdays (Mon-Fri). `CRON_TZ` defaults to UTC if not present. | ## codersdk.UpdateWorkspaceDormancy