Environment
Package: flyteplugins.union.remote
One environment version with its full spec, scaling and per-cluster status snapshots.
Parameters
class Environment(
pb2: GetEnvironmentResponse,
)| Parameter | Type | Description |
|---|---|---|
pb2 |
GetEnvironmentResponse |
Properties
| Property | Type | Description |
|---|---|---|
actions |
list[tuple[str, EnvironmentAction]] |
Every reported pending/assigned action as (cluster, action). |
cluster_statuses |
list[EnvironmentClusterStatus] |
|
id |
EnvironmentId |
|
name |
str |
|
recent_worker_errors |
list[tuple[str, WorkerError]] |
|
scaling |
None |
|
spec |
None |
|
state |
str |
|
version |
str |
|
workers |
list[tuple[str, Worker]] |
Every reported worker as (cluster, worker). |
Methods
| Method | Description |
|---|---|
get() |
Get one environment version with its full per-cluster status. |
listall() |
List environment versions in a project/domain, most recently active version first per name. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
get()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Environment.get.aio().
def get(
cls,
name: str,
version: str | None = None,
project: str | None = None,
domain: str | None = None,
) -> EnvironmentGet one environment version with its full per-cluster status.
| Parameter | Type | Description |
|---|---|---|
cls |
||
name |
str |
Environment name. |
version |
str | None |
Version to get. Defaults to the name’s most recently active version. |
project |
str | None |
Project of the environment. Defaults to the configured project. |
domain |
str | None |
Domain of the environment. Defaults to the configured domain. |
Raises
| Exception | Description |
|---|---|
ValueError |
No version is given and no environment with this name exists. |
listall()
Default invocation is sync and will block.
To call it asynchronously, use the function .aio() on the method name itself, e.g.,:
result = await Environment.listall.aio().
def listall(
cls,
project: str | None = None,
domain: str | None = None,
name: str | None = None,
limit: int = 100,
) -> AsyncIterator[EnvironmentVersion]List environment versions in a project/domain, most recently active version first per name.
| Parameter | Type | Description |
|---|---|---|
cls |
||
project |
str | None |
Project to list. Defaults to the configured project. |
domain |
str | None |
Domain to list. Defaults to the configured domain. |
name |
str | None |
Only yield versions of this environment name. The server has no name filter, so this pages through every environment client-side. |
limit |
int |
Maximum number of versions to yield. |
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.