mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
docs: Add missing body parameter (#6132)
This commit is contained in:
47
coderd/apidoc/docs.go
generated
47
coderd/apidoc/docs.go
generated
@ -1066,6 +1066,9 @@ const docTemplate = `{
|
|||||||
"CoderSessionToken": []
|
"CoderSessionToken": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"consumes": [
|
||||||
|
"application/json"
|
||||||
|
],
|
||||||
"produces": [
|
"produces": [
|
||||||
"application/json"
|
"application/json"
|
||||||
],
|
],
|
||||||
@ -1089,6 +1092,15 @@ const docTemplate = `{
|
|||||||
"name": "user",
|
"name": "user",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Create workspace request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/codersdk.CreateWorkspaceRequest"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@ -5902,6 +5914,41 @@ const docTemplate = `{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"codersdk.CreateWorkspaceRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": [
|
||||||
|
"name",
|
||||||
|
"template_id"
|
||||||
|
],
|
||||||
|
"properties": {
|
||||||
|
"autostart_schedule": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parameter_values": {
|
||||||
|
"description": "ParameterValues allows for additional parameters to be provided\nduring the initial provision.",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/codersdk.CreateParameterRequest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rich_parameter_values": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/codersdk.WorkspaceBuildParameter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"template_id": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uuid"
|
||||||
|
},
|
||||||
|
"ttl_ms": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"codersdk.DAUEntry": {
|
"codersdk.DAUEntry": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
42
coderd/apidoc/swagger.json
generated
42
coderd/apidoc/swagger.json
generated
@ -924,6 +924,7 @@
|
|||||||
"CoderSessionToken": []
|
"CoderSessionToken": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"consumes": ["application/json"],
|
||||||
"produces": ["application/json"],
|
"produces": ["application/json"],
|
||||||
"tags": ["Workspaces"],
|
"tags": ["Workspaces"],
|
||||||
"summary": "Create user workspace by organization",
|
"summary": "Create user workspace by organization",
|
||||||
@ -943,6 +944,15 @@
|
|||||||
"name": "user",
|
"name": "user",
|
||||||
"in": "path",
|
"in": "path",
|
||||||
"required": true
|
"required": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"description": "Create workspace request",
|
||||||
|
"name": "request",
|
||||||
|
"in": "body",
|
||||||
|
"required": true,
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/definitions/codersdk.CreateWorkspaceRequest"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"responses": {
|
"responses": {
|
||||||
@ -5231,6 +5241,38 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"codersdk.CreateWorkspaceRequest": {
|
||||||
|
"type": "object",
|
||||||
|
"required": ["name", "template_id"],
|
||||||
|
"properties": {
|
||||||
|
"autostart_schedule": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"parameter_values": {
|
||||||
|
"description": "ParameterValues allows for additional parameters to be provided\nduring the initial provision.",
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/codersdk.CreateParameterRequest"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rich_parameter_values": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"$ref": "#/definitions/codersdk.WorkspaceBuildParameter"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"template_id": {
|
||||||
|
"type": "string",
|
||||||
|
"format": "uuid"
|
||||||
|
},
|
||||||
|
"ttl_ms": {
|
||||||
|
"type": "integer"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"codersdk.DAUEntry": {
|
"codersdk.DAUEntry": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -271,10 +271,12 @@ func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request)
|
|||||||
// @Summary Create user workspace by organization
|
// @Summary Create user workspace by organization
|
||||||
// @ID create-user-workspace-by-organization
|
// @ID create-user-workspace-by-organization
|
||||||
// @Security CoderSessionToken
|
// @Security CoderSessionToken
|
||||||
|
// @Accept json
|
||||||
// @Produce json
|
// @Produce json
|
||||||
// @Tags Workspaces
|
// @Tags Workspaces
|
||||||
// @Param organization path string true "Organization ID" format(uuid)
|
// @Param organization path string true "Organization ID" format(uuid)
|
||||||
// @Param user path string true "Username, UUID, or me"
|
// @Param user path string true "Username, UUID, or me"
|
||||||
|
// @Param request body codersdk.CreateWorkspaceRequest true "Create workspace request"
|
||||||
// @Success 200 {object} codersdk.Workspace
|
// @Success 200 {object} codersdk.Workspace
|
||||||
// @Router /organizations/{organization}/members/{user}/workspaces [post]
|
// @Router /organizations/{organization}/members/{user}/workspaces [post]
|
||||||
func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Request) {
|
func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -1147,6 +1147,43 @@ CreateParameterRequest is a structure used to create a new parameter value for a
|
|||||||
| `transition` | `stop` |
|
| `transition` | `stop` |
|
||||||
| `transition` | `delete` |
|
| `transition` | `delete` |
|
||||||
|
|
||||||
|
## codersdk.CreateWorkspaceRequest
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"autostart_schedule": "string",
|
||||||
|
"name": "string",
|
||||||
|
"parameter_values": [
|
||||||
|
{
|
||||||
|
"copy_from_parameter": "000e07d6-021d-446c-be14-48a9c20bca0b",
|
||||||
|
"destination_scheme": "none",
|
||||||
|
"name": "string",
|
||||||
|
"source_scheme": "none",
|
||||||
|
"source_value": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rich_parameter_values": [
|
||||||
|
{
|
||||||
|
"name": "string",
|
||||||
|
"value": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
|
||||||
|
"ttl_ms": 0
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Properties
|
||||||
|
|
||||||
|
| Name | Type | Required | Restrictions | Description |
|
||||||
|
| ----------------------- | ----------------------------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------- |
|
||||||
|
| `autostart_schedule` | string | false | | |
|
||||||
|
| `name` | string | true | | |
|
||||||
|
| `parameter_values` | array of [codersdk.CreateParameterRequest](#codersdkcreateparameterrequest) | false | | Parameter values allows for additional parameters to be provided during the initial provision. |
|
||||||
|
| `rich_parameter_values` | array of [codersdk.WorkspaceBuildParameter](#codersdkworkspacebuildparameter) | false | | |
|
||||||
|
| `template_id` | string | true | | |
|
||||||
|
| `ttl_ms` | integer | false | | |
|
||||||
|
|
||||||
## codersdk.DAUEntry
|
## codersdk.DAUEntry
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
@ -7,18 +7,46 @@
|
|||||||
```shell
|
```shell
|
||||||
# Example request using curl
|
# Example request using curl
|
||||||
curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/members/{user}/workspaces \
|
curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/members/{user}/workspaces \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
-H 'Accept: application/json' \
|
-H 'Accept: application/json' \
|
||||||
-H 'Coder-Session-Token: API_KEY'
|
-H 'Coder-Session-Token: API_KEY'
|
||||||
```
|
```
|
||||||
|
|
||||||
`POST /organizations/{organization}/members/{user}/workspaces`
|
`POST /organizations/{organization}/members/{user}/workspaces`
|
||||||
|
|
||||||
|
> Body parameter
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"autostart_schedule": "string",
|
||||||
|
"name": "string",
|
||||||
|
"parameter_values": [
|
||||||
|
{
|
||||||
|
"copy_from_parameter": "000e07d6-021d-446c-be14-48a9c20bca0b",
|
||||||
|
"destination_scheme": "none",
|
||||||
|
"name": "string",
|
||||||
|
"source_scheme": "none",
|
||||||
|
"source_value": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"rich_parameter_values": [
|
||||||
|
{
|
||||||
|
"name": "string",
|
||||||
|
"value": "string"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"template_id": "c6d67e98-83ea-49f0-8812-e4abae2b68bc",
|
||||||
|
"ttl_ms": 0
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
### Parameters
|
### Parameters
|
||||||
|
|
||||||
| Name | In | Type | Required | Description |
|
| Name | In | Type | Required | Description |
|
||||||
| -------------- | ---- | ------------ | -------- | --------------------- |
|
| -------------- | ---- | ---------------------------------------------------------------------------- | -------- | ------------------------ |
|
||||||
| `organization` | path | string(uuid) | true | Organization ID |
|
| `organization` | path | string(uuid) | true | Organization ID |
|
||||||
| `user` | path | string | true | Username, UUID, or me |
|
| `user` | path | string | true | Username, UUID, or me |
|
||||||
|
| `body` | body | [codersdk.CreateWorkspaceRequest](schemas.md#codersdkcreateworkspacerequest) | true | Create workspace request |
|
||||||
|
|
||||||
### Example responses
|
### Example responses
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user