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

Method TemplateVersionDryRun

codersdk/templateversions.go:219–231  ·  view source on GitHub ↗

TemplateVersionDryRun returns the current state of a template version dry-run job.

(ctx context.Context, version, job uuid.UUID)

Source from the content-addressed store, hash-verified

217// TemplateVersionDryRun returns the current state of a template version dry-run
218// job.
219func (c *Client) TemplateVersionDryRun(ctx context.Context, version, job uuid.UUID) (ProvisionerJob, error) {
220 res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templateversions/%s/dry-run/%s", version, job), nil)
221 if err != nil {
222 return ProvisionerJob{}, err
223 }
224 defer res.Body.Close()
225 if res.StatusCode != http.StatusOK {
226 return ProvisionerJob{}, ReadBodyAsError(res)
227 }
228
229 var j ProvisionerJob
230 return j, json.NewDecoder(res.Body).Decode(&j)
231}
232
233// TemplateVersionDryRunMatchedProvisioners returns the matched provisioners for a
234// template version dry-run job.

Callers 2

prepWorkspaceBuildFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1