8000 docs: API templateversions, templates, members, organizations by mtojek · Pull Request #5546 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

docs: API templateversions, templates, members, organizations #5546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jan 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
cancel
  • Loading branch information
8000
mtojek committed Jan 3, 2023
commit 9dd385cfa4d4ced395e306de35685dc5e8e2862f
79 changes: 76 additions & 3 deletions coderd/apidoc/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,41 @@ const docTemplate = `{
}
}
},
"/templateversions/{id}/cancel": {
"patch": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": [
"application/json"
],
"tags": [
"Templates"
],
"summary": "Cancel template version by ID",
"operationId": "cancel-template-version-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Template version ID",
"name": "id",
8000 "in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Response"
}
}
}
}
},
"/templateversions/{id}/schema": {
"get": {
"security": [
Expand All @@ -1019,8 +1054,8 @@ const docTemplate = `{
"tags": [
"Templates"
],
"summary": "Get template version schema by template version ID",
"operationId": "get-template-version-schema-by-template-version-id",
"summary": "Get template version schema by ID",
"operationId": "get-template-version-schema-by-id",
"parameters": [
{
"type": "string",
Expand All @@ -1037,7 +1072,7 @@ const docTemplate = `{
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.ParameterSchema"
"$ref": "#/definitions/parameter.ComputedValue"
}
}
}
Expand Down Expand Up @@ -4057,6 +4092,44 @@ const docTemplate = `{
"netip.Addr": {
"type": "object"
},
"parameter.ComputedValue": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"default_source_value": {
"type": "boolean"
},
"destination_scheme": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"schema_id": {
"type": "string"
},
"scope": {
"type": "string"
},
"scope_id": {
"type": "string"
},
"source_scheme": {
"type": "string"
},
"source_value": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"tailcfg.DERPMap": {
"type": "object",
"properties": {
Expand Down
75 changes: 72 additions & 3 deletions coderd/apidoc/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,37 @@
}
}
},
"/templateversions/{id}/cancel": {
"patch": {
"security": [
{
"CoderSessionToken": []
}
],
"produces": ["application/json"],
"tags": ["Templates"],
"summary": "Cancel template version by ID",
"operationId": "cancel-template-version-by-id",
"parameters": [
{
"type": "string",
"format": "uuid",
"description": "Template version ID",
"name": "id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/codersdk.Response"
}
}
}
}
},
"/templateversions/{id}/schema": {
"get": {
"security": [
Expand All @@ -883,8 +914,8 @@
],
"produces": ["application/json"],
"tags": ["Templates"],
"summary": "Get template version schema by template version ID",
"operationId": "get-template-version-schema-by-template-version-id",
"summary": "Get template version schema by ID",
"operationId": "get-template-version-schema-by-id",
"parameters": [
{
"type": "string",
Expand All @@ -901,7 +932,7 @@
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/codersdk.ParameterSchema"
"$ref": "#/definitions/parameter.ComputedValue"
}
}
}
Expand Down Expand Up @@ -3702,6 +3733,44 @@
"netip.Addr": {
"type": "object"
},
"parameter.ComputedValue": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"default_source_value": {
"type": "boolean"
},
"destination_scheme": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"schema_id": {
"type": "string"
},
"scope": {
"type": "string"
},
"scope_id": {
"type": "string"
},
"source_scheme": {
"type": "string"
},
"source_value": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"tailcfg.DERPMap": {
"type": "object",
"properties": {
Expand Down
1 change: 0 additions & 1 deletion coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ func New(options *Options) *API {
apiKeyMiddleware,
httpmw.ExtractTemplateVersionParam(options.Database),
)

r.Get("/", api.templateVersion)
r.Patch("/cancel", api.patchCancelTemplateVersion)
r.Get("/schema", api.templateVersionSchema)
Expand Down
16 changes: 16 additions & 0 deletions coderd/templateversions.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ func (api *API) templateVersion(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(ctx, rw, http.StatusOK, convertTemplateVersion(templateVersion, convertProvisionerJob(job), user))
}

// @Summary Cancel template version by ID
// @ID cancel-template-version-by-id
// @Security CoderSessionToken
// @Produce json
// @Tags Templates
// @Param id path string true "Template version ID" format(uuid)
// @Success 200 {object} codersdk.Response
// @Router /templateversions/{id}/cancel [patch]
func (api *API) patchCancelTemplateVersion(rw http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var (
Expand Down Expand Up @@ -184,6 +192,14 @@ func (api *API) templateVersionSchema(rw http.ResponseWriter, r *http.Request) {
httpapi.Write(ctx, rw, http.StatusOK, apiSchemas)
}

// @Summary Get template version schema by ID
// @ID get-template-version-schema-by-id
// @Security CoderSessionToken
// @Produce json
// @Tags Templates
// @Param id path string true "Template version ID" format(uuid)
// @Success 200 {array} parameter.ComputedValue
// @Router /templateversions/{id}/schema [get]
func (api *API) templateVersionParameters(rw http.ResponseWriter, r *http.Request) {
ctx := r.Context()
var (
Expand Down
34 changes: 34 additions & 0 deletions docs/api/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -4061,6 +4061,40 @@ Parameter represents a set value for the scope.

_None_

## parameter.ComputedValue

```json
{
"created_at": "string",
"default_source_value": true,
"destination_scheme": "string",
"id": "string",
"name": "string",
"schema_id": "string",
"scope": "string",
"scope_id": "string",
"source_scheme": "string",
"source_value": "string",
"updated_at": "string"
}
```

### Properties

| Name | Type | Required | Restrictions | Description |
| ---------------------- | ------- | -------- | ------------ | ----------- |
| `created_at` | string | false | | |
| `default_source_value` | boolean | false | | |
| `destination_scheme` | string | false | | |
| `id` | string | false | | |
| `name` | string | false | | |
| `schema_id` | string | false | | |
| `scope` | string | false | | |
| `scope_id` | string | false | | |
| `source_scheme` | string | false | | |
| `source_value` | string | false | | |
| `updated_at` | string | false | | |

## tailcfg.DERPMap

```json
Expand Down
Loading
0