diff --git a/coderd/apidoc/docs.go b/coderd/apidoc/docs.go index 3423b696fc..59e04bb35e 100644 --- a/coderd/apidoc/docs.go +++ b/coderd/apidoc/docs.go @@ -5643,44 +5643,6 @@ const docTemplate = `{ } } }, - "/templateversions/{templateversion}/presets/parameters": { - "get": { - "security": [ - { - "CoderSessionToken": [] - } - ], - "produces": [ - "application/json" - ], - "tags": [ - "Templates" - ], - "summary": "Get template version preset parameters", - "operationId": "get-template-version-preset-parameters", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.PresetParameter" - } - } - } - } - } - }, "/templateversions/{templateversion}/resources": { "get": { "security": [ @@ -13051,6 +13013,12 @@ const docTemplate = `{ }, "name": { "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.PresetParameter" + } } } }, diff --git a/coderd/apidoc/swagger.json b/coderd/apidoc/swagger.json index d5a836dcb3..625aa64aab 100644 --- a/coderd/apidoc/swagger.json +++ b/coderd/apidoc/swagger.json @@ -4985,40 +4985,6 @@ } } }, - "/templateversions/{templateversion}/presets/parameters": { - "get": { - "security": [ - { - "CoderSessionToken": [] - } - ], - "produces": ["application/json"], - "tags": ["Templates"], - "summary": "Get template version preset parameters", - "operationId": "get-template-version-preset-parameters", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Template version ID", - "name": "templateversion", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/codersdk.PresetParameter" - } - } - } - } - } - }, "/templateversions/{templateversion}/resources": { "get": { "security": [ @@ -11776,6 +11742,12 @@ }, "name": { "type": "string" + }, + "parameters": { + "type": "array", + "items": { + "$ref": "#/definitions/codersdk.PresetParameter" + } } } }, diff --git a/docs/reference/api/schemas.md b/docs/reference/api/schemas.md index d5d471ad46..ec9d8e0caf 100644 --- a/docs/reference/api/schemas.md +++ b/docs/reference/api/schemas.md @@ -4432,16 +4432,24 @@ Git clone makes use of this by parsing the URL from: 'Username for "https://gith ```json { "id": "string", - "name": "string" + "name": "string", + "parameters": [ + { + "name": "string", + "presetID": "string", + "value": "string" + } + ] } ``` ### Properties -| Name | Type | Required | Restrictions | Description | -|--------|--------|----------|--------------|-------------| -| `id` | string | false | | | -| `name` | string | false | | | +| Name | Type | Required | Restrictions | Description | +|--------------|---------------------------------------------------------------|----------|--------------|-------------| +| `id` | string | false | | | +| `name` | string | false | | | +| `parameters` | array of [codersdk.PresetParameter](#codersdkpresetparameter) | false | | | ## codersdk.PresetParameter diff --git a/docs/reference/api/templates.md b/docs/reference/api/templates.md index 57d35a6aab..6f3fb7fa88 100644 --- a/docs/reference/api/templates.md +++ b/docs/reference/api/templates.md @@ -2699,7 +2699,14 @@ curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/p [ { "id": "string", - "name": "string" + "name": "string", + "parameters": [ + { + "name": "string", + "presetID": "string", + "value": "string" + } + ] } ] ``` @@ -2719,58 +2726,10 @@ Status Code **200** | `[array item]` | array | false | | | | `» id` | string | false | | | | `» name` | string | false | | | - -To perform this operation, you must be authenticated. [Learn more](authentication.md). - -## Get template version preset parameters - -### Code samples - -```shell -# Example request using curl -curl -X GET http://coder-server:8080/api/v2/templateversions/{templateversion}/presets/parameters \ - -H 'Accept: application/json' \ - -H 'Coder-Session-Token: API_KEY' -``` - -`GET /templateversions/{templateversion}/presets/parameters` - -### Parameters - -| Name | In | Type | Required | Description | -|-------------------|------|--------------|----------|---------------------| -| `templateversion` | path | string(uuid) | true | Template version ID | - -### Example responses - -> 200 Response - -```json -[ - { - "name": "string", - "presetID": "string", - "value": "string" - } -] -``` - -### Responses - -| Status | Meaning | Description | Schema | -|--------|---------------------------------------------------------|-------------|-------------------------------------------------------------------------| -| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | array of [codersdk.PresetParameter](schemas.md#codersdkpresetparameter) | - -

Response Schema

- -Status Code **200** - -| Name | Type | Required | Restrictions | Description | -|----------------|--------|----------|--------------|-------------| -| `[array item]` | array | false | | | -| `» name` | string | false | | | -| `» presetID` | string | false | | | -| `» value` | string | false | | | +| `» parameters` | array | false | | | +| `»» name` | string | false | | | +| `»» presetID` | string | false | | | +| `»» value` | string | false | | | To perform this operation, you must be authenticated. [Learn more](authentication.md).