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

Method WorkspaceBuildState

codersdk/workspacebuilds.go:192–202  ·  view source on GitHub ↗

WorkspaceBuildState returns the provisioner state of the build.

(ctx context.Context, build uuid.UUID)

Source from the content-addressed store, hash-verified

190
191// WorkspaceBuildState returns the provisioner state of the build.
192func (c *Client) WorkspaceBuildState(ctx context.Context, build uuid.UUID) ([]byte, error) {
193 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/workspacebuilds/%s/state", build), nil)
194 if err != nil {
195 return nil, err
196 }
197 defer res.Body.Close()
198 if res.StatusCode != http.StatusOK {
199 return nil, ReadBodyAsError(res)
200 }
201 return io.ReadAll(res.Body)
202}
203
204// UpdateWorkspaceBuildStateRequest is the request body for updating the
205// provisioner state of a workspace build.

Callers 3

TestWorkspaceBuildStateFunction · 0.80
TestPostWorkspaceBuildFunction · 0.80
statePullMethod · 0.80

Calls 4

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
ReadAllMethod · 0.45

Tested by 2

TestWorkspaceBuildStateFunction · 0.64
TestPostWorkspaceBuildFunction · 0.64