generated from PrivateAIM/python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
477 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"""Endpoints for the pod orchestrator.""" | ||
from typing import Optional | ||
from uuid import UUID | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"""Models for the Kong microservice.""" | ||
from enum import Enum | ||
|
||
from kong_admin_client import CreateServiceRequest, CreateServiceRequestClientCertificate, Plugin, Consumer, KeyAuth, \ | ||
ACL | ||
from kong_admin_client.models.service import Service | ||
from pydantic import BaseModel, constr | ||
|
||
|
||
class DataStoreType(Enum): | ||
"""Data store types.""" | ||
S3: str = "s3" | ||
FHIR: str = "fhir" | ||
|
||
|
||
class Services(BaseModel): | ||
"""Data store list response model.""" | ||
data: list[Service] | ||
offset: int | None = None | ||
|
||
|
||
class ServiceRequest(CreateServiceRequest): | ||
"""Improved version of the CreateServiceRequest with better defaults.""" | ||
protocol: str | None = "http" | ||
port: int | None = 80 | ||
path: str | None = "/somewhere" | ||
client_certificate: CreateServiceRequestClientCertificate | None = None | ||
tls_verify: bool | None = None | ||
ca_certificates: list[str] | None = None | ||
|
||
|
||
class LinkDataStoreProject(BaseModel): | ||
route: Service | ||
keyauth: Plugin | ||
acl: Plugin | ||
|
||
|
||
class LinkProjectAnalysis(BaseModel): | ||
consumer: Consumer | ||
keyauth: KeyAuth | ||
acl: ACL | ||
|
||
|
||
class Disconnect(BaseModel): | ||
"""Response from disconnecting a project from a datastore.""" | ||
removed_routes: list[str] | None | ||
status: str | None | ||
|
||
|
||
HttpMethodCode = constr(pattern=r"(GET|POST|PUT|PATCH|DELETE|OPTIONS|HEAD|CONNECT|TRACE|CUSTOM)") | ||
ProtocolCode = constr(pattern=r"(http|grpc|grpcs|tls|tcp)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
"""EPs for the pod orchestrator.""" | ||
import logging | ||
from typing import Annotated | ||
|
||
|
Oops, something went wrong.