Create a new immutable policy version
Create a new immutable policy version
zones.policies.versions.create(strpolicy_id, VersionCreateParams**kwargs) -> PolicyVersion
POST/zones/{zone_id}/policies/{policy_id}/versions
Create a new immutable policy version
Parameters
zone_id: str
policy_id: str
schema_version: str
Schema version to validate this policy against. Must not be archived.
cedar_json: Optional[object]
Cedar policy in JSON representation. Mutually exclusive with cedar_raw.
cedar_raw: Optional[str]
Cedar policy in human-readable Cedar syntax. Mutually exclusive with cedar_json.
x_api_version: Optional[str]
x_client_request_id: Optional[str]
formatuuid
Returns
Create a new immutable policy version
from keycardai_api import KeycardAPI
client = KeycardAPI()
policy_version = client.zones.policies.versions.create(
policy_id="policy_id",
zone_id="zone_id",
schema_version="schema_version",
)
print(policy_version.id){
"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"
}Returns Examples
{
"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"
}