Skip to content

Commit 8119e71

Browse files
committed
Generate docs
1 parent a84e467 commit 8119e71

File tree

8 files changed

+260
-18
lines changed

8 files changed

+260
-18
lines changed

coderd/apidoc/docs.go

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/workspaceagents.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ type WorkspaceAgentMetadata struct {
142142
DERPMap *tailcfg.DERPMap `json:"derpmap"`
143143
EnvironmentVariables map[string]string `json:"environment_variables"`
144144
StartupScript string `json:"startup_script"`
145-
StartupScriptTimeout time.Duration `json:"startup_script_timeout" format:"duration"`
145+
StartupScriptTimeout time.Duration `json:"startup_script_timeout"`
146146
Directory string `json:"directory"`
147147
MOTDFile string `json:"motd_file"`
148148
}

docs/api/agents.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/metadata \
370370
"git_auth_configs": 0,
371371
"motd_file": "string",
372372
"startup_script": "string",
373+
"startup_script_timeout": 0,
373374
"vscode_port_proxy_uri": "string"
374375
}
375376
```
@@ -382,6 +383,41 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/metadata \
382383

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

386+
## Submit workspace agent state
387+
388+
### Code samples
389+
390+
```shell
391+
# Example request using curl
392+
curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/report-state \
393+
-H 'Content-Type: application/json' \
394+
-H 'Coder-Session-Token: API_KEY'
395+
```
396+
397+
`POST /workspaceagents/me/report-state`
398+
399+
> Body parameter
400+
401+
```json
402+
{
403+
"state": "starting"
404+
}
405+
```
406+
407+
### Parameters
408+
409+
| Name | In | Type | Required | Description |
410+
| ------ | ---- | -------------------------------------------------------------------------------------------- | -------- | ----------------------------- |
411+
| `body` | body | [codersdk.PostWorkspaceAgentStateRequest](schemas.md#codersdkpostworkspaceagentstaterequest) | true | Workspace agent state request |
412+
413+
### Responses
414+
415+
| Status | Meaning | Description | Schema |
416+
| ------ | --------------------------------------------------------------- | ----------- | ------ |
417+
| 204 | [No Content](https://tools.ietf.org/html/rfc7231#section-6.3.5) | Success | |
418+
419+
To perform this operation, you must be authenticated. [Learn more](authentication.md).
420+
385421
## Submit workspace agent stats
386422

387423
### Code samples
@@ -507,6 +543,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent} \
507543
"operating_system": "string",
508544
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
509545
"startup_script": "string",
546+
"state": "starting",
510547
"status": "connecting",
511548
"troubleshooting_url": "string",
512549
"updated_at": "2019-08-24T14:15:22Z",

docs/api/builds.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ curl -X GET http://coder-server:8080/api/v2/users/{user}/workspace/{workspacenam
100100
"operating_system": "string",
101101
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
102102
"startup_script": "string",
103+
"state": "starting",
103104
"status": "connecting",
104105
"troubleshooting_url": "string",
105106
"updated_at": "2019-08-24T14:15:22Z",
@@ -242,6 +243,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild} \
242243
"operating_system": "string",
243244
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
244245
"startup_script": "string",
246+
"state": "starting",
245247
"status": "connecting",
246248
"troubleshooting_url": "string",
247249
"updated_at": "2019-08-24T14:15:22Z",
@@ -527,6 +529,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/res
527529
"operating_system": "string",
528530
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
529531
"startup_script": "string",
532+
"state": "starting",
530533
"status": "connecting",
531534
"troubleshooting_url": "string",
532535
"updated_at": "2019-08-24T14:15:22Z",
@@ -601,6 +604,7 @@ Status Code **200**
601604
| `»» operating_system` | string | false | | |
602605
| `»» resource_id` | string(uuid) | false | | |
603606
| `»» startup_script` | string | false | | |
607+
| `»» state` | [codersdk.WorkspaceAgentState](schemas.md#codersdkworkspaceagentstate) | false | | |
604608
| `»» status` | [codersdk.WorkspaceAgentStatus](schemas.md#codersdkworkspaceagentstatus) | false | | |
605609
| `»» troubleshooting_url` | string | false | | |
606610
| `»» updated_at` | string(date-time) | false | | |
@@ -630,6 +634,10 @@ Status Code **200**
630634
| `sharing_level` | `owner` |
631635
| `sharing_level` | `authenticated` |
632636
| `sharing_level` | `public` |
637+
| `state` | `starting` |
638+
| `state` | `start_timeout` |
639+
| `state` | `start_error` |
640+
| `state` | `ready` |
633641
| `status` | `connecting` |
634642
| `status` | `connected` |
635643
| `status` | `disconnected` |
@@ -738,6 +746,7 @@ curl -X GET http://coder-server:8080/api/v2/workspacebuilds/{workspacebuild}/sta
738746
"operating_system": "string",
739747
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
740748
"startup_script": "string",
749+
"state": "starting",
741750
"status": "connecting",
742751
"troubleshooting_url": "string",
743752
"updated_at": "2019-08-24T14:15:22Z",
@@ -885,6 +894,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/builds \
885894
"operating_system": "string",
886895
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
887896
"startup_script": "string",
897+
"state": "starting",
888898
"status": "connecting",
889899
"troubleshooting_url": "string",
890900
"updated_at": "2019-08-24T14:15:22Z",
@@ -991,6 +1001,7 @@ Status Code **200**
9911001
| `»»» operating_system` | string | false | | |
9921002
| `»»» resource_id` | string(uuid) | false | | |
9931003
| `»»» startup_script` | string | false | | |
1004+
| `»»» state` | [codersdk.WorkspaceAgentState](schemas.md#codersdkworkspaceagentstate) | false | | |
9941005
| `»»» status` | [codersdk.WorkspaceAgentStatus](schemas.md#codersdkworkspaceagentstatus) | false | | |
9951006
| `»»» troubleshooting_url` | string | false | | |
9961007
| `»»» updated_at` | string(date-time) | false | | |
@@ -1038,6 +1049,10 @@ Status Code **200**
10381049
| `sharing_level` | `owner` |
10391050
| `sharing_level` | `authenticated` |
10401051
| `sharing_level` | `public` |
1052+
| `state` | `starting` |
1053+
| `state` | `start_timeout` |
1054+
| `state` | `start_error` |
1055+
| `state` | `ready` |
10411056
| `status` | `connecting` |
10421057
| `status` | `connected` |
10431058
| `status` | `disconnected` |
@@ -1188,6 +1203,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/builds \
11881203
"operating_system": "string",
11891204
"resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",
11901205
"startup_script": "string",
1206+
"state": "starting",
11911207
"status": "connecting",
11921208
"troubleshooting_url": "string",
11931209
"updated_at": "2019-08-24T14:15:22Z",

0 commit comments

Comments
 (0)