Secret object
The Secret object comes with two sets of methods: CRUD methods and read/write methods.
CRUD methods
Crud methods are used to interact with the entity object in the backend or locally.
save(): Save or update the entity into the backend.export(): Export the entity locally as yaml file.refresh(): Refresh (read) the entity from the backend.
save
Save or update the entity into the backend.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
update |
bool
|
Flag to indicate update. |
False
|
Returns:
| Type | Description |
|---|---|
ContextEntity
|
Entity saved. |
export
Export object as a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename |
str
|
Name of the export YAML file. If not specified, the default value is used. |
None
|
Returns:
| Type | Description |
|---|---|
None
|
|
refresh
I/O methods
I/O methods are used to handle objects as files.
set_secret_value(): Set (update) the secret valueread_secret_value(): Read the secret value
set_secret_value
Update the secret value with a new one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value |
str
|
Value of the secret. |
required |
Returns:
| Type | Description |
|---|---|
None
|
|
read_secret_value
Read the secret value from backend.
Returns:
| Type | Description |
|---|---|
str
|
Value of the secret. |