|
5 | 5 | LatestServiceGet, |
6 | 6 | ServiceGetV2, |
7 | 7 | ServiceListFilters, |
| 8 | + ServiceSummary, |
8 | 9 | ) |
9 | 10 | from models_library.api_schemas_catalog.services_ports import ServicePortGet |
10 | 11 | from models_library.products import ProductName |
@@ -89,6 +90,41 @@ async def list_release_history_latest_first( |
89 | 90 | ) |
90 | 91 | return page.data, meta |
91 | 92 |
|
| 93 | + async def list_all_services_summaries( |
| 94 | + self, |
| 95 | + *, |
| 96 | + pagination_offset: PageOffsetInt = 0, |
| 97 | + pagination_limit: PageLimitInt = DEFAULT_NUMBER_OF_ITEMS_PER_PAGE, |
| 98 | + filters: ServiceListFilters | None = None, |
| 99 | + ) -> tuple[list[ServiceSummary], PageMetaInfoLimitOffset]: |
| 100 | + """Lists all services with pagination, including all versions of each service. |
| 101 | +
|
| 102 | + Returns a lightweight summary view of services for better performance. |
| 103 | +
|
| 104 | + Args: |
| 105 | + pagination_offset: Number of items to skip |
| 106 | + pagination_limit: Maximum number of items to return |
| 107 | + filters: Optional filters to apply |
| 108 | +
|
| 109 | + Returns: |
| 110 | + Tuple containing list of service summaries and pagination metadata |
| 111 | + """ |
| 112 | + page = await catalog_rpc.list_all_services_summaries_paginated( |
| 113 | + self._rpc_client, |
| 114 | + product_name=self.product_name, |
| 115 | + user_id=self.user_id, |
| 116 | + offset=pagination_offset, |
| 117 | + limit=pagination_limit, |
| 118 | + filters=filters, |
| 119 | + ) |
| 120 | + meta = PageMetaInfoLimitOffset( |
| 121 | + limit=page.meta.limit, |
| 122 | + offset=page.meta.offset, |
| 123 | + total=page.meta.total, |
| 124 | + count=page.meta.count, |
| 125 | + ) |
| 126 | + return page.data, meta |
| 127 | + |
92 | 128 | @_exception_mapper( |
93 | 129 | rpc_exception_map={ |
94 | 130 | CatalogItemNotFoundError: ProgramOrSolverOrStudyNotFoundError, |
|
0 commit comments