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

Method DeleteProvisionerKey

codersdk/provisionerdaemons.go:498–512  ·  view source on GitHub ↗

DeleteProvisionerKey deletes a provisioner key.

(ctx context.Context, organizationID uuid.UUID, name string)

Source from the content-addressed store, hash-verified

496
497// DeleteProvisionerKey deletes a provisioner key.
498func (c *Client) DeleteProvisionerKey(ctx context.Context, organizationID uuid.UUID, name string) error {
499 res, err := c.Request(ctx, http.MethodDelete,
500 fmt.Sprintf("/api/v2/organizations/%s/provisionerkeys/%s", organizationID.String(), name),
501 nil,
502 )
503 if err != nil {
504 return xerrors.Errorf("make request: %w", err)
505 }
506 defer res.Body.Close()
507
508 if res.StatusCode != http.StatusNoContent {
509 return ReadBodyAsError(res)
510 }
511 return nil
512}
513
514func ConvertWorkspaceStatus(jobStatus ProvisionerJobStatus, transition WorkspaceTransition) WorkspaceStatus {
515 switch jobStatus {

Callers

nothing calls this directly

Calls 5

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
StringMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected