2.0.0b35

App

Package: flyte.remote

A mixin class that provides a method to convert an object to a JSON-serializable dictionary.

class App(
    pb2: app_definition_pb2.App,
)
Parameter Type Description
pb2 app_definition_pb2.App

Methods

Method Description
activate() Start the app.
create()
deactivate() Stop the app.
get() Get an app by name.
is_active()
is_deactivated()
listall()
replace() Replace an existing app’s that matches the given name, with a new spec and optionally labels.
to_dict() Convert the object to a JSON-serializable dictionary.
to_json() Convert the object to a JSON string.
update()
watch() Watch for the app to reach activated or deactivated state.

activate()

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 <App instance>.activate.aio().

def activate(
    wait: bool,
) -> App

Start the app

Parameter Type Description
wait bool Wait for the app to reach started state

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 App.create.aio().

def create(
    cls,
    app: app_definition_pb2.App,
) -> App
Parameter Type Description
cls
app app_definition_pb2.App

deactivate()

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 <App instance>.deactivate.aio().

def deactivate(
    wait: bool,
)

Stop the app

Parameter Type Description
wait bool Wait for the app to reach the deactivated state

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 App.get.aio().

def get(
    cls,
    name: str,
    project: str | None,
    domain: str | None,
) -> App

Get an app by name.

Parameter Type Description
cls
name str The name of the app.
project str | None The project of the app.
domain str | None The domain of the app. :return: The app remote object.

is_active()

def is_active()

is_deactivated()

def is_deactivated()

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 App.listall.aio().

def listall(
    cls,
    created_by_subject: str | None,
    sort_by: Tuple[str, Literal['asc', 'desc']] | None,
    limit: int,
) -> AsyncIterator[App]
Parameter Type Description
cls
created_by_subject str | None
sort_by Tuple[str, Literal['asc', 'desc']] | None
limit int

replace()

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 App.replace.aio().

def replace(
    cls,
    name: str,
    updated_app_spec: app_definition_pb2.Spec,
    reason: str,
    labels: Mapping[str, str] | None,
    project: str | None,
    domain: str | None,
) -> App

Replace an existing app’s that matches the given name, with a new spec and optionally labels.

Parameter Type Description
cls
name str Name of the new app
updated_app_spec app_definition_pb2.Spec Updated app spec
reason str
labels Mapping[str, str] | None Optional labels for the new app
project str | None Optional project for the new app
domain str | None Optional domain for the new app :return: A new app

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.

update()

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 App.update.aio().

def update(
    cls,
    updated_app_proto: app_definition_pb2.App,
    reason: str,
) -> App
Parameter Type Description
cls
updated_app_proto app_definition_pb2.App
reason str

watch()

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 <App instance>.watch.aio().

def watch(
    wait_for: WaitFor,
) -> App

Watch for the app to reach activated or deactivated state.

Parameter Type Description
wait_for WaitFor [“activated”, “deactivated”] Returns: The app in the desired state. Raises: RuntimeError if the app did not reach desired state and failed!

Properties

Property Type Description
deployment_status None Get the deployment status of the app Returns:
desired_state None
endpoint None
name None
revision None
url None