Get workspace agent port shares
Code samples
# Example request using curl
curl -X GET http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
GET /api/v2/workspaces/{workspace}/port-share
Parameters
Name In Type Required Description workspacepath string(uuid) true Workspace ID
Example responses
200 Response
{
"shares": [
{
"agent_name": "string",
"port": 0,
"protocol": "http",
"share_level": "owner",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
}
]
}
Responses
To perform this operation, you must be authenticated. Learn more .
Upsert workspace agent port share
Code samples
# Example request using curl
curl -X POST http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Coder-Session-Token: API_KEY'
POST /api/v2/workspaces/{workspace}/port-share
Body parameter
{
"agent_name": "string",
"port": 0,
"protocol": "http",
"share_level": "owner"
}
Parameters
Example responses
200 Response
{
"agent_name": "string",
"port": 0,
"protocol": "http",
"share_level": "owner",
"workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9"
}
Responses
To perform this operation, you must be authenticated. Learn more .
Delete workspace agent port share
Code samples
# Example request using curl
curl -X DELETE http://coder-server:8080/api/v2/workspaces/{workspace}/port-share \
-H 'Content-Type: application/json' \
-H 'Coder-Session-Token: API_KEY'
DELETE /api/v2/workspaces/{workspace}/port-share
Body parameter
{
"agent_name": "string",
"port": 0
}
Parameters
Responses
Status Meaning Description Schema 200 OK OK
To perform this operation, you must be authenticated. Learn more .