2024-07-09 13:32:04 +08:00
|
|
|
from typing import Optional
|
|
|
|
|
2024-11-18 19:29:54 +08:00
|
|
|
from pydantic import BaseModel, Field, PositiveInt
|
2024-07-09 13:32:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
class AnalyticdbConfig(BaseModel):
|
|
|
|
"""
|
2024-09-22 12:38:41 +07:00
|
|
|
Configuration for connecting to Alibaba Cloud AnalyticDB for PostgreSQL.
|
2024-07-09 13:32:04 +08:00
|
|
|
Refer to the following documentation for details on obtaining credentials:
|
|
|
|
https://www.alibabacloud.com/help/en/analyticdb-for-postgresql/getting-started/create-an-instance-instances-with-vector-engine-optimization-enabled
|
|
|
|
"""
|
|
|
|
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_KEY_ID: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
default=None, description="The Access Key ID provided by Alibaba Cloud for API authentication."
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_KEY_SECRET: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
default=None, description="The Secret Access Key corresponding to the Access Key ID for secure API access."
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_REGION_ID: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
default=None,
|
|
|
|
description="The region where the AnalyticDB instance is deployed (e.g., 'cn-hangzhou', 'ap-southeast-1').",
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_INSTANCE_ID: Optional[str] = Field(
|
2024-07-09 13:32:04 +08:00
|
|
|
default=None,
|
2024-09-22 12:38:41 +07:00
|
|
|
description="The unique identifier of the AnalyticDB instance you want to connect to.",
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_ACCOUNT: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
default=None,
|
|
|
|
description="The account name used to log in to the AnalyticDB instance"
|
|
|
|
" (usually the initial account created with the instance).",
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_PASSWORD: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
default=None, description="The password associated with the AnalyticDB account for database authentication."
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_NAMESPACE: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
default=None, description="The namespace within AnalyticDB for schema isolation (if using namespace feature)."
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-08-23 23:46:01 +08:00
|
|
|
ANALYTICDB_NAMESPACE_PASSWORD: Optional[str] = Field(
|
2024-09-22 12:38:41 +07:00
|
|
|
default=None,
|
|
|
|
description="The password for accessing the specified namespace within the AnalyticDB instance"
|
|
|
|
" (if namespace feature is enabled).",
|
2024-07-09 13:32:04 +08:00
|
|
|
)
|
2024-11-18 19:29:54 +08:00
|
|
|
ANALYTICDB_HOST: Optional[str] = Field(
|
|
|
|
default=None, description="The host of the AnalyticDB instance you want to connect to."
|
|
|
|
)
|
|
|
|
ANALYTICDB_PORT: PositiveInt = Field(
|
|
|
|
default=5432, description="The port of the AnalyticDB instance you want to connect to."
|
|
|
|
)
|
|
|
|
ANALYTICDB_MIN_CONNECTION: PositiveInt = Field(default=1, description="Min connection of the AnalyticDB database.")
|
|
|
|
ANALYTICDB_MAX_CONNECTION: PositiveInt = Field(default=5, description="Max connection of the AnalyticDB database.")
|