mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
feat: add user quiet hours schedule and restart requirement feature flag (#8115)
This commit is contained in:
185
coderd/apidoc/docs.go
generated
185
coderd/apidoc/docs.go
generated
@ -3829,6 +3829,92 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/users/{user}/quiet-hours": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"CoderSessionToken": []
|
||||
}
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Enterprise"
|
||||
],
|
||||
"summary": "Get user quiet hours schedule",
|
||||
"operationId": "get-user-quiet-hours-schedule",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "User ID",
|
||||
"name": "user",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"put": {
|
||||
"security": [
|
||||
{
|
||||
"CoderSessionToken": []
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Enterprise"
|
||||
],
|
||||
"summary": "Update user quiet hours schedule",
|
||||
"operationId": "update-user-quiet-hours-schedule",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "User ID",
|
||||
"name": "user",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Update schedule request",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/codersdk.UpdateUserQuietHoursScheduleRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.UserQuietHoursScheduleResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/users/{user}/roles": {
|
||||
"get": {
|
||||
"security": [
|
||||
@ -7002,13 +7088,21 @@ const docTemplate = `{
|
||||
"type": "integer"
|
||||
},
|
||||
"max_ttl_ms": {
|
||||
"description": "MaxTTLMillis allows optionally specifying the max lifetime for\nworkspaces created from this template.",
|
||||
"description": "TODO(@dean): remove max_ttl once restart_requirement is matured",
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
"description": "Name is the name of the template.",
|
||||
"type": "string"
|
||||
},
|
||||
"restart_requirement": {
|
||||
"description": "RestartRequirement allows optionally specifying the restart requirement\nfor workspaces created from this template. This is an enterprise feature.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/codersdk.TemplateRestartRequirement"
|
||||
}
|
||||
]
|
||||
},
|
||||
"template_version_id": {
|
||||
"description": "VersionID is an in-progress or completed job to use as an initial version\nof the template.\n\nThis is required on creation to enable a user-flow of validating a\ntemplate works. There is no reason the data-model cannot support empty\ntemplates, but it doesn't make sense for users.",
|
||||
"type": "string",
|
||||
@ -7611,6 +7705,9 @@ const docTemplate = `{
|
||||
"update_check": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"user_quiet_hours_schedule": {
|
||||
"$ref": "#/definitions/codersdk.UserQuietHoursScheduleConfig"
|
||||
},
|
||||
"verbose": {
|
||||
"type": "boolean"
|
||||
},
|
||||
@ -7678,7 +7775,8 @@ const docTemplate = `{
|
||||
"tailnet_ha_coordinator",
|
||||
"convert-to-oidc",
|
||||
"single_tailnet",
|
||||
"workspace_build_logs_ui"
|
||||
"workspace_build_logs_ui",
|
||||
"template_restart_requirement"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"ExperimentMoons",
|
||||
@ -7686,7 +7784,8 @@ const docTemplate = `{
|
||||
"ExperimentTailnetHACoordinator",
|
||||
"ExperimentConvertToOIDC",
|
||||
"ExperimentSingleTailnet",
|
||||
"ExperimentWorkspaceBuildLogsUI"
|
||||
"ExperimentWorkspaceBuildLogsUI",
|
||||
"ExperimentTemplateRestartRequirement"
|
||||
]
|
||||
},
|
||||
"codersdk.Feature": {
|
||||
@ -8996,7 +9095,7 @@ const docTemplate = `{
|
||||
"type": "integer"
|
||||
},
|
||||
"max_ttl_ms": {
|
||||
"description": "MaxTTLMillis is an enterprise feature. It's value is only used if your\nlicense is entitled to use the advanced template scheduling feature.",
|
||||
"description": "TODO(@dean): remove max_ttl once restart_requirement is matured",
|
||||
"type": "integer"
|
||||
},
|
||||
"name": {
|
||||
@ -9012,6 +9111,14 @@ const docTemplate = `{
|
||||
"terraform"
|
||||
]
|
||||
},
|
||||
"restart_requirement": {
|
||||
"description": "RestartRequirement is an enterprise feature. Its value is only used if\nyour license is entitled to use the advanced template scheduling feature.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/codersdk.TemplateRestartRequirement"
|
||||
}
|
||||
]
|
||||
},
|
||||
"updated_at": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
@ -9054,6 +9161,31 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TemplateRestartRequirement": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"days_of_week": {
|
||||
"description": "DaysOfWeek is a list of days of the week on which restarts are required.\nRestarts happen within the user's quiet hours (in their configured\ntimezone). If no days are specified, restarts are not required. Weekdays\ncannot be specified twice.\n\nRestarts will only happen on weekdays in this list on weeks which line up\nwith Weeks.",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"monday",
|
||||
"tuesday",
|
||||
"wednesday",
|
||||
"thursday",
|
||||
"friday",
|
||||
"saturday",
|
||||
"sunday"
|
||||
]
|
||||
}
|
||||
},
|
||||
"weeks": {
|
||||
"description": "Weeks is the number of weeks between required restarts. Weeks are synced\nacross all workspaces (and Coder deployments) using modulo math on a\nhardcoded epoch week of January 2nd, 2023 (the first Monday of 2023).\nValues of 0 or 1 indicate weekly restarts. Values of 2 indicate\nfortnightly restarts, etc.",
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.TemplateRole": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@ -9467,6 +9599,18 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.UpdateUserQuietHoursScheduleRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"schedule"
|
||||
],
|
||||
"properties": {
|
||||
"schedule": {
|
||||
"description": "Schedule is a cron expression that defines when the user's quiet hours\nwindow is. Schedule must not be empty. For new users, the schedule is set\nto 2am in their browser or computer's timezone. The schedule denotes the\nbeginning of a 4 hour window where the workspace is allowed to\nautomatically stop or restart due to maintenance or template max TTL.\n\nThe schedule must be daily with a single time, and should have a timezone\nspecified via a CRON_TZ prefix (otherwise UTC will be used).\n\nIf the schedule is empty, the user will be updated to use the default\nschedule.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.UpdateWorkspaceAutostartRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -9574,6 +9718,39 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.UserQuietHoursScheduleConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default_schedule": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.UserQuietHoursScheduleResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"next": {
|
||||
"description": "Next is the next time that the quiet hours window will start.",
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"raw_schedule": {
|
||||
"type": "string"
|
||||
},
|
||||
"time": {
|
||||
"description": "Time is the time of day that the quiet hours window starts in the given\nTimezone each day.",
|
||||
"type": "string"
|
||||
},
|
||||
"timezone": {
|
||||
"description": "raw format from the cron expression, UTC if unspecified",
|
||||
"type": "string"
|
||||
},
|
||||
"user_set": {
|
||||
"description": "UserSet is true if the user has set their own quiet hours schedule. If\nfalse, the user is using the default schedule.",
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.UserStatus": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
Reference in New Issue
Block a user