PgBeam Docs
Policies

DeletePolicyProfile

Delete a policy profile

Deletes a policy profile. Fails if agent credentials still reference it.

Usage

err := client.Policies.DeletePolicyProfile(ctx, "prj_xxx", "pol_xxx")

Parameters

ParameterTypeRequiredDescription
ctxcontext.ContextYesRequest context
projectIDstringYesUnique project identifier (prefixed, e.g. prj_xxx).
policyIDstringYesUnique policy profile identifier (prefixed, e.g. pol_xxx).

Response

error — returns nil on success.

Example

import pgbeam "go.pgbeam.com/sdk"

client := pgbeam.NewClient(&pgbeam.ClientOptions{
  APIKey: "pgb_your_api_key",
})

err := client.Policies.DeletePolicyProfile(ctx, "prj_xxx", "pol_xxx")
if err != nil {
  log.Fatal(err)
}

Errors

StatusDescription
400Invalid request parameters.
401Missing or invalid authentication.
403Operation not allowed by current plan limits.
404Resource not found.
409Policy profile is still referenced by agent credentials.

On this page