Stats and error handling
This commit is contained in:
@ -18,7 +18,7 @@ from sshecret_admin.services.models import (
|
||||
)
|
||||
|
||||
from sshecret.backend.identifiers import ClientIdParam, FlexID, KeySpec
|
||||
from sshecret.backend.models import ClientQueryResult, ClientReference, FilterType
|
||||
from sshecret.backend.models import ClientQueryResult, ClientReference, FilterType, SystemStats
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -210,4 +210,11 @@ def create_router(dependencies: AdminDependencies) -> APIRouter:
|
||||
"""Add secret to a client."""
|
||||
await admin.create_client_secret(_id(id), secret_name)
|
||||
|
||||
@app.get("/stats")
|
||||
async def get_system_stats(
|
||||
admin: Annotated[AdminBackend, Depends(dependencies.get_admin_backend)],
|
||||
) -> SystemStats:
|
||||
"""Get system stats."""
|
||||
return await admin.get_system_stats()
|
||||
|
||||
return app
|
||||
|
||||
Reference in New Issue
Block a user