Create or Update Scope

POST {{cb_url}}/containers/v1/orgs/{{cb_org_key}}/guardrails/management/scopes

Use this request to create or update a scope.

Scopes are used to in order to define a list of resources we want to track.

RBAC Permissions Required

Permission (.notation name)Operation(s)
kubernetes.securityCREATE, UPDATE

API Documentation

{
  "scope_id": "<uuid>",
  "scope_name": "<string>",
  "creator": "<email>",
  "created_on": <number>,
  "modified_by": "<string>",
  "modified_on": <number>,
  "is_protected": <boolean>,
  "lifecycle_phase": "<string>",
  "clusters_groups": [
    "<string>"
  ],
  "clusters": [
    "<string>"
  ],
  "namespaces": [
    "<string>"
  ]
}

Request Body

{"scope_id"=>"12a3bc4d-ee56-7f8g-a11b-2345cd67e89e", "name"=>"Updated Demo Scope 01", "lifecycle_phase"=>"build", "clusters"=>["demo:cluster"], "clusters_groups"=>[], "namespaces"=>["*"]}

HEADERS

KeyDatatypeRequiredDescription
X-AUTH-TOKENstring(Required) Carbon Black Access Key
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;id&quot;:&quot;12a3bc4d-ee56-7f8g-a11b-2345cd67e89e&quot;,&quot;scope_id&quot;:&quot;12a3bc4d-ee56-7f8g-a11b-2345cd67e89e&quot;}