Skip to content
API Reference

Get a policy set by ID

zones.policy_sets.retrieve(strpolicy_set_id, PolicySetRetrieveParams**kwargs) -> PolicySetWithBinding
GET/zones/{zone_id}/policy-sets/{policy_set_id}

Returns the policy set with current binding information.

ParametersExpand Collapse
zone_id: str
policy_set_id: str
x_api_version: Optional[str]
x_client_request_id: Optional[str]
formatuuid
ReturnsExpand Collapse
class PolicySetWithBinding:
active: Optional[bool]

Whether this policy set is currently bound to a scope

active_version: Optional[int]

Human-readable version number of the active version (e.g., 1, 2, 3)

active_version_id: Optional[str]

Public ID of the currently active (bound) version

mode: Optional[Literal["active", "shadow"]]
Accepts one of the following:
"active"
"shadow"
scope_target_id: Optional[str]

Get a policy set by ID

from keycardai_api import KeycardAPI

client = KeycardAPI()
policy_set_with_binding = client.zones.policy_sets.retrieve(
    policy_set_id="policy_set_id",
    zone_id="zone_id",
)
print(policy_set_with_binding)
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "scope_type": "zone",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by",
  "active": true,
  "active_version": 0,
  "active_version_id": "active_version_id",
  "mode": "active",
  "scope_target_id": "scope_target_id"
}
Returns Examples
{
  "id": "id",
  "created_at": "2019-12-27T18:11:19.117Z",
  "created_by": "created_by",
  "name": "name",
  "owner_type": "platform",
  "scope_type": "zone",
  "updated_at": "2019-12-27T18:11:19.117Z",
  "zone_id": "zone_id",
  "archived_at": "2019-12-27T18:11:19.117Z",
  "latest_version": 0,
  "latest_version_id": "latest_version_id",
  "updated_by": "updated_by",
  "active": true,
  "active_version": 0,
  "active_version_id": "active_version_id",
  "mode": "active",
  "scope_target_id": "scope_target_id"
}