2.0.0b53

Secret

Package: flyte.remote

class Secret(
    pb2: definition_pb2.Secret,
)
Parameter Type Description
pb2 definition_pb2.Secret

Properties

Property Type Description
name None Get the name of the secret.
type None Get the type of the secret as a string (“regular” or “image_pull”).

Methods

Method Description
create() Create a new secret.
delete() Delete a secret by name.
get() Retrieve a secret by name.
listall() List all secrets in the current project and domain.
to_dict() Convert the object to a JSON-serializable dictionary.
to_json() Convert the object to a JSON string.

create()

This method can be called both synchronously or asynchronously.

Default invocation is sync and will block. To call it asynchronously, use the function .aio() on the method name itself, e.g.,: result = await Secret.create.aio().

def create(
    cls,
    name: str,
    value: Union[str, bytes],
    type: SecretTypes,
)

Create a new secret.

Parameter Type Description
cls
name str The name of the secret.
value Union[str, bytes] The secret value as a string or bytes.
type SecretTypes Type of secret - either “regular” or “image_pull”.

delete()

This method can be called both synchronously or asynchronously.

Default invocation is sync and will block. To call it asynchronously, use the function .aio() on the method name itself, e.g.,: result = await Secret.delete.aio().

def delete(
    cls,
    name,
)

Delete a secret by name.

Parameter Type Description
cls
name The name of the secret to delete.

get()

This method can be called both synchronously or asynchronously.

Default invocation is sync and will block. To call it asynchronously, use the function .aio() on the method name itself, e.g.,: result = await Secret.get.aio().

def get(
    cls,
    name: str,
) -> Secret

Retrieve a secret by name.

Parameter Type Description
cls
name str The name of the secret to retrieve. :return: A Secret object.

listall()

This method can be called both synchronously or asynchronously.

Default invocation is sync and will block. To call it asynchronously, use the function .aio() on the method name itself, e.g.,: result = await Secret.listall.aio().

def listall(
    cls,
    limit: int,
) -> AsyncIterator[Secret]

List all secrets in the current project and domain.

Parameter Type Description
cls
limit int Maximum number of secrets to return per page. :return: An async iterator of Secret objects.

to_dict()

def to_dict()

Convert the object to a JSON-serializable dictionary.

Returns: dict: A dictionary representation of the object.

to_json()

def to_json()

Convert the object to a JSON string.

Returns: str: A JSON string representation of the object.