metadata
V2 metadata API endpoints for v2 format operations.
category_last_updated_route_subpath
module-attribute
category_metadata_route_subpath
module-attribute
LastUpdatedResponse
CategoryLastUpdatedResponse
Bases: BaseModel
Response for /{category}/last_updated endpoint.
Source code in src/horde_model_reference/service/v2/routers/metadata.py
read_v2_last_updated
async
read_v2_last_updated(
manager: Annotated[
ModelReferenceManager,
Depends(get_model_reference_manager),
],
) -> LastUpdatedResponse
Get the last update timestamp for the canonical format.
This endpoint returns the maximum last_updated timestamp across all categories for v2 format operations. Only available when canonical_format='v2'.
Returns:
-
LastUpdatedResponse–LastUpdatedResponse with the maximum timestamp, or None if no metadata exists.
Raises:
-
HTTPException–503 if metadata is not supported or canonical_format != 'v2'.
Source code in src/horde_model_reference/service/v2/routers/metadata.py
read_v2_category_last_updated
async
read_v2_category_last_updated(
model_category_name: MODEL_REFERENCE_CATEGORY,
manager: Annotated[
ModelReferenceManager,
Depends(get_model_reference_manager),
],
) -> CategoryLastUpdatedResponse
Get the last update timestamp for a specific category (v2 format).
Parameters:
-
model_category_name(MODEL_REFERENCE_CATEGORY) –The model reference category to get metadata for.
-
manager(Annotated[ModelReferenceManager, Depends(get_model_reference_manager)]) –The model reference manager dependency.
Returns:
-
CategoryLastUpdatedResponse–CategoryLastUpdatedResponse with the timestamp, or None if no metadata exists.
Raises:
-
HTTPException–503 if metadata is not supported.
-
HTTPException–404 if category has no metadata.
Source code in src/horde_model_reference/service/v2/routers/metadata.py
read_all_v2_metadata
async
read_all_v2_metadata(
manager: Annotated[
ModelReferenceManager,
Depends(get_model_reference_manager),
],
) -> dict[MODEL_REFERENCE_CATEGORY, CategoryMetadata]
Get all v2 format metadata.
Returns a dictionary mapping each category to its v2 format metadata.
Parameters:
-
manager(Annotated[ModelReferenceManager, Depends(get_model_reference_manager)]) –The model reference manager dependency.
Returns:
-
dict[MODEL_REFERENCE_CATEGORY, CategoryMetadata]–Dict of category to CategoryMetadata.
Raises:
-
HTTPException–503 if metadata is not supported.
Source code in src/horde_model_reference/service/v2/routers/metadata.py
read_v2_category_metadata
async
read_v2_category_metadata(
model_category_name: MODEL_REFERENCE_CATEGORY,
manager: Annotated[
ModelReferenceManager,
Depends(get_model_reference_manager),
],
) -> CategoryMetadata
Get v2 format metadata for a specific category.
Parameters:
-
model_category_name(MODEL_REFERENCE_CATEGORY) –The model reference category to get metadata for.
-
manager(Annotated[ModelReferenceManager, Depends(get_model_reference_manager)]) –The model reference manager dependency.
Returns:
-
CategoryMetadata–CategoryMetadata for the category.
Raises:
-
HTTPException–503 if metadata is not supported.
-
HTTPException–404 if category has no metadata.