Skip to content

Commit

Permalink
fix(backend): 更新dbconfig #1658
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhw8 committed Nov 7, 2023
1 parent 03c0796 commit 12ea77d
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 19 deletions.
12 changes: 6 additions & 6 deletions dbm-ui/backend/configuration/models/function_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class CustomFuncNameEnum(str, StructuredEnum):
CustomFuncNameEnum.ToolBox.value: {"is_enabled": True},
ClusterType.TenDBSingle.value: {"is_enabled": True},
ClusterType.TenDBHA.value: {"is_enabled": True},
ClusterType.TenDBCluster.value: {"is_enabled": False},
CustomFuncNameEnum.TenDBClusterToolBox.value: {"is_enabled": False},
ClusterType.TenDBCluster.value: {"is_enabled": True},
CustomFuncNameEnum.TenDBClusterToolBox.value: {"is_enabled": True},
},
},
DBType.Redis.value: {
Expand All @@ -44,7 +44,7 @@ class CustomFuncNameEnum(str, StructuredEnum):
ClusterType.TendisPredixyTendisplusCluster.value: {"is_enabled": True},
ClusterType.TendisTwemproxyRedisInstance.value: {"is_enabled": True},
ClusterType.TwemproxyTendisSSDInstance.value: {"is_enabled": True},
CustomFuncNameEnum.ToolBox.value: {"is_enabled": False},
CustomFuncNameEnum.ToolBox.value: {"is_enabled": True},
},
},
CustomFuncNameEnum.BigData.value: {
Expand All @@ -64,11 +64,11 @@ class CustomFuncNameEnum(str, StructuredEnum):
},
},
CustomFuncNameEnum.Monitor.value: {
"is_enabled": False,
"is_enabled": True,
"children": {
"monitor_policy": {"is_enabled": False},
"monitor_policy": {"is_enabled": True},
"duty_rule": {"is_enabled": False},
"notice_group": {"is_enabled": False},
"notice_group": {"is_enabled": True},
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/backend/ticket/builders/riak/riak_shrink.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def format_ticket_data(self):
self.ticket_data["bk_cloud_id"] = cluster.bk_cloud_id


@builders.BuilderFactory.register(TicketType.RIAK_CLUSTER_DISABLE, phase=ClusterPhase.OFFLINE)
@builders.BuilderFactory.register(TicketType.RIAK_CLUSTER_SCALE_IN, phase=ClusterPhase.OFFLINE)
class RiakShrinkFlowBuilder(BaseRiakTicketFlowBuilder):
serializer = RiakShrinkDetailSerializer
inner_flow_builder = RiakShrinkFlowParamBuilder
Expand Down
22 changes: 15 additions & 7 deletions dbm-ui/blueking/component/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
except Exception: # pylint: disable=broad-except
pass


logger = logging.getLogger("component")


Expand Down Expand Up @@ -89,9 +88,7 @@ def get_bk_api_ver(self):

def merge_params_data_with_common_args(self, method, params, data, enable_app_secret=False):
"""get common args when request"""
common_args = dict(bk_app_code=self.app_code, **self.common_args)
if enable_app_secret:
common_args["bk_app_secret"] = self.app_secret
common_args = dict(**self.common_args)
if method == "GET":
_params = common_args.copy()
_params.update(params or {})
Expand All @@ -110,8 +107,19 @@ def request(self, method, url, params=None, data=None, **kwargs):
headers["x-use-test-env"] = "1"
if self.language:
headers["blueking-language"] = self.language

params, data = self.merge_params_data_with_common_args(method, params, data, enable_app_secret=True)
headers.update({
"X-Bkapi-Authorization": json.dumps(
{
"bk_app_code": self.app_code,
"bk_app_secret": self.app_secret,
"bk_username": params.get("bk_username", ""),
"bk_token": params.get("bk_token", ""),
"bk_ticket": params.get("bk_ticket", ""),
}
)
})

params, data = self.merge_params_data_with_common_args(method, params, data)
logger.debug("Calling %s %s with params=%s, data=%s, headers=%s", method, url, params, data, headers)
return requests.request(method, url, params=params, data=data, verify=False, headers=headers, **kwargs)

Expand All @@ -137,7 +145,7 @@ def request(self, method, url, params=None, data=None, **kwargs):
if self.language:
headers["blueking-language"] = self.language

params, data = self.merge_params_data_with_common_args(method, params, data, enable_app_secret=False)
params, data = self.merge_params_data_with_common_args(method, params, data)
if method == "POST":
params = {}

Expand Down
5 changes: 4 additions & 1 deletion dbm-ui/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@
"formatter": "bk_audit.contrib.django.formatters.DjangoFormatter",
}

# APIGW配置
# BAMBOO PIPELINE 配置
AUTO_UPDATE_COMPONENT_MODELS = False

# APIGW 蓝鲸网关配置
BK_APIGW_STATIC_VERSION = env.BK_APIGW_STATIC_VERSION
BK_APIGW_MANAGER_MAINTAINERS = env.BK_APIGW_MANAGER_MAINTAINERS
BK_APIGW_STAGE_NAME = env.BK_APIGW_STAGE_NAME
Expand Down
4 changes: 2 additions & 2 deletions helm-charts/bk-dbm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ dependencies:
description: A Helm chart for bkdbm
name: bk-dbm
type: application
version: 1.2.0-alpha.79
appVersion: 1.2.0-alpha.79
version: 1.2.0-alpha.80
appVersion: 1.2.0-alpha.80
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbconfig/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 0.0.1-alpha.51
appVersion: 0.0.1-alpha.52
description: A Helm chart for dbconfig
name: dbconfig
type: application
Expand Down
2 changes: 1 addition & 1 deletion helm-charts/bk-dbm/charts/dbm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
appVersion: 1.2.0-alpha.450
appVersion: 1.2.0-alpha.451
description: A Helm chart for dbm
name: dbm
type: application
Expand Down

0 comments on commit 12ea77d

Please sign in to comment.