from orionclient.session import APISession
from orionclient.types import WorkFloeSpec

# Find a WorkFloe spec with the specified title that is ready (as opposed to deprecated)
# Note: the title match will be an inexact match
filters = {"title": "Classic Omega", "state": "ready"}
for workfloe in APISession.list_resources(WorkFloeSpec, filters=filters):
    print(workfloe)

# There could be many that match this filter, so more work should be done to ensure
# the correct WorkFloe specification was found. For example, if the WorkFloe specification
# has a UUID, then it can be used

# Refresh to get the full specification
APISession.refresh_resource(workfloe)
print(workfloe)
