aria.orchestrator.context
¶
Contexts for workflows and operations.
aria.orchestrator.context.common
¶
Common code for contexts.
-
class
aria.orchestrator.context.common.
BaseContext
(name, service_id, model_storage, resource_storage, execution_id, workdir=None, **kwargs)¶ Bases:
object
Base class for contexts.
-
download_resource
(destination, path=None)¶ Download a service template resource from the storage resource API (“RAPI”).
-
download_resource_and_render
(destination, path=None, variables=None)¶ Downloads a service template resource from the resource storage and renders its content as a Jinja template using the provided variables.
ctx
is available to the template without providing it explicitly.
-
get_resource
(path=None)¶ Reads a service instance resource as string from the resource storage.
-
get_resource_and_render
(path=None, variables=None)¶ Reads a service instance resource as string from the resource storage and renders it as a Jinja template using the provided variables.
ctx
is available to the template without providing it explicitly.
-
id
¶ Operation ID.
-
logging_handlers
(*args, **kwds)¶
-
model
¶ Storage model API (“MAPI”).
-
name
¶ Operation name.
-
resource
¶ Storage resource API (“RAPI”).
-
service
¶ Service instance model.
-
service_template
¶ Service template model.
-
aria.orchestrator.context.exceptions
¶
Context exceptions.
-
exception
aria.orchestrator.context.exceptions.
ContextException
¶ Bases:
aria.orchestrator.exceptions.OrchestratorError
Context based exception
aria.orchestrator.context.operation
¶
Operation contexts.
-
class
aria.orchestrator.context.operation.
BaseOperationContext
(task_id, actor_id, **kwargs)¶ Bases:
aria.orchestrator.context.common.BaseContext
Base class for contexts used during operation creation and execution.
-
close
()¶
-
classmethod
instantiate_from_dict
(model_storage=None, resource_storage=None, **kwargs)¶
-
plugin_workdir
¶ A work directory that is unique to the plugin and the service ID.
-
serialization_dict
¶
-
task
¶ The task in the model storage.
-
-
class
aria.orchestrator.context.operation.
NodeOperationContext
(task_id, actor_id, **kwargs)¶ Bases:
aria.orchestrator.context.operation.BaseOperationContext
Context for node operations.
-
node
¶ The node of the current operation.
-
node_template
¶ The node template of the current operation.
-
-
class
aria.orchestrator.context.operation.
RelationshipOperationContext
(task_id, actor_id, **kwargs)¶ Bases:
aria.orchestrator.context.operation.BaseOperationContext
Context for relationship operations.
-
relationship
¶ The relationship instance of the current operation.
-
source_node
¶ The relationship source node.
-
source_node_template
¶ The relationship source node template.
-
target_node
¶ The relationship target node.
-
target_node_template
¶ The relationship target node template.
-
aria.orchestrator.context.toolbelt
¶
Tools for operations.
-
class
aria.orchestrator.context.toolbelt.
NodeToolBelt
(operation_context)¶ Bases:
object
Node operation tool belt.
-
host_ip
¶ The host ip of the current node :return:
-
-
class
aria.orchestrator.context.toolbelt.
RelationshipToolBelt
(operation_context)¶ Bases:
object
Relationship operation tool belt.
-
aria.orchestrator.context.toolbelt.
toolbelt
(operation_context)¶ Get a toolbelt from to the current operation executor.
Parameters: operation_context –
aria.orchestrator.context.workflow
¶
Workflow context.
-
class
aria.orchestrator.context.workflow.
WorkflowContext
(workflow_name, parameters=None, task_max_attempts=1, task_retry_interval=0, task_ignore_failure=False, *args, **kwargs)¶ Bases:
aria.orchestrator.context.common.BaseContext
Context used during workflow creation and execution.
-
execution
¶ Execution model.
-
node_templates
¶ Iterates over nodes templates.
-
nodes
¶ Iterates over nodes.
-
workflow_name
¶
-