Working with Policy Types

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.cluster.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.cluster.get_policy_type('senlin.policy.deletion-1.0')

    print(pt.to_dict())

Full example: manage policy type

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.