2024-06-20 16:24:10 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
|
|
|
from pydantic import BaseModel, Field, PositiveInt
|
|
|
|
|
|
|
|
|
2024-06-22 18:26:38 +08:00
|
|
|
class OpenSearchConfig(BaseModel):
|
2024-06-20 16:24:10 +08:00
|
|
|
"""
|
|
|
|
OpenSearch configs
|
|
|
|
"""
|
|
|
|
|
|
|
|
OPENSEARCH_HOST: Optional[str] = Field(
|
|
|
|
description='OpenSearch host',
|
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
OPENSEARCH_PORT: PositiveInt = Field(
|
|
|
|
description='OpenSearch port',
|
|
|
|
default=9200,
|
|
|
|
)
|
|
|
|
|
|
|
|
OPENSEARCH_USER: Optional[str] = Field(
|
|
|
|
description='OpenSearch user',
|
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
OPENSEARCH_PASSWORD: Optional[str] = Field(
|
|
|
|
description='OpenSearch password',
|
|
|
|
default=None,
|
|
|
|
)
|
|
|
|
|
|
|
|
OPENSEARCH_SECURE: bool = Field(
|
|
|
|
description='whether to use SSL connection for OpenSearch',
|
|
|
|
default=False,
|
|
|
|
)
|