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

[OPTIMIZATION] 忽略无效拓扑节点 #191

Closed
ZhuoZhuoCrayon opened this issue Oct 8, 2021 · 1 comment
Closed

[OPTIMIZATION] 忽略无效拓扑节点 #191

ZhuoZhuoCrayon opened this issue Oct 8, 2021 · 1 comment
Assignees
Labels
kind/optimization 优化 module/backend 后台 priority/high 优先级高(High priority) version/V2.1.X V2.1.X 版本

Comments

@ZhuoZhuoCrayon
Copy link
Member

你想要什么功能
业务拓扑变更后,订阅范围内无效的拓扑应该被忽略
apps/backend/subscription/commons.py get_host_by_inst

{
    "result": false,
    "code": 3800003,
    "data": [
        [],
        {
            "page": {
                "start": 0,
                "limit": 1
            },
            "fields": [
                "bk_host_innerip",
                "bk_bak_operator",
                "bk_os_type",
                "bk_os_name",
                "bk_cpu_module",
                "bk_host_outerip",
                "bk_cloud_id",
                "bk_os_bit",
                "bk_host_name",
                "bk_supplier_account",
                "operator",
                "bk_host_id"
            ],
            "bk_biz_id": 7,
            "bk_obj_id": "test",
            "bk_inst_id": 108
        }
    ],
    "message": "{'result': False, 'code': 1199006, 'data': None, 'message': \"'bk_obj_id' 数据参数校验不通过\", 'permission': None, 'request_id': 'b0d925587b1b4917990415b86161fd1c'}(3800003)",
    "errors": null
}
@zhangzhw8
Copy link
Member

解决方案:
get_host_by_inst方法中校验bk_obj_id

  1. 通过CMDB 接口 get_mainline_object_topo 得到业务拓扑
  2. 若 bk_obj_id 不存在于业务拓扑中,则忽略该拓扑

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/optimization 优化 module/backend 后台 priority/high 优先级高(High priority) version/V2.1.X V2.1.X 版本
Projects
None yet
Development

No branches or pull requests

3 participants