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
decoratorThe
ctx
injected to the function arguments is of typecloudify.context.CloudifyContext
The
ctx
object can also be accessed by importingcloudify.ctx
Example:
from cloudify import ctx @operations def start(**kwargs): pass
-
cloudify.decorators.
workflow
(func=None, **arguments)[source]¶ Decorate workflow functions with this decorator. Internally, if celery is installed, will also wrap the function with a
@celery.task
decoratorThe
ctx
injected to the function arguments is of typecloudify.workflows.workflow_context.CloudifyWorkflowContext
The
ctx
object can also be accessed by importingcloudify.workflows.ctx
Example:
from cloudify.workflows import ctx @workflow def reinstall(**kwargs): pass