MCPcopy Index your code
hub / github.com/coder/coder / workspaceAgentPortShares

Method workspaceAgentPortShares

coderd/workspaceagentportshare.go:123–136  ·  view source on GitHub ↗

@Summary Get workspace agent port shares @ID get-workspace-agent-port-shares @Security CoderSessionToken @Produce json @Tags PortSharing @Param workspace path string true "Workspace ID" format(uuid) @Success 200 {object} codersdk.WorkspaceAgentPortShares @Router /api/v2/workspaces/{workspace}/port-s

(rw http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

121// @Success 200 {object} codersdk.WorkspaceAgentPortShares
122// @Router /api/v2/workspaces/{workspace}/port-share [get]
123func (api *API) workspaceAgentPortShares(rw http.ResponseWriter, r *http.Request) {
124 ctx := r.Context()
125 workspace := httpmw.WorkspaceParam(r)
126
127 shares, err := api.Database.ListWorkspaceAgentPortShares(ctx, workspace.ID)
128 if err != nil {
129 httpapi.InternalServerError(rw, err)
130 return
131 }
132
133 httpapi.Write(ctx, rw, http.StatusOK, codersdk.WorkspaceAgentPortShares{
134 Shares: convertPortShares(shares),
135 })
136}
137
138// @Summary Delete workspace agent port share
139// @ID delete-workspace-agent-port-share

Callers

nothing calls this directly

Calls 6

WorkspaceParamFunction · 0.92
InternalServerErrorFunction · 0.92
WriteFunction · 0.92
convertPortSharesFunction · 0.85
ContextMethod · 0.65

Tested by

no test coverage detected