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)
| 201 | // CreateTemplateVersionDryRun begins a dry-run provisioner job against the |
| 202 | // given template version with the given parameter values. |
| 203 | func (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. |