chore: move agent functions from codersdk into agentsdk (#5903)

* chore: rename `AgentConn` to `WorkspaceAgentConn`

The codersdk was becoming bloated with consts for the workspace
agent that made no sense to a reader. `Tailnet*` is an example
of these consts.

* chore: remove `Get` prefix from *Client functions

* chore: remove `BypassRatelimits` option in `codersdk.Client`

It feels wrong to have this as a direct option because it's so infrequently
needed by API callers. It's better to directly modify headers in the two
places that we actually use it.

* Merge `appearance.go` and `buildinfo.go` into `deployment.go`

* Merge `experiments.go` and `features.go` into `deployment.go`

* Fix `make gen` referencing old type names

* Merge `error.go` into `client.go`

`codersdk.Response` lived in `error.go`, which is wrong.

* chore: refactor workspace agent functions into agentsdk

It was odd conflating the codersdk that clients should use
with functions that only the agent should use. This separates
them into two SDKs that are closely coupled, but separate.

* Merge `insights.go` into `deployment.go`

* Merge `organizationmember.go` into `organizations.go`

* Merge `quota.go` into `workspaces.go`

* Rename `sse.go` to `serversentevents.go`

* Rename `codersdk.WorkspaceAppHostResponse` to `codersdk.AppHostResponse`

* Format `.vscode/settings.json`

* Fix outdated naming in `api.ts`

* Fix app host response

* Fix unsupported type

* Fix imported type
This commit is contained in:
Kyle Carberry
2023-01-29 15:47:24 -06:00
committed by GitHub
parent e49f41652f
commit 7ad87505c8
115 changed files with 2491 additions and 2567 deletions

View File

@ -27,7 +27,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/aws-instance-identi
| Name | In | Type | Required | Description |
| ------ | ---- | -------------------------------------------------------------------------------- | -------- | ----------------------- |
| `body` | body | [codersdk.AWSInstanceIdentityToken](schemas.md#codersdkawsinstanceidentitytoken) | true | Instance identity token |
| `body` | body | [agentsdk.AWSInstanceIdentityToken](schemas.md#agentsdkawsinstanceidentitytoken) | true | Instance identity token |
### Example responses
@ -41,9 +41,9 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/aws-instance-identi
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentAuthenticateResponse](schemas.md#codersdkworkspaceagentauthenticateresponse) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.AuthenticateResponse](schemas.md#agentsdkauthenticateresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@ -74,7 +74,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/azure-instance-iden
| Name | In | Type | Required | Description |
| ------ | ---- | ------------------------------------------------------------------------------------ | -------- | ----------------------- |
| `body` | body | [codersdk.AzureInstanceIdentityToken](schemas.md#codersdkazureinstanceidentitytoken) | true | Instance identity token |
| `body` | body | [agentsdk.AzureInstanceIdentityToken](schemas.md#agentsdkazureinstanceidentitytoken) | true | Instance identity token |
### Example responses
@ -88,9 +88,9 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/azure-instance-iden
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentAuthenticateResponse](schemas.md#codersdkworkspaceagentauthenticateresponse) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.AuthenticateResponse](schemas.md#agentsdkauthenticateresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@ -120,7 +120,7 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/google-instance-ide
| Name | In | Type | Required | Description |
| ------ | ---- | -------------------------------------------------------------------------------------- | -------- | ----------------------- |
| `body` | body | [codersdk.GoogleInstanceIdentityToken](schemas.md#codersdkgoogleinstanceidentitytoken) | true | Instance identity token |
| `body` | body | [agentsdk.GoogleInstanceIdentityToken](schemas.md#agentsdkgoogleinstanceidentitytoken) | true | Instance identity token |
### Example responses
@ -134,9 +134,9 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/google-instance-ide
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentAuthenticateResponse](schemas.md#codersdkworkspaceagentauthenticateresponse) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------ |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.AuthenticateResponse](schemas.md#agentsdkauthenticateresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@ -166,9 +166,9 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/app-health \
### Parameters
| Name | In | Type | Required | Description |
| ------ | ---- | -------------------------------------------------------------------------------------------- | -------- | -------------------------- |
| `body` | body | [codersdk.PostWorkspaceAppHealthsRequest](schemas.md#codersdkpostworkspaceapphealthsrequest) | true | Application health request |
| Name | In | Type | Required | Description |
| ------ | ---- | -------------------------------------------------------------------------- | -------- | -------------------------- |
| `body` | body | [agentsdk.PostAppHealthsRequest](schemas.md#agentsdkpostapphealthsrequest) | true | Application health request |
### Responses
@ -235,9 +235,9 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitauth?url=http%
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------ |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentGitAuthResponse](schemas.md#codersdkworkspaceagentgitauthresponse) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.GitAuthResponse](schemas.md#agentsdkgitauthresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@ -267,9 +267,9 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitsshkey \
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------------------ |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AgentGitSSHKey](schemas.md#codersdkagentgitsshkey) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.GitSSHKey](schemas.md#agentsdkgitsshkey) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@ -377,9 +377,9 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/metadata \
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentMetadata](schemas.md#codersdkworkspaceagentmetadata) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ------------------------------------------------ |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.Metadata](schemas.md#agentsdkmetadata) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@ -415,9 +415,9 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/report-stats \
### Parameters
| Name | In | Type | Required | Description |
| ------ | ---- | ---------------------------------------------------- | -------- | ------------- |
| `body` | body | [codersdk.AgentStats](schemas.md#codersdkagentstats) | true | Stats request |
| Name | In | Type | Required | Description |
| ------ | ---- | ------------------------------------------ | -------- | ------------- |
| `body` | body | [agentsdk.Stats](schemas.md#agentsdkstats) | true | Stats request |
### Example responses
@ -431,9 +431,9 @@ curl -X POST http://coder-server:8080/api/v2/workspaceagents/me/report-stats \
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AgentStatsResponse](schemas.md#codersdkagentstatsresponse) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [agentsdk.StatsResponse](schemas.md#agentsdkstatsresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).
@ -666,7 +666,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/lis
{
"ports": [
{
"network": "tcp",
"network": "string",
"port": 0,
"process_name": "string"
}
@ -676,9 +676,9 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/{workspaceagent}/lis
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.ListeningPortsResponse](schemas.md#codersdklisteningportsresponse) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.WorkspaceAgentListeningPortsResponse](schemas.md#codersdkworkspaceagentlisteningportsresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).

View File

@ -51,8 +51,8 @@ curl -X GET http://coder-server:8080/api/v2/applications/host \
### Responses
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.GetAppHostResponse](schemas.md#codersdkgetapphostresponse) |
| Status | Meaning | Description | Schema |
| ------ | ------------------------------------------------------- | ----------- | -------------------------------------------------------------- |
| 200 | [OK](https://tools.ietf.org/html/rfc7231#section-6.3.1) | OK | [codersdk.AppHostResponse](schemas.md#codersdkapphostresponse) |
To perform this operation, you must be authenticated. [Learn more](authentication.md).

View File

@ -1,5 +1,289 @@
# Schemas
## agentsdk.AWSInstanceIdentityToken
```json
{
"document": "string",
"signature": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ----------- | ------ | -------- | ------------ | ----------- |
| `document` | string | true | | |
| `signature` | string | true | | |
## agentsdk.AuthenticateResponse
```json
{
"session_token": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| --------------- | ------ | -------- | ------------ | ----------- |
| `session_token` | string | false | | |
## agentsdk.AzureInstanceIdentityToken
```json
{
"encoding": "string",
"signature": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ----------- | ------ | -------- | ------------ | ----------- |
| `encoding` | string | true | | |
| `signature` | string | true | | |
## agentsdk.GitAuthResponse
```json
{
"password": "string",
"url": "string",
"username": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ---------- | ------ | -------- | ------------ | ----------- |
| `password` | string | false | | |
| `url` | string | false | | |
| `username` | string | false | | |
## agentsdk.GitSSHKey
```json
{
"private_key": "string",
"public_key": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------- | ------ | -------- | ------------ | ----------- |
| `private_key` | string | false | | |
| `public_key` | string | false | | |
## agentsdk.GoogleInstanceIdentityToken
```json
{
"json_web_token": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ---------------- | ------ | -------- | ------------ | ----------- |
| `json_web_token` | string | true | | |
## agentsdk.Metadata
```json
{
"apps": [
{
"command": "string",
"display_name": "string",
"external": true,
"health": "disabled",
"healthcheck": {
"interval": 0,
"threshold": 0,
"url": "string"
},
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
"url": "string"
}
],
"derpmap": {
"omitDefaultRegions": true,
"regions": {
"property1": {
"avoid": true,
"embeddedRelay": true,
"nodes": [
{
"certName": "string",
"derpport": 0,
"forceHTTP": true,
"hostName": "string",
"insecureForTests": true,
"ipv4": "string",
"ipv6": "string",
"name": "string",
"regionID": 0,
"stunonly": true,
"stunport": 0,
"stuntestIP": "string"
}
],
"regionCode": "string",
"regionID": 0,
"regionName": "string"
},
"property2": {
"avoid": true,
"embeddedRelay": true,
"nodes": [
{
"certName": "string",
"derpport": 0,
"forceHTTP": true,
"hostName": "string",
"insecureForTests": true,
"ipv4": "string",
"ipv6": "string",
"name": "string",
"regionID": 0,
"stunonly": true,
"stunport": 0,
"stuntestIP": "string"
}
],
"regionCode": "string",
"regionID": 0,
"regionName": "string"
}
}
},
"directory": "string",
"environment_variables": {
"property1": "string",
"property2": "string"
},
"git_auth_configs": 0,
"motd_file": "string",
"startup_script": "string",
"startup_script_timeout": 0,
"vscode_port_proxy_uri": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------------ | ------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apps` | array of [codersdk.WorkspaceApp](#codersdkworkspaceapp) | false | | |
| `derpmap` | [tailcfg.DERPMap](#tailcfgderpmap) | false | | |
| `directory` | string | false | | |
| `environment_variables` | object | false | | |
| » `[any property]` | string | false | | |
| `git_auth_configs` | integer | false | | Git auth configs stores the number of Git configurations the Coder deployment has. If this number is >0, we set up special configuration in the workspace. |
| `motd_file` | string | false | | |
| `startup_script` | string | false | | |
| `startup_script_timeout` | integer | false | | |
| `vscode_port_proxy_uri` | string | false | | |
## agentsdk.PostAppHealthsRequest
```json
{
"healths": {
"property1": "disabled",
"property2": "disabled"
}
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | ---------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------- |
| `healths` | object | false | | Healths is a map of the workspace app name and the health of the app. |
| » `[any property]` | [codersdk.WorkspaceAppHealth](#codersdkworkspaceapphealth) | false | | |
## agentsdk.PostLifecycleRequest
```json
{
"state": "created"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------- | -------------------------------------------------------------------- | -------- | ------------ | ----------- |
| `state` | [codersdk.WorkspaceAgentLifecycle](#codersdkworkspaceagentlifecycle) | false | | |
## agentsdk.PostVersionRequest
```json
{
"version": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| --------- | ------ | -------- | ------------ | ----------- |
| `version` | string | false | | |
## agentsdk.Stats
```json
{
"conns_by_proto": {
"property1": 0,
"property2": 0
},
"num_comms": 0,
"rx_bytes": 0,
"rx_packets": 0,
"tx_bytes": 0,
"tx_packets": 0
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | ------- | -------- | ------------ | ------------------------------------------------------------ |
| `conns_by_proto` | object | false | | Conns by proto is a count of connections by protocol. |
| » `[any property]` | integer | false | | |
| `num_comms` | integer | false | | Num comms is the number of connections received by an agent. |
| `rx_bytes` | integer | false | | Rx bytes is the number of received bytes. |
| `rx_packets` | integer | false | | Rx packets is the number of received packets. |
| `tx_bytes` | integer | false | | Tx bytes is the number of transmitted bytes. |
| `tx_packets` | integer | false | | Tx packets is the number of transmitted bytes. |
## agentsdk.StatsResponse
```json
{
"report_interval": 0
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ----------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------ |
| `report_interval` | integer | false | | Report interval is the duration after which the agent should send stats again. |
## coderd.SCIMUser
```json
@ -117,22 +401,6 @@
| `all` |
| `application_connect` |
## codersdk.AWSInstanceIdentityToken
```json
{
"document": "string",
"signature": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ----------- | ------ | -------- | ------------ | ----------- |
| `document` | string | true | | |
| `signature` | string | true | | |
## codersdk.AddLicenseRequest
```json
@ -147,63 +415,19 @@
| --------- | ------ | -------- | ------------ | ----------- |
| `license` | string | true | | |
## codersdk.AgentGitSSHKey
## codersdk.AppHostResponse
```json
{
"private_key": "string",
"public_key": "string"
"host": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------- | ------ | -------- | ------------ | ----------- |
| `private_key` | string | false | | |
| `public_key` | string | false | | |
## codersdk.AgentStats
```json
{
"conns_by_proto": {
"property1": 0,
"property2": 0
},
"num_comms": 0,
"rx_bytes": 0,
"rx_packets": 0,
"tx_bytes": 0,
"tx_packets": 0
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | ------- | -------- | ------------ | ------------------------------------------------------------ |
| `conns_by_proto` | object | false | | Conns by proto is a count of connections by protocol. |
| » `[any property]` | integer | false | | |
| `num_comms` | integer | false | | Num comms is the number of connections received by an agent. |
| `rx_bytes` | integer | false | | Rx bytes is the number of received bytes. |
| `rx_packets` | integer | false | | Rx packets is the number of received packets. |
| `tx_bytes` | integer | false | | Tx bytes is the number of transmitted bytes. |
| `tx_packets` | integer | false | | Tx packets is the number of transmitted bytes. |
## codersdk.AgentStatsResponse
```json
{
"report_interval": 0
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ----------------- | ------- | -------- | ------------ | ------------------------------------------------------------------------------ |
| `report_interval` | integer | false | | Report interval is the duration after which the agent should send stats again. |
| Name | Type | Required | Restrictions | Description |
| ------ | ------ | -------- | ------------ | ------------------------------------------------------------- |
| `host` | string | false | | Host is the externally accessible URL for the Coder instance. |
## codersdk.AppearanceConfig
@ -560,22 +784,6 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
| ---------------- | ------- | -------- | ------------ | ----------- |
| `[any property]` | boolean | false | | |
## codersdk.AzureInstanceIdentityToken
```json
{
"encoding": "string",
"signature": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ----------- | ------ | -------- | ------------ | ----------- |
| `encoding` | string | true | | |
| `signature` | string | true | | |
## codersdk.BuildInfoResponse
```json
@ -2504,20 +2712,6 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| ----- | ------ | -------- | ------------ | ----------- |
| `key` | string | false | | |
## codersdk.GetAppHostResponse
```json
{
"host": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------ | ------ | -------- | ------------ | ------------------------------------------------------------- |
| `host` | string | false | | Host is the externally accessible URL for the Coder instance. |
## codersdk.GetUsersResponse
```json
@ -2601,20 +2795,6 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `updated_at` | string | false | | |
| `user_id` | string | false | | |
## codersdk.GoogleInstanceIdentityToken
```json
{
"json_web_token": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ---------------- | ------ | -------- | ------------ | ----------- |
| `json_web_token` | string | true | | |
## codersdk.Group
```json
@ -2694,58 +2874,6 @@ CreateParameterRequest is a structure used to create a new parameter value for a
| `uploaded_at` | string | false | | |
| `uuid` | string | false | | |
## codersdk.ListeningPort
```json
{
"network": "tcp",
"port": 0,
"process_name": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| -------------- | -------------------------------------------------------------- | -------- | ------------ | ------------------------ |
| `network` | [codersdk.ListeningPortNetwork](#codersdklisteningportnetwork) | false | | only "tcp" at the moment |
| `port` | integer | false | | |
| `process_name` | string | false | | may be empty |
## codersdk.ListeningPortNetwork
```json
"tcp"
```
### Properties
#### Enumerated Values
| Value |
| ----- |
| `tcp` |
## codersdk.ListeningPortsResponse
```json
{
"ports": [
{
"network": "tcp",
"port": 0,
"process_name": "string"
}
]
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------- | --------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ports` | array of [codersdk.ListeningPort](#codersdklisteningport) | false | | If there are no ports in the list, nothing should be displayed in the UI. There must not be a "no ports available" message or anything similar, as there will always be no ports displayed on platforms where our port detection logic is unsupported. |
## codersdk.LogLevel
```json
@ -3363,38 +3491,6 @@ Parameter represents a set value for the scope.
| `none` |
| `data` |
## codersdk.PostWorkspaceAgentLifecycleRequest
```json
{
"state": "created"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------- | -------------------------------------------------------------------- | -------- | ------------ | ----------- |
| `state` | [codersdk.WorkspaceAgentLifecycle](#codersdkworkspaceagentlifecycle) | false | | |
## codersdk.PostWorkspaceAppHealthsRequest
```json
{
"healths": {
"property1": "disabled",
"property2": "disabled"
}
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------ | ---------------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------- |
| `healths` | object | false | | Healths is a map of the workspace app name and the health of the app. |
| » `[any property]` | [codersdk.WorkspaceAppHealth](#codersdkworkspaceapphealth) | false | | |
## codersdk.PprofConfig
```json
@ -4801,20 +4897,6 @@ Parameter represents a set value for the scope.
| `updated_at` | string | false | | |
| `version` | string | false | | |
## codersdk.WorkspaceAgentAuthenticateResponse
```json
{
"session_token": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| --------------- | ------ | -------- | ------------ | ----------- |
| `session_token` | string | false | | |
## codersdk.WorkspaceAgentConnectionInfo
```json
@ -4879,24 +4961,6 @@ Parameter represents a set value for the scope.
| ---------- | ---------------------------------- | -------- | ------------ | ----------- |
| `derp_map` | [tailcfg.DERPMap](#tailcfgderpmap) | false | | |
## codersdk.WorkspaceAgentGitAuthResponse
```json
{
"password": "string",
"url": "string",
"username": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ---------- | ------ | -------- | ------------ | ----------- |
| `password` | string | false | | |
| `url` | string | false | | |
| `username` | string | false | | |
## codersdk.WorkspaceAgentLifecycle
```json
@ -4915,107 +4979,43 @@ Parameter represents a set value for the scope.
| `start_error` |
| `ready` |
## codersdk.WorkspaceAgentMetadata
## codersdk.WorkspaceAgentListeningPort
```json
{
"apps": [
{
"command": "string",
"display_name": "string",
"external": true,
"health": "disabled",
"healthcheck": {
"interval": 0,
"threshold": 0,
"url": "string"
},
"icon": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"sharing_level": "owner",
"slug": "string",
"subdomain": true,
"url": "string"
}
],
"derpmap": {
"omitDefaultRegions": true,
"regions": {
"property1": {
"avoid": true,
"embeddedRelay": true,
"nodes": [
{
"certName": "string",
"derpport": 0,
"forceHTTP": true,
"hostName": "string",
"insecureForTests": true,
"ipv4": "string",
"ipv6": "string",
"name": "string",
"regionID": 0,
"stunonly": true,
"stunport": 0,
"stuntestIP": "string"
}
],
"regionCode": "string",
"regionID": 0,
"regionName": "string"
},
"property2": {
"avoid": true,
"embeddedRelay": true,
"nodes": [
{
"certName": "string",
"derpport": 0,
"forceHTTP": true,
"hostName": "string",
"insecureForTests": true,
"ipv4": "string",
"ipv6": "string",
"name": "string",
"regionID": 0,
"stunonly": true,
"stunport": 0,
"stuntestIP": "string"
}
],
"regionCode": "string",
"regionID": 0,
"regionName": "string"
}
}
},
"directory": "string",
"environment_variables": {
"property1": "string",
"property2": "string"
},
"git_auth_configs": 0,
"motd_file": "string",
"startup_script": "string",
"startup_script_timeout": 0,
"vscode_port_proxy_uri": "string"
"network": "string",
"port": 0,
"process_name": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------------------------ | ------------------------------------------------------- | -------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `apps` | array of [codersdk.WorkspaceApp](#codersdkworkspaceapp) | false | | |
| `derpmap` | [tailcfg.DERPMap](#tailcfgderpmap) | false | | |
| `directory` | string | false | | |
| `environment_variables` | object | false | | |
| » `[any property]` | string | false | | |
| `git_auth_configs` | integer | false | | Git auth configs stores the number of Git configurations the Coder deployment has. If this number is >0, we set up special configuration in the workspace. |
| `motd_file` | string | false | | |
| `startup_script` | string | false | | |
| `startup_script_timeout` | integer | false | | |
| `vscode_port_proxy_uri` | string | false | | |
| Name | Type | Required | Restrictions | Description |
| -------------- | ------- | -------- | ------------ | ------------------------ |
| `network` | string | false | | only "tcp" at the moment |
| `port` | integer | false | | |
| `process_name` | string | false | | may be empty |
## codersdk.WorkspaceAgentListeningPortsResponse
```json
{
"ports": [
{
"network": "string",
"port": 0,
"process_name": "string"
}
]
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
| ------- | ------------------------------------------------------------------------------------- | -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ports` | array of [codersdk.WorkspaceAgentListeningPort](#codersdkworkspaceagentlisteningport) | false | | If there are no ports in the list, nothing should be displayed in the UI. There must not be a "no ports available" message or anything similar, as there will always be no ports displayed on platforms where our port detection logic is unsupported. |
## codersdk.WorkspaceAgentStatus