feat: implement proxy management endpoints and MongoDB integration
This commit is contained in:
+32
-4
@@ -1,8 +1,36 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from datetime import datetime
|
||||
|
||||
from models.service import ServiceDocument
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
from models.service import ServiceEndpointDocument
|
||||
|
||||
|
||||
class ProxyDocument(BaseModel):
|
||||
port: int = Field(..., description="Port number of the proxy")
|
||||
service: ServiceDocument = Field(..., description="Associated service details")
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
proxy_port: int = Field(..., description="Port exposed by the proxy")
|
||||
name: str = Field(..., description="Human readable proxy name")
|
||||
code: str = Field(..., description="Proxy source or identifier")
|
||||
service: ServiceEndpointDocument = Field(..., description="Associated upstream service")
|
||||
created_at: datetime | None = Field(default=None, description="Creation timestamp in UTC")
|
||||
updated_at: datetime | None = Field(default=None, description="Last update timestamp in UTC")
|
||||
|
||||
|
||||
class ProxyCreateInput(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
proxy_port: int = Field(..., description="Port exposed by the proxy")
|
||||
name: str = Field(..., description="Human readable proxy name")
|
||||
code: str = Field(..., description="Proxy source or identifier")
|
||||
service: ServiceEndpointDocument = Field(..., description="Associated upstream service")
|
||||
|
||||
|
||||
class ProxyUpdateInput(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
name: str | None = Field(default=None, description="Human readable proxy name")
|
||||
code: str | None = Field(default=None, description="Proxy source or identifier")
|
||||
service: ServiceEndpointDocument | None = Field(
|
||||
default=None,
|
||||
description="Associated upstream service",
|
||||
)
|
||||
Reference in New Issue
Block a user