mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: add agent-connection-watch for workspaces (#24507)
<!-- If you have used AI to produce some or all of this PR, please ensure you have read our [AI Contribution guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING) before submitting. --> relates to GRU-18 Adds basic implementation for Workspace Agent Connection Watch and tests. Missing are handling of logs.
This commit is contained in:
Generated
+122
@@ -12783,6 +12783,41 @@ const docTemplate = `{
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v2/workspaces/{workspace}/agent-connection-watch": {
|
||||
"get": {
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Workspaces"
|
||||
],
|
||||
"summary": "Workspace Agent Connection Watch",
|
||||
"operationId": "workspace-agent-connection-watch",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"format": "uuid",
|
||||
"description": "Workspace ID",
|
||||
"name": "workspace",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"101": {
|
||||
"description": "Switching Protocols",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/workspacesdk.ConnectionWatchEvent"
|
||||
}
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"CoderSessionToken": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/api/v2/workspaces/{workspace}/autostart": {
|
||||
"put": {
|
||||
"consumes": [
|
||||
@@ -27964,6 +27999,93 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspacesdk.AgentUpdate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"lifecycle": {
|
||||
"$ref": "#/definitions/codersdk.WorkspaceAgentLifecycle"
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspacesdk.BuildUpdate": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"job_status": {
|
||||
"$ref": "#/definitions/codersdk.ProvisionerJobStatus"
|
||||
},
|
||||
"transition": {
|
||||
"$ref": "#/definitions/codersdk.WorkspaceTransition"
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspacesdk.ConnectionWatchEvent": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"agent_update": {
|
||||
"$ref": "#/definitions/workspacesdk.AgentUpdate"
|
||||
},
|
||||
"build_update": {
|
||||
"$ref": "#/definitions/workspacesdk.BuildUpdate"
|
||||
},
|
||||
"error": {
|
||||
"$ref": "#/definitions/workspacesdk.WatchError"
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspacesdk.WatchError": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"$ref": "#/definitions/workspacesdk.WatchErrorCode"
|
||||
},
|
||||
"details": {
|
||||
"type": "string"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"retryable": {
|
||||
"type": "boolean"
|
||||
}
|
||||
}
|
||||
},
|
||||
"workspacesdk.WatchErrorCode": {
|
||||
"type": "integer",
|
||||
"enum": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6
|
||||
],
|
||||
"x-enum-comments": {
|
||||
"_": "Ensure that zero value is not a valid code"
|
||||
},
|
||||
"x-enum-descriptions": [
|
||||
"Ensure that zero value is not a valid code",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
""
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"_",
|
||||
"WatchErrorTooManyAgents",
|
||||
"WatchErrorNameNotFound",
|
||||
"WatchErrorNoAgents",
|
||||
"WatchErrorServerShutdown",
|
||||
"WatchErrorDatabase",
|
||||
"WatchErrorInternal"
|
||||
]
|
||||
},
|
||||
"wsproxysdk.CryptoKeysResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
|
||||
Reference in New Issue
Block a user