Variable
- class perses_api.variable.GlobalVariable[source]
Bases:
VariableBaseThe class includes all necessary methods to access the Perses global variables API
- Parameters:
perses_api_model (APIModel) – Inject a Perses API model object that includes all necessary values and information
- class perses_api.variable.ProjectVariable[source]
Bases:
VariableBaseThe class includes all necessary methods to access the Perses project-scoped variables API
- Parameters:
- class perses_api.variable.VariableBase[source]
Bases:
ResourceBaseThe class includes all necessary base methods to access the Perses variables API
- Parameters:
perses_api_model (APIModel) – Inject a Perses API model object that includes all necessary values and information
- create_variable(variable) dict[source]
The method includes a functionality to create a new variable
- Parameters:
variable (Variable | GlobalVariable) – Specify the variable resource to create
- Raises:
Exception – Unspecified error by executing the API call
- Returns:
The created variable dict
- Return type:
- delete_variable(name: str) None[source]
The method includes a functionality to delete a variable by name
- Parameters:
name (str) – Specify the name of the variable to delete
- Raises:
ValueError – Missed specifying a necessary value
- get_variable(name: str) dict[source]
The method includes a functionality to retrieve a single variable by name
- Parameters:
name (str) – Specify the name of the variable to retrieve
- Raises:
ValueError – Missed specifying a necessary value
Exception – Unspecified error by executing the API call
- Returns:
The variable dict
- Return type:
- get_variables(name: str = None) list[source]
The method includes a functionality to retrieve all variables
- update_variable(name: str, variable) dict[source]
The method includes a functionality to update an existing variable by name
- Parameters:
name (str) – Specify the name of the variable to update
variable (Variable | GlobalVariable) – Specify the updated variable resource
- Raises:
ValueError – Missed specifying a necessary value
Exception – Unspecified error by executing the API call
- Returns:
The updated variable dict
- Return type: