Thanks to visit codestin.com
Credit goes to github.com

Skip to content

docs: Add missing body parameter #6132

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 1 commit into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
47 changes: 47 additions & 0 deletions coderd/apidoc/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions coderd/apidoc/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions coderd/workspaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,10 +271,12 @@ func (api *API) workspaceByOwnerAndName(rw http.ResponseWriter, r *http.Request)
// @Summary Create user workspace by organization
// @ID create-user-workspace-by-organization
// @Security CoderSessionToken
// @Accept json
// @Produce json
// @Tags Workspaces
// @Param organization path string true "Organization ID" format(uuid)
// @Param user path string true "Username, UUID, or me"
// @Param request body codersdk.CreateWorkspaceRequest true "Create workspace request"
// @Success 200 {object} codersdk.Workspace
// @Router /organizations/{organization}/members/{user}/workspaces [post]
func (api *API) postWorkspacesByOrganization(rw http.ResponseWriter, r *http.Request) {
Expand Down
37 changes: 37 additions & 0 deletions docs/api/schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,43 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `transition` | `stop` |
| `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

```json
Expand Down
36 changes: 32 additions & 4 deletions docs/api/workspaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,46 @@
```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/organizations/{organization}/members/{user}/workspaces \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
```

`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

| Name | In | Type | Required | Description |
| -------------- | ---- | ------------ | -------- | --------------------- |
| `organization` | path | string(uuid) | true | Organization ID |
| `user` | path | string | true | Username, UUID, or me |
| Name | In | Type | Required | Description |
| -------------- | ---- | ---------------------------------------------------------------------------- | -------- | ------------------------ |
| `organization` | path | string(uuid) | true | Organization ID |
| `user` | path | string | true | Username, UUID, or me |
| `body` | body | [codersdk.CreateWorkspaceRequest](schemas.md#codersdkcreateworkspacerequest) | true | Create workspace request |

### Example responses

Expand Down