Working with Policy Types¶
A policy is a template that encodes the information needed for specifying
the rules that are checked/enforced before/after certain actions are performed
on a cluster. The rules are encoded in a property named spec
.
List Policy Types¶
To examine the known policy types:
def list_policy_types(conn):
print("List Policy Types:")
for pt in conn.clustering.policy_types():
print(pt.to_dict())
Full example: manage policy type
Get Policy Type¶
To retrieve the details about a policy type, you need to provide the name of it.
def get_policy_type(conn):
print("Get Policy Type:")
pt = conn.clustering.get_policy_type('senlin.policy.deletion-1.0')
print(pt.to_dict())
Full example: manage policy type