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

Method UpdateActiveTemplateVersion

codersdk/templates.go:417–427  ·  view source on GitHub ↗

UpdateActiveTemplateVersion updates the active template version to the ID provided. The template version must be attached to the template.

(ctx context.Context, template uuid.UUID, req UpdateActiveTemplateVersion)

Source from the content-addressed store, hash-verified

415// UpdateActiveTemplateVersion updates the active template version to the ID provided.
416// The template version must be attached to the template.
417func (c *Client) UpdateActiveTemplateVersion(ctx context.Context, template uuid.UUID, req UpdateActiveTemplateVersion) error {
418 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templates/%s/versions", template), req)
419 if err != nil {
420 return nil
421 }
422 defer res.Body.Close()
423 if res.StatusCode != http.StatusOK {
424 return ReadBodyAsError(res)
425 }
426 return nil
427}
428
429// TemplateVersionsByTemplateRequest defines the request parameters for
430// TemplateVersionsByTemplate.

Callers 15

TestWorkspaceWatcherFunction · 0.80
DynamicParameterTemplateFunction · 0.80
toolsdk.goFile · 0.80
TestUpdateFunction · 0.80
TestTemplatePresetsFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 13

TestWorkspaceWatcherFunction · 0.64
TestUpdateFunction · 0.64
TestTemplatePresetsFunction · 0.64
TestSSHFunction · 0.64
TestWorkspaceAutobuildFunction · 0.64
workspaceTagsTerraformFunction · 0.64