Skip to content

Commit 294233e

Browse files
committed
core: services: kraken: api: Add version fetch
* Allow fetch versions available for a given extension from a given manifest or consolidated using manifest API
1 parent 9282b6f commit 294233e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

core/services/kraken/api/v2/routers/manifest.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,30 @@ async def fetch_consolidated() -> list[RepositoryEntry]:
7676
return await manifest_manager.fetch_consolidated()
7777

7878

79+
@manifest_router_v2.get("/tags/{manifest_identifier}/{extension_identifier}/", status_code=status.HTTP_200_OK)
80+
@manifest_to_http_exception
81+
async def fetch_ext_tags_by_identifier(
82+
manifest_identifier: str, extension_identifier: str, stable: bool = False
83+
) -> list[str]:
84+
"""
85+
Get all tags for a given extension identifier using one manifest as source.
86+
"""
87+
versions = await manifest_manager.fetch_extension_versions(extension_identifier, stable, manifest_identifier)
88+
89+
return [str(version) for version in versions]
90+
91+
92+
@manifest_router_v2.get("/tags/{extension_identifier}", status_code=status.HTTP_200_OK)
93+
@manifest_to_http_exception
94+
async def fetch_ext_tags_by_consolidated(extension_identifier: str, stable: bool = False) -> list[str]:
95+
"""
96+
Get all tags for a given extension identifier using consolidated manifest as source.
97+
"""
98+
versions = await manifest_manager.fetch_extension_versions(extension_identifier, stable)
99+
100+
return [str(version) for version in versions]
101+
102+
79103
@manifest_router_v2.post("/", status_code=status.HTTP_201_CREATED)
80104
@manifest_to_http_exception
81105
async def create(body: ManifestSource, validate_url: bool = True) -> Manifest:

0 commit comments

Comments
 (0)