TemplateVersionVariables returns resources a template version variables.
(ctx context.Context, version uuid.UUID)
| 173 | |
| 174 | // TemplateVersionVariables returns resources a template version variables. |
| 175 | func (c *Client) TemplateVersionVariables(ctx context.Context, version uuid.UUID) ([]TemplateVersionVariable, error) { |
| 176 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/templateversions/%s/variables", version), nil) |
| 177 | if err != nil { |
| 178 | return nil, err |
| 179 | } |
| 180 | defer res.Body.Close() |
| 181 | if res.StatusCode != http.StatusOK { |
| 182 | return nil, ReadBodyAsError(res) |
| 183 | } |
| 184 | var variables []TemplateVersionVariable |
| 185 | return variables, json.NewDecoder(res.Body).Decode(&variables) |
| 186 | } |
| 187 | |
| 188 | // TemplateVersionLogsAfter streams logs for a template version that occurred after a specific log ID. |
| 189 | func (c *Client) TemplateVersionLogsAfter(ctx context.Context, version uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error) { |