Python SDK - Project Variable
askanna.variable.get
import askanna
variable = askanna.variable.get(variable_suuid="{VARIABLE_SUUID}")
Parameters
Name | Type | Required | Description |
variable_suuid | String | Yes | Variable SUUID you want to retrieve the information from |
Output
Dataclass: Variable
askanna.variable.list
import askanna
variable_list = askanna.variable.list()
Parameters
Name | Type | Required | Description |
project_suuid | String | No | Project SUUID of the project for which you want to get a list of variables |
limit | Integer | No | Limit the number of workspaces in the result. Defaults to 100. |
offset | Integer | No | Offset the number of workspaces in the result. Defaults to 0. |
ordering | String | No | Sets the ordering of the workspace list. Defaults to "-created" |
Output
List with elements with Dataclass: Variable
askanna.variable.create
import askanna
variable = askanna.variable.create(
project_suuid="{PROJECT_SUUID}",
name="{VARIABLE_NAME}",
value="{VARIABLE_VALUE}",
)
Parameters
Name | Type | Required | Description |
project_suuid | String | Yes | Project SUUID in which project you want to create the variable |
name | String | Yes | Name for the new variable |
value | String | Yes | Value you want to save for the variable |
is_masked | Boolean | No | Specify if the value should be handled as masked. Defaults to False. |
Output
Dataclass: Variable
askanna.variable.change
import askanna
variable = askanna.variable.change(variable_suuid="{VARIABLE_SUUID}", name="{NEW_VARIABLE_NAME}")
Parameters
Name | Type | Required | Description |
variable_suuid | String | Yes | The SUUID of the variable you want to change |
name | String | No | The new variable name |
value | String | No | The new variable value |
is_masked | Boolean | No | Specify if the value should be handled as masked. Defaults to False. |
Change is_masked
You can set a unmasked value to masked, but you cannot change a masked value into unmasked
Output
Dataclass: Variable
askanna.variable.delete
import askanna
askanna.variable.delete(variable_suuid="{VARIABLE_SUUID}")
Parameters
Name | Type | Required | Description |
variable_suuid | String | Yes | The SUUID of the variable you want to delete |
Output
Bool: True if the variable is succesfully deleted