Create a new immutable policy set version
Create a new immutable policy set version
zones.policy_sets.versions.create(strpolicy_set_id, VersionCreateParams**kwargs) -> PolicySetVersion
POST/zones/{zone_id}/policy-sets/{policy_set_id}/versions
Validates the manifest, computes SHA, and creates an immutable version snapshot.
Parameters
zone_id: str
policy_set_id: str
schema_version: str
Schema version to pin to this policy set version.
x_api_version: Optional[str]
x_client_request_id: Optional[str]
formatuuid
Returns
Create a new immutable policy set version
from keycardai_api import KeycardAPI
client = KeycardAPI()
policy_set_version = client.zones.policy_sets.versions.create(
policy_set_id="policy_set_id",
zone_id="zone_id",
manifest={
"entries": [{
"policy_id": "policy_id",
"policy_version_id": "policy_version_id",
}]
},
schema_version="schema_version",
)
print(policy_set_version.id){
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "created_by",
"manifest": {
"entries": [
{
"policy_id": "policy_id",
"policy_version_id": "policy_version_id",
"sha": "sha"
}
]
},
"manifest_sha": "manifest_sha",
"owner_type": "platform",
"policy_set_id": "policy_set_id",
"schema_version": "schema_version",
"version": 0,
"active": true,
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by": "archived_by",
"attestation": {
"attested_at": "2019-12-27T18:11:19.117Z",
"attested_by": "attested_by",
"key_id": "key_id",
"manifest_sha": "manifest_sha",
"policy_set_id": "policy_set_id",
"policy_set_version": 0,
"status": "created",
"type": "policy_set_attestation",
"v": 1,
"zone_id": "zone_id"
}
}Returns Examples
{
"id": "id",
"created_at": "2019-12-27T18:11:19.117Z",
"created_by": "created_by",
"manifest": {
"entries": [
{
"policy_id": "policy_id",
"policy_version_id": "policy_version_id",
"sha": "sha"
}
]
},
"manifest_sha": "manifest_sha",
"owner_type": "platform",
"policy_set_id": "policy_set_id",
"schema_version": "schema_version",
"version": 0,
"active": true,
"archived_at": "2019-12-27T18:11:19.117Z",
"archived_by": "archived_by",
"attestation": {
"attested_at": "2019-12-27T18:11:19.117Z",
"attested_by": "attested_by",
"key_id": "key_id",
"manifest_sha": "manifest_sha",
"policy_set_id": "policy_set_id",
"policy_set_version": 0,
"status": "created",
"type": "policy_set_attestation",
"v": 1,
"zone_id": "zone_id"
}
}