Skip to content

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¤

global_variables: GlobalVariables = Field(alias='global', default_factory=GlobalVariables)

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

projects¤

projects: list[ProjectVariables] = Field(default_factory=list)

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, transform or workflow. Empty where the server does not report it.

id¤

id: str

label¤

label: str = ''

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

task_type¤

task_type: str = Field(alias='taskType', default='')

GlobalVariables¤

Bases: Model

The global variables, which are defined in the configuration of DataIntegration.

Attributes:

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

variables¤

variables: list[Variable] = Field(default_factory=list)

ProjectVariables¤

Bases: Model

A project together with its project variables and the variables of its tasks.

Attributes:

errors¤

errors: list[VariableError] = Field(default_factory=list)

id¤

id: str

label¤

label: str = ''

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

tasks¤

tasks: list[TaskVariables] = Field(default_factory=list)

variables¤

variables: list[Variable] = Field(default_factory=list)

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¤

errors: list[VariableError] = Field(default_factory=list)

id¤

id: str

label¤

label: str = ''

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

variables¤

variables: list[Variable] = Field(default_factory=list)

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 with name, and task_id for 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. None for 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, project for a project variable, execution for an execution variable and global for a global variable.

Functions:

  • get_id – Get the combined ID of the variable.

description¤

description: str = ''

get_id¤

get_id()

Get the combined ID of the variable.

Returns:

  • str – project_id:name for a project variable, project_id:task_id:name
  • str – for an execution variable and name for a global variable.

is_sensitive¤

is_sensitive: bool = Field(alias='isSensitive', default=False)

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

name¤

name: str

project_id¤

project_id: str = Field(alias='project', default='')

scope¤

scope: str = 'project'

task_id¤

task_id: str | None = Field(alias='task', default=None)

template¤

template: str = ''

value¤

value: str = ''

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¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

tasks¤

tasks: list[DependentTask] = Field(alias='dependentTasks', default_factory=list)

variables¤

variables: list[str] = Field(alias='dependentVariables', default_factory=list)

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¤

message: str = ''

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

variable_name¤

variable_name: str = Field(alias='variableName')

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.

default¤

default: Variable | None = None

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

name¤

name: str

referenced_by¤

referenced_by: list[DependentTask] = Field(alias='referencedBy', default_factory=list)

required¤

required: bool = False

set_by¤

set_by: list[DependentTask] = Field(alias='setBy', default_factory=list)

Comments