diff --git a/dbm-ui/backend/db_meta/models/instance.py b/dbm-ui/backend/db_meta/models/instance.py index 36da3e8b7c..0531384ce7 100644 --- a/dbm-ui/backend/db_meta/models/instance.py +++ b/dbm-ui/backend/db_meta/models/instance.py @@ -57,6 +57,7 @@ def simple_desc(self): "bk_host_id": self.machine.bk_host_id, "bk_cloud_id": self.machine.bk_cloud_id, "spec_config": self.machine.spec_config, + "bk_sub_zone": self.machine.bk_sub_zone, "bk_biz_id": self.bk_biz_id, } diff --git a/dbm-ui/backend/db_services/dbbase/resources/query.py b/dbm-ui/backend/db_services/dbbase/resources/query.py index 6c39761d00..96e4af33da 100644 --- a/dbm-ui/backend/db_services/dbbase/resources/query.py +++ b/dbm-ui/backend/db_services/dbbase/resources/query.py @@ -602,6 +602,7 @@ def _to_cluster_representation( "cluster_stats": cluster_stats_map.get(cluster.immute_domain, {}), "cluster_type": cluster.cluster_type, "cluster_type_name": ClusterType.get_choice_label(cluster.cluster_type), + "disaster_tolerance_level": cluster.disaster_tolerance_level, "master_domain": cluster_entry_map_value.get("master_domain", ""), "slave_domain": cluster_entry_map_value.get("slave_domain", ""), "cluster_entry": cluster_entry, @@ -734,6 +735,8 @@ def _filter_instance_qs(cls, query_filters: Q, query_params: Dict[str, str]) -> "machine__bk_host_id", "machine__spec_config", "machine__machine_type", + "machine__bk_sub_zone", + "machine__bk_sub_zone_id", ] # 获取storage实例的查询集 storage_queryset = ( @@ -781,6 +784,8 @@ def _to_instance_representation( "db_module_name": db_module_names_map.get(instance["cluster__db_module_id"], ""), "bk_cloud_id": instance["machine__bk_cloud_id"], "bk_cloud_name": bk_cloud_name, + "bk_sub_zone": instance["machine__bk_sub_zone"], + "bk_sub_zone_id": instance["machine__bk_sub_zone_id"], "ip": instance["machine__ip"], "port": instance["port"], "instance_address": f"{instance['machine__ip']}{IP_PORT_DIVIDER}{instance['port']}", diff --git a/dbm-ui/backend/db_services/mongodb/resources/query.py b/dbm-ui/backend/db_services/mongodb/resources/query.py index 8402a8652e..28cd2d1d26 100644 --- a/dbm-ui/backend/db_services/mongodb/resources/query.py +++ b/dbm-ui/backend/db_services/mongodb/resources/query.py @@ -172,6 +172,8 @@ def _filter_instance_qs(cls, query_filters: Q, query_params: Dict[str, str]) -> "machine__bk_host_id", "machine__machine_type", "machine__spec_config", + "machine__bk_sub_zone", + "machine__bk_sub_zone_id", "shard", ] storage_instance = ( diff --git a/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py b/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py index 3d17560635..9831143a46 100644 --- a/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py +++ b/dbm-ui/backend/db_services/mysql/resources/tendbcluster/query.py @@ -203,6 +203,8 @@ def _filter_instance_qs(cls, query_filters, query_params): "machine__ip", "machine__bk_cloud_id", "machine__machine_type", + "machine__bk_sub_zone", + "machine__bk_sub_zone_id", ] # 获取remote实例的查询集