Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

SheepSheepChen
Copy link
Collaborator

  • 现有方案通过 Cluster 管理 rabbitmq 集群配置
  • 增强服务的设计是通过 Plan.config 管理相关配置

svc-rabbitmq/vendor/models.py Outdated Show resolved Hide resolved
svc-rabbitmq/vendor/models.py Show resolved Hide resolved
svc-rabbitmq/vendor/provider.py Show resolved Hide resolved
svc-rabbitmq/README.md Show resolved Hide resolved
svc-rabbitmq/README.md Outdated Show resolved Hide resolved
svc-rabbitmq/vendor/models.py Outdated Show resolved Hide resolved
svc-rabbitmq/vendor/models.py Outdated Show resolved Hide resolved
svc-rabbitmq/vendor/provider.py Show resolved Hide resolved
svc-rabbitmq/vendor/serializers.py Outdated Show resolved Hide resolved
@SheepSheepChen SheepSheepChen changed the title feat: svc-rabbitmq 支持 plan 管理配置 WIP: feat: svc-rabbitmq 支持 plan 管理配置 Dec 20, 2024
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")
Copy link
Collaborator

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):
Copy link
Collaborator

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:
Copy link
Collaborator

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}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: 写文档也要注意适当补充空格

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants