Decorators

cloudify.decorators.operation(func=None, **arguments)[source]

Decorate plugin operation function with this decorator. Internally, if celery is installed, will also wrap the function with a @celery.task decorator

The ctx injected to the function arguments is of type cloudify.context.CloudifyContext

The ctx object can also be accessed by importing cloudify.ctx

Example:

from cloudify import ctx

@operations
def start(**kwargs):
    pass
cloudify.decorators.workflow(func=None, system_wide=False, **arguments)[source]

Decorate workflow functions with this decorator. Internally, if celery is installed, @workflow will also wrap the function with a @celery.task decorator

The ctx injected to the function arguments is of type cloudify.workflows.workflow_context.CloudifyWorkflowContext or cloudify.workflows.workflow_context.CloudifySystemWideWorkflowContext if system_wide flag is set to True.

The ctx object can also be accessed by importing cloudify.workflows.ctx

system_wide flag turns this workflow into a system-wide workflow that is executed by the management worker and has access to an instance of cloudify.workflows.workflow_context.CloudifySystemWideWorkflowContext as its context.

Example:

from cloudify.workflows import ctx

@workflow
def reinstall(**kwargs):
    pass
exception cloudify.decorators.RequestSystemExit[source]

Bases: exceptions.SystemExit