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

Method DeleteOrganization

codersdk/organizations.go:321–333  ·  view source on GitHub ↗

DeleteOrganization will remove the corresponding organization from the deployment, based on the UUID/name provided as `orgID`.

(ctx context.Context, orgID string)

Source from the content-addressed store, hash-verified

319// DeleteOrganization will remove the corresponding organization from the deployment, based on
320// the UUID/name provided as `orgID`.
321func (c *Client) DeleteOrganization(ctx context.Context, orgID string) error {
322 res, err := c.Request(ctx, http.MethodDelete, fmt.Sprintf("/api/v2/organizations/%s", orgID), nil)
323 if err != nil {
324 return xerrors.Errorf("execute request: %w", err)
325 }
326 defer res.Body.Close()
327
328 if res.StatusCode != http.StatusOK {
329 return ReadBodyAsError(res)
330 }
331
332 return nil
333}
334
335// ProvisionerDaemons returns provisioner daemons available.
336func (c *Client) ProvisionerDaemons(ctx context.Context) ([]ProvisionerDaemon, error) {

Callers 3

deleteOrganizationMethod · 0.45
TestEnterpriseAuditLogsFunction · 0.45

Calls 4

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

Tested by 2

TestEnterpriseAuditLogsFunction · 0.36