project
Bases: BaseProject
Source code in airia/client/project/async_project.py
get_project(project_id, correlation_id=None)
async
Retrieve detailed information for a specific project.
This method fetches comprehensive information about a single project, including all associated resources, metadata, and configuration details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project_id
|
str
|
The unique identifier (GUID) of the project to retrieve. |
required |
correlation_id
|
str
|
A unique identifier for request tracing and logging. If not provided, one will be automatically generated. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
ProjectItem |
ProjectItem
|
A ProjectItem object containing complete project information including pipelines, models, data sources, and metadata. |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - Project not found (404) - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
Example
from airia import AiriaAsyncClient
client = AiriaAsyncClient(api_key="your_api_key")
# Get a specific project by ID
project = await client.project.get_project("12345678-1234-1234-1234-123456789abc")
print(f"Project: {project.name}")
print(f"Description: {project.description}")
print(f"Pipelines: {len(project.pipelines)}")
print(f"Created: {project.created_at}")
Note
The project must be accessible to the authenticated user. Users will only be able to retrieve projects they have been granted access to.
Source code in airia/client/project/async_project.py
get_projects(page_number=None, page_size=None, sort_by=None, sort_direction=None, filter=None, correlation_id=None)
async
Retrieve a list of all projects accessible to the authenticated user with optional pagination, sorting, and filtering.
This method fetches comprehensive information about all projects that the current user has access to, including project metadata, creation details, and status information. The results can be paginated, sorted, and filtered.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page_number
|
int
|
The page number to be fetched. |
None
|
page_size
|
int
|
The number of items per page. |
None
|
sort_by
|
str
|
Property to sort by. |
None
|
sort_direction
|
str
|
The direction of the sort, either "ASC" for ascending or "DESC" for descending. |
None
|
filter
|
str
|
The search filter. |
None
|
correlation_id
|
str
|
A unique identifier for request tracing and logging. If not provided, one will be automatically generated. |
None
|
Returns:
| Type | Description |
|---|---|
List[ProjectItem]
|
List[ProjectItem]: A list of ProjectItem objects containing project information. Returns an empty list if no projects are accessible or found. |
Raises:
| Type | Description |
|---|---|
AiriaAPIError
|
If the API request fails, including cases where: - Authentication fails (401) - Access is forbidden (403) - Server errors (5xx) |
Example
from airia import AiriaAsyncClient
client = AiriaAsyncClient(api_key="your_api_key")
# Get all accessible projects
projects = await client.project.get_projects()
for project in projects:
print(f"Project: {project.name}")
print(f"ID: {project.id}")
print(f"Description: {project.description}")
print(f"Created: {project.created_at}")
print("---")
# Get projects with pagination and sorting
projects = await client.project.get_projects(
page_number=1,
page_size=10,
sort_by="name",
sort_direction="ASC",
filter="my-project"
)
Note
The returned projects are filtered based on the authenticated user's permissions. Users will only see projects they have been granted access to.