Project
A class representing a project in the Union API.
Attributes
| Attribute | Type | Description |
|---|---|---|
| pb2 | project_service_pb2.Project | The underlying protobuf message object containing the raw project data and metadata. |
Constructor
Signature
def Project(
pb2: project_service_pb2.Project
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| pb2 | project_service_pb2.Project | The protocol buffer object containing project data. |
Methods
get()
@classmethod
def get(
name: str
) - > [Project](project.md?sid=flyte_remote__project_project)
Get a project by name.
Parameters
| Name | Type | Description |
|---|---|---|
| name | str | The unique name or identifier of the project to retrieve. |
Returns
| Type | Description |
|---|---|
[Project](project.md?sid=flyte_remote__project_project) | The Project instance matching the provided name. |
create()
@classmethod
def create(
id: str,
name: str,
description: str = "",
labels: Dict[str, str]| None = null
) - > [Project](project.md?sid=flyte_remote__project_project)
Create a new project.
Parameters
| Name | Type | Description |
|---|---|---|
| id | str | The unique identifier for the project. |
| name | str | The display name for the project. |
| description | str = "" | A description for the project. |
| labels | `Dict[str, str] | None` = null |
Returns
| Type | Description |
|---|---|
[Project](project.md?sid=flyte_remote__project_project) | The newly created Project instance. |
update()
@classmethod
def update(
id: str,
name: str | None = null,
description: str | None = null,
labels: Dict[str, str]| None = null,
state: Literal["archived", "active"]| None = null
) - > [Project](project.md?sid=flyte_remote__project_project)
Update an existing project.
Parameters
| Name | Type | Description |
|---|---|---|
| id | str | The id of the project to update. |
| name | `str | None` = null |
| description | `str | None` = null |
| labels | `Dict[str, str] | None` = null |
| state | `Literal["archived", "active"] | None` = null |
Returns
| Type | Description |
|---|---|
[Project](project.md?sid=flyte_remote__project_project) | The updated Project instance reflecting the changes. |
archive()
@classmethod
def archive() - > [Project](project.md?sid=flyte_remote__project_project)
Archive this project.
Returns
| Type | Description |
|---|---|
[Project](project.md?sid=flyte_remote__project_project) | The Project instance with its state updated to archived. |
unarchive()
@classmethod
def unarchive() - > [Project](project.md?sid=flyte_remote__project_project)
Unarchive (activate) this project.
Returns
| Type | Description |
|---|---|
[Project](project.md?sid=flyte_remote__project_project) | The Project instance with its state updated to active. |
listall()
@classmethod
def listall(
filters: str | None = null,
sort_by: Tuple[str, Literal["asc", "desc"]]| None = null,
archived: bool = false
) - > Union[AsyncIterator[[Project](project.md?sid=flyte_remote__project_project)], Iterator[[Project](project.md?sid=flyte_remote__project_project)]]
List all projects. By default, lists active (unarchived) projects. Set archived=True to list archived projects instead.
Parameters
| Name | Type | Description |
|---|---|---|
| filters | `str | None` = null |
| sort_by | `Tuple[str, Literal["asc", "desc"]] | None` = null |
| archived | bool = false | If True, list archived projects. If False (default), list active projects. |
Returns
| Type | Description |
|---|---|
Union[AsyncIterator[[Project](project.md?sid=flyte_remote__project_project)], Iterator[[Project](project.md?sid=flyte_remote__project_project)]] | An iterator of projects. |