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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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
Generate docs
  • Loading branch information
mafredri committed Jan 23, 2023
commit 8119e71c37e9a73f9f1e2ba1d93284391032945f
72 changes: 72 additions & 0 deletions coderd/apidoc/docs.go

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

58 changes: 58 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: 1 addition & 1 deletion codersdk/workspaceagents.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ type WorkspaceAgentMetadata struct {
DERPMap *tailcfg.DERPMap `json:"derpmap"`
EnvironmentVariables map[string]string `json:"environment_variables"`
StartupScript string `json:"startup_script"`
StartupScriptTimeout time.Duration `json:"startup_script_timeout" format:"duration"`
StartupScriptTimeout time.Duration `json:"startup_script_timeout"`
Directory string `json:"directory"`
MOTDFile string `json:"motd_file"`
}
Expand Down
37 changes: 37 additions & 0 deletions docs/api/agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/metadata \
"git_auth_configs": 0,
"motd_file": "string",
"startup_script": "string",
"startup_script_timeout": 0,
"vscode_port_proxy_uri": "string"
}
```
Expand All @@ -382,6 +383,41 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/metadata \

To perform this operation, you must be authenticated. [Learn more](authentication.md).

## Submit workspace agent state

### Code samples

```shell
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/report-state \
-H 'Content-Type: application/json' \
-H 'Coder-Session-Token: API_KEY'
```

`POST /workspaceagents/me/report-state`

> Body parameter

```json
{
"state": "starting"
}
```

### Parameters

| Name | In | Type | Required | Description |
| ------ | ---- | -------------------------------------------------------------------------------------------- | -------- | ----------------------------- |
| `body` | body | [codersdk.PostWorkspaceAgentStateRequest](schemas.md#codersdkpostworkspaceagentstaterequest) | true | Workspace agent state request |

### Responses

| Status | Meaning | Description | Schema |
| ------ | --------------------------------------------------------------- | ----------- | ------ |
| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | Success | |

To perform this operation, you must be authenticated. [Learn more](authentication.md).

## Submit workspace agent stats

### Code samples
Expand Down Expand Up @@ -507,6 +543,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \
"operating_system": "string",
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
"startup_script": "string",
"state": "starting",
"status": "connecting",
"troubleshooting_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
Expand Down
16 changes: 16 additions & 0 deletions docs/api/builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam
"operating_system": "string",
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
"startup_script": "string",
"state": "starting",
"status": "connecting",
"troubleshooting_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
Expand Down Expand Up @@ -242,6 +243,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \
"operating_system": "string",
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
"startup_script": "string",
"state": "starting",
"status": "connecting",
"troubleshooting_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
Expand Down Expand Up @@ -527,6 +529,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res
"operating_system": "string",
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
"startup_script": "string",
"state": "starting",
"status": "connecting",
"troubleshooting_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
Expand Down Expand Up @@ -601,6 +604,7 @@ Status Code **200**
| `»» operating_system` | string | false | | |
| `»» resource_id` | string(uuid) | false | | |
| `»» startup_script` | string | false | | |
| `»» state` | [codersdk.WorkspaceAgentState](schemas.md#codersdkworkspaceagentstate) | false | | |
| `»» status` | [codersdk.WorkspaceAgentStatus](schemas.md#codersdkworkspaceagentstatus) | false | | |
| `»» troubleshooting_url` | string | false | | |
| `»» updated_at` | string(date-time) | false | | |
Expand Down Expand Up @@ -630,6 +634,10 @@ Status Code **200**
| `sharing_level` | `owner` |
| `sharing_level` | `authenticated` |
| `sharing_level` | `public` |
| `state` | `starting` |
| `state` | `start_timeout` |
| `state` | `start_error` |
| `state` | `ready` |
| `status` | `connecting` |
| `status` | `connected` |
| `status` | `disconnected` |
Expand Down Expand Up @@ -738,6 +746,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta
"operating_system": "string",
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
"startup_script": "string",
"state": "starting",
"status": "connecting",
"troubleshooting_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
Expand Down Expand Up @@ -885,6 +894,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \
"operating_system": "string",
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
"startup_script": "string",
"state": "starting",
"status": "connecting",
"troubleshooting_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
Expand Down Expand Up @@ -991,6 +1001,7 @@ Status Code **200**
| `»»» operating_system` | string | false | | |
| `»»» resource_id` | string(uuid) | false | | |
| `»»» startup_script` | string | false | | |
| `»»» state` | [codersdk.WorkspaceAgentState](schemas.md#codersdkworkspaceagentstate) | false | | |
| `»»» status` | [codersdk.WorkspaceAgentStatus](schemas.md#codersdkworkspaceagentstatus) | false | | |
| `»»» troubleshooting_url` | string | false | | |
| `»»» updated_at` | string(date-time) | false | | |
Expand Down Expand Up @@ -1038,6 +1049,10 @@ Status Code **200**
| `sharing_level` | `owner` |
| `sharing_level` | `authenticated` |
| `sharing_level` | `public` |
| `state` | `starting` |
| `state` | `start_timeout` |
| `state` | `start_error` |
| `state` | `ready` |
| `status` | `connecting` |
| `status` | `connected` |
| `status` | `disconnected` |
Expand Down Expand Up @@ -1188,6 +1203,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \
"operating_system": "string",
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
"startup_script": "string",
"state": "starting",
"status": "connecting",
"troubleshooting_url": "string",
"updated_at": "2019-08-24T14:15:22Z",
Expand Down
Loading