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

Method TemplateVersionVariables

codersdk/templateversions.go:175–186  ·  view source on GitHub ↗

TemplateVersionVariables returns resources a template version variables.

(ctx context.Context, version uuid.UUID)

Source from the content-addressed store, hash-verified

173
174// TemplateVersionVariables returns resources a template version variables.
175func (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.
189func (c *Client) TemplateVersionLogsAfter(ctx context.Context, version uuid.UUID, after int64) (<-chan ProvisionerJobLog, io.Closer, error) {

Callers 3

TestTemplatePushFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 2

TestTemplatePushFunction · 0.64