-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (29 loc) · 1.17 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from fastapi import FastAPI
from app.api import router as api_router
from app.pydantic_models import Health
APPNAME = 'reference-driver'
VERSION = '0.0.0'
fastapi = FastAPI(
description="""This is a **reference** implementation of a custom *Driver* for Humanitec.
It operates similarly to the Built-in AWS driver, deploying new S3 buckets on-demand.
test-2
To test it out, you'll need to deploy it as a public facing webserver, and then register it via the Humanitec API.
To learn more about registering drivers checkout the [documentation](https://docs.humanitec.com/integrations/create-own-resource-driver).
""",
version="0.0.0",
title="Humanitec Reference Driver",
contact={"email": "[email protected]"},
license={
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html",
},
openapi_url="/docs/spec.json",
redoc_url="/docs",
docs_url=None)
fastapi.include_router(api_router, prefix="/s3")
@fastapi.get("/alive", response_model=str)
def is_alive():
return f"{APPNAME} {VERSION}"
@fastapi.get("/health", response_model=Health)
def status():
return Health(app=APPNAME, version=VERSION, status="OK")