List versions of a policy
List versions of a policy
zones.policies.versions.list(strpolicy_id, VersionListParams**kwargs) -> VersionListResponse
GET/zones/{zone_id}/policies/{policy_id}/versions
List versions of a policy
Parameters
zone_id: str
policy_id: str
after: Optional[str]
Cursor for forward pagination. Returned in Pagination.after_cursor. Mutually exclusive with before.
minLength1
maxLength255
before: Optional[str]
Cursor for backward pagination. Returned in Pagination.before_cursor. Mutually exclusive with after.
minLength1
maxLength255
expand: Optional[List[Literal["total_count"]]]
Opt-in to additional response fields. Repeatable; matches the expand[] convention used across the Keycard API.
limit: Optional[int]
Maximum number of items to return per page.
minimum1
maximum100
sort: Optional[Literal["created_at"]]
Field to sort by.
x_api_version: Optional[str]
x_client_request_id: Optional[str]
formatuuid
Returns
List versions of a policy
from keycardai_api import KeycardAPI
client = KeycardAPI()
versions = client.zones.policies.versions.list(
policy_id="policy_id",
zone_id="zone_id",
)
print(versions.items){
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "created_by",
"owner_type": "platform",
"policy_id": "policy_id",
"schema_version": "schema_version",
"sha": "sha",
"version": 0,
"zone_id": "zone_id",
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by": "archived_by",
"cedar_json": {},
"cedar_raw": "cedar_raw"
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}Returns Examples
{
"items": [
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "created_by",
"owner_type": "platform",
"policy_id": "policy_id",
"schema_version": "schema_version",
"sha": "sha",
"version": 0,
"zone_id": "zone_id",
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by": "archived_by",
"cedar_json": {},
"cedar_raw": "cedar_raw"
}
],
"pagination": {
"after_cursor": "x",
"before_cursor": "x",
"total_count": 0
}
}