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

Method CancelTemplateVersion

codersdk/templateversions.go:120–130  ·  view source on GitHub ↗

CancelTemplateVersion marks a template version job as canceled.

(ctx context.Context, version uuid.UUID)

Source from the content-addressed store, hash-verified

118
119// CancelTemplateVersion marks a template version job as canceled.
120func (c *Client) CancelTemplateVersion(ctx context.Context, version uuid.UUID) error {
121 res, err := c.Request(ctx, http.MethodPatch, fmt.Sprintf("/api/v2/templateversions/%s/cancel", version), nil)
122 if err != nil {
123 return err
124 }
125 defer res.Body.Close()
126 if res.StatusCode != http.StatusOK {
127 return ReadBodyAsError(res)
128 }
129 return nil
130}
131
132// TemplateVersionParameters returns parameters a template version exposes.
133func (c *Client) TemplateVersionRichParameters(ctx context.Context, version uuid.UUID) ([]TemplateVersionParameter, error) {

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 2