cmem_client.models.variable¤
eccenca Corporate Memory variable models for data integration.
This module defines models for representing the variables of Corporate Memory DataIntegration projects. Variables can hold static values or Jinja2 template strings that reference other variables, and are used to parameterize datasets and tasks.
A project variable belongs to a project. An execution variable is declared on a single task of a project, e.g. a workflow or a dataset. A global variable is defined in the configuration of DataIntegration, so it belongs to no project and is read-only.
Classes:
- AllVariablesResponse – The response of the endpoint which lists the global variables and those of all projects.
- DependentTask – A task which uses a variable, e.g. in a parameter template or an execution variable.
- GlobalVariables – The global variables, which are defined in the configuration of DataIntegration.
- ProjectVariables – A project together with its project variables and the variables of its tasks.
- TaskVariables – A task of a project together with its execution variables.
- Variable – A project, execution or global variable in Corporate Memory DataIntegration.
- VariableDependents – What still uses a variable, so that it cannot be deleted.
- VariableError – An error the server reports for a single variable, e.g. a template it can not resolve.
- WorkflowExecutionVariable – An execution variable a workflow run needs.
AllVariablesResponse¤
Bases: Model
The response of the endpoint which lists the global variables and those of all projects.
The variables in it carry neither their project nor their task ID, these are given by the project and task they are listed under.
Attributes:
- global_variables (
GlobalVariables) – The global variables. - projects (
list[ProjectVariables]) – The projects the user has access to, with their variables.
global_variables¤
model_config¤
projects¤
DependentTask¤
Bases: Model
A task which uses a variable, e.g. in a parameter template or an execution variable.
Attributes:
- id (
str) – ID of the task. - label (
str) – Label of the task. - task_type (
str) – Type of the task, e.g.dataset,transformorworkflow. Empty where the server does not report it.
id¤
label¤
model_config¤
task_type¤
GlobalVariables¤
Bases: Model
The global variables, which are defined in the configuration of DataIntegration.
Attributes:
model_config¤
variables¤
ProjectVariables¤
Bases: Model
A project together with its project variables and the variables of its tasks.
Attributes:
- id (
str) – ID of the project. - label (
str) – Label of the project. - variables (
list[Variable]) – The project variables. - errors (
list[VariableError]) – Errors of single project variables. - tasks (
list[TaskVariables]) – All tasks of the project, including tasks without execution variables.
errors¤
id¤
label¤
model_config¤
tasks¤
variables¤
TaskVariables¤
Bases: Model
A task of a project together with its execution variables.
Attributes:
- id (
str) – ID of the task. - label (
str) – Label of the task. - variables (
list[Variable]) – The execution variables declared on the task. - errors (
list[VariableError]) – Errors of single execution variables of the task.
errors¤
id¤
label¤
model_config¤
variables¤
Variable¤
Bases: ReadRepositoryItem
A project, execution or global variable in Corporate Memory DataIntegration.
Attributes:
- name (
str) – Name of the variable, unique within its project or task. This is what a template refers to. - project_id (
str) – ID of the project the variable belongs to. Together withname, andtask_idfor an execution variable, it forms the key of the repository. Empty for a global variable. - task_id (
str | None) – ID of the task an execution variable is declared on.Nonefor a project variable. - value (
str) – Resolved value of the variable. For a templated variable this is the rendered result, so it is read-only. Empty where the server masks the value, which it does for sensitive variables when listing all variables. - template (
str) – Jinja2 template the value is rendered from. Empty for a variable which holds a static value. - description (
str) – Description of the variable as maintained in the project. - is_sensitive (
bool) – Whether the value is treated as a secret. Sensitive values are masked by the user interface. - scope (
str) – Scope the variable is defined in,projectfor a project variable,executionfor an execution variable andglobalfor a global variable.
Functions:
- get_id – Get the combined ID of the variable.
description¤
get_id¤
Get the combined ID of the variable.
Returns:
str–project_id:namefor a project variable,project_id:task_id:namestr– for an execution variable andnamefor a global variable.
is_sensitive¤
model_config¤
name¤
project_id¤
scope¤
task_id¤
template¤
value¤
VariableDependents¤
Bases: Model
What still uses a variable, so that it cannot be deleted.
Attributes:
- variables (
list[str]) – Names of the variables in the same scope whose templates use the variable: project variables for a project variable, execution variables of the same task for an execution variable. - tasks (
list[DependentTask]) – Tasks which use the variable.
model_config¤
tasks¤
variables¤
VariableError¤
Bases: Model
An error the server reports for a single variable, e.g. a template it can not resolve.
Attributes:
- variable_name (
str) – Name of the variable the error belongs to. - message (
str) – The error message.
message¤
model_config¤
variable_name¤
WorkflowExecutionVariable¤
Bases: Model
An execution variable a workflow run needs.
Attributes:
- name (
str) – Name of the variable, referenced as{{execution.<name>}}. - required (
bool) – Whether the variable has to be provided when the run is started, because it is used at execution time but neither defined on the workflow nor set by a preceding node. - default (
Variable | None) – The default defined on the workflow, if any. Only the defaults of the executed workflow apply to a run, defaults of sub-tasks do not. The value of a sensitive default is omitted by the server. - referenced_by (
list[DependentTask]) – Tasks which use the variable at execution time. - set_by (
list[DependentTask]) – Tasks which set the variable during the run.