Secret
This class provides an interface for managing secrets, including creation, retrieval, listing, and deletion. It supports two types of secrets: "regular" and "image_pull". The class allows users to interact with secrets by name and provides properties to access secret details like name and type.
Attributes
| Attribute | Type | Description |
|---|---|---|
| pb2 | definition_pb2.Secret | definition_pb2.Secret |
Methods
create()
@classmethod
def create(
name: str,
value: Union[str, bytes],
type: SecretTypes = "regular"
)
Create a new secret.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The name of the secret. |
| value | Union[str, bytes] | The secret value as a string or bytes. |
| type | SecretTypes = "regular" | Type of secret - either "regular" or "image_pull". |
get()
@classmethod
def get(
name: str
) - > [Secret](secret.md?sid=flyte_remote__secret_secret)
Retrieve a secret by name.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The name of the secret to retrieve. |
Returns
| Type | Description |
|---|---|
[Secret](secret.md?sid=flyte_remote__secret_secret) | A Secret object. |
listall()
@classmethod
def listall(
limit: int = 10
) - > AsyncIterator[[Secret](secret.md?sid=flyte_remote__secret_secret)]
List all secrets in the current project and domain.
Parameters
| Name | Type | Description |
|---|---|---|
| limit | int = 10 | Maximum number of secrets to return per page. |
Returns
| Type | Description |
|---|---|
AsyncIterator[[Secret](secret.md?sid=flyte_remote__secret_secret)] | An async iterator of Secret objects. |
delete()
@classmethod
def delete(
name: Any
)
Delete a secret by name.
Parameters
| Name | Type | Description |
|---|---|---|
| name | Any | The name of the secret to delete. |
name()
@classmethod
def name() - > str
Get the name of the secret.
Returns
| Type | Description |
|---|---|
str |
type()
@classmethod
def type() - > str
Get the type of the secret as a string ("regular" or "image_pull").
Returns
| Type | Description |
|---|---|
str |