-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: feat: svc-rabbitmq 支持 plan 管理配置 #1810
base: main
Are you sure you want to change the base?
WIP: feat: svc-rabbitmq 支持 plan 管理配置 #1810
Conversation
SheepSheepChen
commented
Dec 17, 2024
- 现有方案通过 Cluster 管理 rabbitmq 集群配置
- 增强服务的设计是通过 Plan.config 管理相关配置
api_url = serializers.CharField(required=False, allow_null=True, default=None) | ||
admin = serializers.CharField(default="admin") | ||
password = serializers.CharField(required=True) | ||
cluster_version = serializers.CharField(default="3.7.8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个默认值是怎么来的呢?
cluster_version = serializers.CharField(default="3.7.8") | ||
management_api = serializers.SerializerMethodField(help_text="管理接口") | ||
|
||
def get_management_api(self, obj): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
补充类型注解
cluster = self.filter(id=plan_config.get("cluster_id")) | ||
cluster.delete() | ||
|
||
def filter_not_from_plan(self) -> models.QuerySet: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个函数名有点 emmm,换个名字?比如 exclude_from_plan
?
|
||
# pk 由 /data/fixtures/default.json 确认 | ||
plan = Plan.objects.get(pk="843127a9-d7a2-4485-b985-076a9b6695d8") | ||
config = {"host":"10.0.0.1", "admin":"admin","password":"blueking", "port":5672,"api_port":15672} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: 写文档也要注意适当补充空格