create /service router

This commit is contained in:
Jörn-Michael Miehe 2022-03-30 21:19:06 +00:00
parent a524c02138
commit 23a806e325
2 changed files with 26 additions and 1 deletions

View file

@ -7,11 +7,12 @@ This file: Main API router definition.
from fastapi import APIRouter
from ..config import Settings
from . import admin, device, user
from . import admin, device, service, user
main_router = APIRouter(prefix=f"/{Settings._.api_v1_prefix}")
main_router.include_router(admin.router)
main_router.include_router(service.router)
main_router.include_router(device.router)
main_router.include_router(user.router)

View file

@ -0,0 +1,24 @@
"""
/service endpoints.
"""
from fastapi import APIRouter, Depends, HTTPException, status
from ..config import Config
from ._common import Responses, get_current_config
router = APIRouter(prefix="/service", tags=["service"])
@router.put(
"/pki/init",
responses={
status.HTTP_200_OK: Responses.OK,
status.HTTP_400_BAD_REQUEST: Responses.NOT_INSTALLED,
status.HTTP_403_FORBIDDEN: Responses.NEEDS_PERMISSION,
},
)
async def init_pki(
_: Config = Depends(get_current_config),
) -> None:
pass