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

Method CreateTemplateVersionDryRun

codersdk/templateversions.go:203–215  ·  view source on GitHub ↗

CreateTemplateVersionDryRun begins a dry-run provisioner job against the given template version with the given parameter values.

(ctx context.Context, version uuid.UUID, req CreateTemplateVersionDryRunRequest)

Source from the content-addressed store, hash-verified

201// CreateTemplateVersionDryRun begins a dry-run provisioner job against the
202// given template version with the given parameter values.
203func (c *Client) CreateTemplateVersionDryRun(ctx context.Context, version uuid.UUID, req CreateTemplateVersionDryRunRequest) (ProvisionerJob, error) {
204 res, err := c.Request(ctx, http.MethodPost, fmt.Sprintf("/api/v2/templateversions/%s/dry-run", version), req)
205 if err != nil {
206 return ProvisionerJob{}, err
207 }
208 defer res.Body.Close()
209 if res.StatusCode != http.StatusCreated {
210 return ProvisionerJob{}, ReadBodyAsError(res)
211 }
212
213 var job ProvisionerJob
214 return job, json.NewDecoder(res.Body).Decode(&job)
215}
216
217// TemplateVersionDryRun returns the current state of a template version dry-run
218// job.

Callers 2

prepWorkspaceBuildFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 1