From 1a93e346a7bb34a349c064aae46175814e9e73c9 Mon Sep 17 00:00:00 2001 From: durant <826035498@qq.com> Date: Wed, 25 Sep 2024 14:42:00 +0800 Subject: [PATCH] =?UTF-8?q?feat(backend):=20mysql=20=E5=8D=87=E7=BA=A7?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=AE=89=E5=85=A8=E6=A8=A1=E5=BC=8F=20#7126?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py | 2 +- dbm-ui/backend/flow/utils/mysql/proxy_act_payload.py | 2 +- dbm-ui/backend/ticket/builders/mysql/mysql_local_upgrade.py | 1 + dbm-ui/backend/ticket/builders/mysql/mysql_migrate_upgrade.py | 1 + .../ticket/builders/redis/redis_toolbox_proxy_scale_up.py | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py index 24fa33ce10..a5010084b9 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py @@ -2338,7 +2338,7 @@ def get_mysql_upgrade_payload(self, **kwargs) -> dict: "extend": { "host": kwargs["ip"], "ports": self.cluster["ports"], - "force": False, + "force": self.ticket_data["force"], "pkg": mysql_pkg.name, "pkg_md5": mysql_pkg.md5, "run": self.cluster["run"], diff --git a/dbm-ui/backend/flow/utils/mysql/proxy_act_payload.py b/dbm-ui/backend/flow/utils/mysql/proxy_act_payload.py index e87c58effd..40e6ea4e37 100644 --- a/dbm-ui/backend/flow/utils/mysql/proxy_act_payload.py +++ b/dbm-ui/backend/flow/utils/mysql/proxy_act_payload.py @@ -88,7 +88,7 @@ def get_proxy_upgrade_payload(self, **kwargs) -> dict: "extend": { "host": kwargs["ip"], "ports": self.cluster["proxy_ports"], - "force": False, + "force": self.ticket_data["force"], "pkg": proxy_pkg.name, "pkg_md5": proxy_pkg.md5, }, diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_local_upgrade.py b/dbm-ui/backend/ticket/builders/mysql/mysql_local_upgrade.py index 72833f5b45..c6465b75d2 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_local_upgrade.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_local_upgrade.py @@ -25,6 +25,7 @@ class InfoSerializer(DisplayInfoSerializer): pkg_id = serializers.IntegerField(help_text=_("目标版本包ID")) infos = serializers.ListField(help_text=_("单据信息"), child=InfoSerializer()) + force = serializers.BooleanField(help_text=_("是否强制执行"), required=False, default=False) class MysqlLocalUpgradeParamBuilder(builders.FlowParamBuilder): diff --git a/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_upgrade.py b/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_upgrade.py index 166431f91b..15fa9e982b 100644 --- a/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_upgrade.py +++ b/dbm-ui/backend/ticket/builders/mysql/mysql_migrate_upgrade.py @@ -44,6 +44,7 @@ class InfoSerializer(DisplayInfoSerializer): ) backup_source = serializers.ChoiceField(help_text=_("备份源"), choices=MySQLBackupSource.get_choices()) infos = serializers.ListField(help_text=_("添加信息"), child=InfoSerializer()) + force = serializers.BooleanField(help_text=_("是否强制执行"), required=False, default=False) def validate(self, attrs): # 校验集群是否可用,集群类型为高可用 diff --git a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py index dc64097720..04ffcab7c9 100644 --- a/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py +++ b/dbm-ui/backend/ticket/builders/redis/redis_toolbox_proxy_scale_up.py @@ -35,6 +35,7 @@ class InfoSerializer(ClusterValidateMixin, serializers.Serializer): ip_source = serializers.ChoiceField(help_text=_("主机来源"), choices=IpSource.get_choices()) infos = serializers.ListField(help_text=_("批量操作参数列表"), child=InfoSerializer()) + force = serializers.BooleanField(help_text=_("是否强制执行"), required=False, default=False) class ProxyScaleUpParamBuilder(builders.FlowParamBuilder):