Buckets:

download
raw
1.5 kB
from typing import Optional
from fastapi import APIRouter, FastAPI, Request, status
from fastapi.responses import JSONResponse
from src.api.services import GitService
def get_router(app: FastAPI) -> APIRouter:
router = APIRouter()
@router.post(
"/{app_name}/info/",
response_description="Return information about the deployment of an application",
)
async def get_info(
request: Request,
app_name: str,
shared_by: Optional[str] = None,
):
success, result = await GitService.get_deployment_info(
request.state.session_user, app_name, shared_by
)
return JSONResponse(
status_code=status.HTTP_200_OK,
content={
"success": success,
"result": result,
},
)
@router.put(
"/{app_name}/",
response_description="Deploy an application by repository URL",
)
async def deploy_app_by_url(
request: Request,
app_name: str,
repo_url: str,
branch: str = "main",
shared_by: Optional[str] = None,
):
success, result = await GitService.deploy_application_by_url(
request.state.session_user, app_name, repo_url, branch, shared_by
)
return JSONResponse(
status_code=status.HTTP_200_OK,
content={
"success": success,
"result": result,
},
)
return router

Xet Storage Details

Size:
1.5 kB
·
Xet hash:
85c818a613fb0323b6199a3a7e7716e6a4788c6009e62f49b7eb28db9cd663e5

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.