ListProvisionerKeyDaemons lists all provisioner keys with their associated daemons for an organization.
(ctx context.Context, organizationID uuid.UUID)
| 478 | |
| 479 | // ListProvisionerKeyDaemons lists all provisioner keys with their associated daemons for an organization. |
| 480 | func (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. |
| 498 | func (c *Client) DeleteProvisionerKey(ctx context.Context, organizationID uuid.UUID, name string) error { |