Skip to content

Commit 582f3bf

Browse files
chore(docs): add agent api debug docs
1 parent 0afff43 commit 582f3bf

File tree

4 files changed

+211
-0
lines changed

4 files changed

+211
-0
lines changed

docs/manifest.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,22 @@
11051105
"path": "reference/cli/whoami.md"
11061106
}
11071107
]
1108+
},
1109+
{
1110+
"title": "Agent API",
1111+
"description": "Learn how to use Coder Agent API",
1112+
"path": "./reference/agent-api/README.md",
1113+
"icon_path": "./images/icons/api.svg",
1114+
"children": [
1115+
{
1116+
"title": "Debug",
1117+
"path": "./reference/agent-api/debug.md"
1118+
},
1119+
{
1120+
"title": "Schemas",
1121+
"path": "./reference/agent-api/schemas.md"
1122+
}
1123+
]
11081124
}
11091125
]
11101126
},

docs/reference/agent-api/README.md

Whitespace-only changes.

docs/reference/agent-api/debug.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Debug
2+
3+
## Get debug logs
4+
5+
### Code samples
6+
7+
```shell
8+
curl http://127.0.0.1:2113/debug/logs
9+
```
10+
11+
`GET /debug/logs`
12+
13+
### Responses
14+
15+
| Status | Meaning | Description | Schema |
16+
| ------ | ------------------------------------------------------- | ----------- | ------ |
17+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |
18+
19+
## Get debug info for magicsock
20+
21+
### Code samples
22+
23+
```shell
24+
curl http://127.0.0.1:2113/debug/magicsock
25+
```
26+
27+
`GET /debug/magicsock`
28+
29+
### Responses
30+
31+
See
32+
[Tailscale's documentation](https://pkg.go.dev/tailscale.com/wgengine/magicsock#Conn.ServeHTTPDebug)
33+
for response format.
34+
35+
## Toggle debug logging for magicsock
36+
37+
### Code samples
38+
39+
```shell
40+
curl http://127.0.0.1:2113/debug/magicsock/debug-logging/true
41+
```
42+
43+
`GET /debug/magicsock/debug-logging/{state}`
44+
45+
### Parameters
46+
47+
| Name | In | Type | Required | Description |
48+
| ------- | ---- | ------- | -------- | ------------------- |
49+
| `state` | path | boolean | true | Debug logging state |
50+
51+
### Responses
52+
53+
| Status | Meaning | Description | Schema |
54+
| ------ | ------------------------------------------------------- | ----------- | ------ |
55+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |
56+
57+
## Get debug manifest
58+
59+
### Code samples
60+
61+
```shell
62+
curl http://127.0.0.1:2113/debug/manifest
63+
```
64+
65+
`GET /debug/manifest`
66+
67+
### Responses
68+
69+
| Status | Meaning | Description | Schema |
70+
| ------ | ------------------------------------------------------- | ----------- | ------ |
71+
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | |

docs/reference/agent-api/schemas.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Schemas
2+
3+
## agentsdk.Manifest
4+
5+
```json
6+
{
7+
"agent_id": "151321db-0713-473c-ab42-2cc6ddeab1a4",
8+
"agent_name": "string",
9+
"owner_name": "string",
10+
"workspace_id": "8ef13a0d-a5c9-4fb4-abf2-f8f65c3830fb",
11+
"workspace_name": "string",
12+
"git_auth_configs": 1,
13+
"vscode_port_proxy_uri": "string",
14+
"apps": [
15+
{
16+
"id": "c488c933-688a-444e-a55d-f1e88ecc78f5",
17+
"url": "string",
18+
"external": false,
19+
"slug": "string",
20+
"display_name": "string",
21+
"icon": "string",
22+
"subdomain": false,
23+
"sharing_level": "owner",
24+
"healthcheck": {
25+
"url": "string",
26+
"interval": 5,
27+
"threshold": 6
28+
},
29+
"health": "initializing"
30+
}
31+
],
32+
"derpmap": {
33+
"HomeParams": {},
34+
"Regions": {
35+
"1000": {
36+
"EmbeddedRelay": false,
37+
"RegionID": 1000,
38+
"RegionCode": "string",
39+
"RegionName": "string",
40+
"Nodes": [
41+
{
42+
"Name": "string",
43+
"RegionID": 1000,
44+
"HostName": "string",
45+
"STUNPort": 19302,
46+
"STUNOnly": true
47+
}
48+
]
49+
}
50+
}
51+
},
52+
"derp_force_websockets": false,
53+
"environment_variables": {
54+
"OIDC_TOKEN": "string"
55+
},
56+
"directory": "string",
57+
"motd_file": "string",
58+
"disable_direct_connections": false,
59+
"metadata": [
60+
{
61+
"display_name": "string",
62+
"key": "string",
63+
"script": "string",
64+
"interval": 10,
65+
"timeout": 1
66+
}
67+
],
68+
"scripts": [
69+
{
70+
"log_source_id": "3e79c8da-08ae-48f4-b73e-11e194cdea06",
71+
"log_path": "string",
72+
"script": "string",
73+
"cron": "string",
74+
"run_on_start": true,
75+
"run_on_stop": false,
76+
"start_blocks_login": true,
77+
"timeout": 0
78+
}
79+
]
80+
}
81+
```
82+
83+
### Properties
84+
85+
| Name | Type | Required | Restrictions | Description |
86+
| ---------------------------- | ------------------------------------------------------------------------------------------------- | -------- | ------------ | ----------- |
87+
| `agent_id` | string | true | | |
88+
| `agent_name` | string | true | | |
89+
| `owner_name` | string | true | | |
90+
| `workspace_id` | string | true | | |
91+
| `workspace_name` | string | true | | |
92+
| `git_auth_configs` | int | true | | |
93+
| `vscode_port_proxy_uri` | string | true | | |
94+
| `apps` | array of [codersdk.WorkspaceApp](../api/schemas#codersdkworkspaceapp) | true | | |
95+
| `derpmap` | [tailcfg.DERPMap](../api/schemas#tailcfgderpmap) | true | | |
96+
| `derp_force_websockets` | boolean | true | | |
97+
| `environment_variables` | object | true | | |
98+
| `directory` | string | true | | |
99+
| `motd_file` | string | true | | |
100+
| `disable_direct_connections` | boolean | true | | |
101+
| `metadata` | array of [codersdk.WorkspaceAgentMetadataDescription](#codersdkworkspaceagentmetadatadescription) | true | | |
102+
| `scripts` | array of [codersdk.WorkspaceAgentScript](../api/schemas#codersdkworkspaceagentscript) | true | | |
103+
104+
## codersdk.WorkspaceAgentMetadataDescription
105+
106+
```json
107+
{
108+
"display_name": "string",
109+
"key": "string",
110+
"script": "string",
111+
"interval": 10,
112+
"timeout": 1
113+
}
114+
```
115+
116+
### Properties
117+
118+
| Name | Type | Required | Restrictions | Description |
119+
| -------------- | ------- | -------- | ------------ | ----------- |
120+
| `display_name` | string | true | | |
121+
| `key` | string | true | | |
122+
| `script` | string | true | | |
123+
| `interval` | integer | true | | |
124+
| `timeout` | integer | true | | |

0 commit comments

Comments
 (0)