TemplateVersionDryRun returns the current state of a template version dry-run job.
(ctx context.Context, version, job uuid.UUID)
| 217 | // TemplateVersionDryRun returns the current state of a template version dry-run |
| 218 | // job. |
| 219 | func (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. |