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

Method ListProvisionerKeyDaemons

codersdk/provisionerdaemons.go:480–495  ·  view source on GitHub ↗

ListProvisionerKeyDaemons lists all provisioner keys with their associated daemons for an organization.

(ctx context.Context, organizationID uuid.UUID)

Source from the content-addressed store, hash-verified

478
479// ListProvisionerKeyDaemons lists all provisioner keys with their associated daemons for an organization.
480func (c *Client) ListProvisionerKeyDaemons(ctx context.Context, organizationID uuid.UUID) ([]ProvisionerKeyDaemons, error) {
481 res, err := c.Request(ctx, http.MethodGet,
482 fmt.Sprintf("/api/v2/organizations/%s/provisionerkeys/daemons", organizationID.String()),
483 nil,
484 )
485 if err != nil {
486 return nil, xerrors.Errorf("make request: %w", err)
487 }
488 defer res.Body.Close()
489
490 if res.StatusCode != http.StatusOK {
491 return nil, ReadBodyAsError(res)
492 }
493 var resp []ProvisionerKeyDaemons
494 return resp, json.NewDecoder(res.Body).Decode(&resp)
495}
496
497// DeleteProvisionerKey deletes a provisioner key.
498func (c *Client) DeleteProvisionerKey(ctx context.Context, organizationID uuid.UUID, name string) error {

Callers 1

Calls 5

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

Tested by 1