mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: evaluate dynamic parameters http endpoint (#18182)
Used when a websocket is too heavy. This implements a single request to the preview engine.
This commit is contained in:
301
coderd/apidoc/docs.go
generated
301
coderd/apidoc/docs.go
generated
@ -5893,14 +5893,6 @@ const docTemplate = `{
|
||||
"summary": "Open dynamic parameters WebSocket by template version",
|
||||
"operationId": "open-dynamic-parameters-websocket-by-template-version",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Template version ID",
|
||||
"name": "user",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
@ -5917,6 +5909,53 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/templateversions/{templateversion}/dynamic-parameters/evaluate": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"CoderSessionToken": []
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Templates"
|
||||
],
|
||||
"summary": "Evaluate dynamic parameters for template version",
|
||||
"operationId": "evaluate-dynamic-parameters-for-template-version",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Template version ID",
|
||||
"name": "templateversion",
|
||||
"in": "path",
|
||||
"required": true
|
||||
},
|
||||
{
|
||||
"description": "Initial parameter values",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/codersdk.DynamicParametersRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/codersdk.DynamicParametersResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/templateversions/{templateversion}/external-auth": {
|
||||
"get": {
|
||||
"security": [
|
||||
@ -12573,6 +12612,25 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.DiagnosticExtra": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.DiagnosticSeverityString": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"error",
|
||||
"warning"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"DiagnosticSeverityError",
|
||||
"DiagnosticSeverityWarning"
|
||||
]
|
||||
},
|
||||
"codersdk.DisplayApp": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@ -12590,6 +12648,46 @@ const docTemplate = `{
|
||||
"DisplayAppSSH"
|
||||
]
|
||||
},
|
||||
"codersdk.DynamicParametersRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"description": "ID identifies the request. The response contains the same\nID so that the client can match it to the request.",
|
||||
"type": "integer"
|
||||
},
|
||||
"inputs": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"owner_id": {
|
||||
"description": "OwnerID if uuid.Nil, it defaults to ` + "`" + `codersdk.Me` + "`" + `",
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.DynamicParametersResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"diagnostics": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.FriendlyDiagnostic"
|
||||
}
|
||||
},
|
||||
"id": {
|
||||
"type": "integer"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.PreviewParameter"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.Entitlement": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@ -12870,6 +12968,23 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.FriendlyDiagnostic": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"detail": {
|
||||
"type": "string"
|
||||
},
|
||||
"extra": {
|
||||
"$ref": "#/definitions/codersdk.DiagnosticExtra"
|
||||
},
|
||||
"severity": {
|
||||
"$ref": "#/definitions/codersdk.DiagnosticSeverityString"
|
||||
},
|
||||
"summary": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.GenerateAPIKeyResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -13661,6 +13776,17 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.NullHCLString": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"valid": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"value": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.OAuth2AppEndpoints": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -13918,6 +14044,21 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.OptionType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"string",
|
||||
"number",
|
||||
"bool",
|
||||
"list(string)"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"OptionTypeString",
|
||||
"OptionTypeNumber",
|
||||
"OptionTypeBoolean",
|
||||
"OptionTypeListString"
|
||||
]
|
||||
},
|
||||
"codersdk.Organization": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@ -14065,6 +14206,35 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.ParameterFormType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"",
|
||||
"radio",
|
||||
"slider",
|
||||
"input",
|
||||
"dropdown",
|
||||
"checkbox",
|
||||
"switch",
|
||||
"multi-select",
|
||||
"tag-select",
|
||||
"textarea",
|
||||
"error"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"ParameterFormTypeDefault",
|
||||
"ParameterFormTypeRadio",
|
||||
"ParameterFormTypeSlider",
|
||||
"ParameterFormTypeInput",
|
||||
"ParameterFormTypeDropdown",
|
||||
"ParameterFormTypeCheckbox",
|
||||
"ParameterFormTypeSwitch",
|
||||
"ParameterFormTypeMultiSelect",
|
||||
"ParameterFormTypeTagSelect",
|
||||
"ParameterFormTypeTextArea",
|
||||
"ParameterFormTypeError"
|
||||
]
|
||||
},
|
||||
"codersdk.PatchGroupIDPSyncConfigRequest": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
@ -14381,6 +14551,121 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.PreviewParameter": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"default_value": {
|
||||
"$ref": "#/definitions/codersdk.NullHCLString"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"diagnostics": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.FriendlyDiagnostic"
|
||||
}
|
||||
},
|
||||
"display_name": {
|
||||
"type": "string"
|
||||
},
|
||||
"ephemeral": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"form_type": {
|
||||
"$ref": "#/definitions/codersdk.ParameterFormType"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"mutable": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"options": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.PreviewParameterOption"
|
||||
}
|
||||
},
|
||||
"order": {
|
||||
"description": "legacy_variable_name was removed (= 14)",
|
||||
"type": "integer"
|
||||
},
|
||||
"required": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"styling": {
|
||||
"$ref": "#/definitions/codersdk.PreviewParameterStyling"
|
||||
},
|
||||
"type": {
|
||||
"$ref": "#/definitions/codersdk.OptionType"
|
||||
},
|
||||
"validations": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/codersdk.PreviewParameterValidation"
|
||||
}
|
||||
},
|
||||
"value": {
|
||||
"$ref": "#/definitions/codersdk.NullHCLString"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.PreviewParameterOption": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
"value": {
|
||||
"$ref": "#/definitions/codersdk.NullHCLString"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.PreviewParameterStyling": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"disabled": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"label": {
|
||||
"type": "string"
|
||||
},
|
||||
"placeholder": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.PreviewParameterValidation": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"validation_error": {
|
||||
"type": "string"
|
||||
},
|
||||
"validation_max": {
|
||||
"type": "integer"
|
||||
},
|
||||
"validation_min": {
|
||||
"type": "integer"
|
||||
},
|
||||
"validation_monotonic": {
|
||||
"type": "string"
|
||||
},
|
||||
"validation_regex": {
|
||||
"description": "All validation attributes are optional.",
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"codersdk.PrometheusConfig": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
Reference in New Issue
Block a user