create /service router
This commit is contained in:
parent
a524c02138
commit
23a806e325
2 changed files with 26 additions and 1 deletions
|
@ -7,11 +7,12 @@ This file: Main API router definition.
|
||||||
from fastapi import APIRouter
|
from fastapi import APIRouter
|
||||||
|
|
||||||
from ..config import Settings
|
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 = APIRouter(prefix=f"/{Settings._.api_v1_prefix}")
|
||||||
|
|
||||||
main_router.include_router(admin.router)
|
main_router.include_router(admin.router)
|
||||||
|
main_router.include_router(service.router)
|
||||||
main_router.include_router(device.router)
|
main_router.include_router(device.router)
|
||||||
main_router.include_router(user.router)
|
main_router.include_router(user.router)
|
||||||
|
|
||||||
|
|
24
api/kiwi_vpn_api/routers/service.py
Normal file
24
api/kiwi_vpn_api/routers/service.py
Normal 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
|
Loading…
Reference in a new issue