Skip to content

Commit

Permalink
fix: 修复请求为POST请求 #7550
Browse files Browse the repository at this point in the history
  • Loading branch information
guohelu committed Oct 30, 2024
1 parent ad1bcbf commit 4b41460
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pipeline_plugins/cmdb_ip_picker/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def cmdb_search_host(request, bk_biz_id, bk_supplier_account="", bk_supplier_id=
if settings.ENABLE_IPV6 or settings.ENABLE_GSE_V2:
# IPV6环境下或者开启了GSE 2.0 版本
default_host_fields.append("bk_agent_id")
fields = set(default_host_fields + json.loads(request.GET.get("fields", "[]")))
fields = set(default_host_fields + json.loads(request.POST.get("fields", "[]")))
client = get_client_by_user(request.user.username)

topo_modules_id = set()
Expand All @@ -91,8 +91,8 @@ def cmdb_search_host(request, bk_biz_id, bk_supplier_account="", bk_supplier_id=
host_id = request.POST.get("host_id", None)

# get filter module id
if request.GET.get("topo", None):
topo = json.loads(request.GET.get("topo"))
if request.POST.get("topo", None):
topo = json.loads(request.POST.get("topo"))
topo_result = get_cmdb_topo_tree(request.user.username, bk_biz_id, bk_supplier_account)
if not topo_result["result"]:
return JsonResponse(topo_result)
Expand Down Expand Up @@ -205,7 +205,7 @@ def cmdb_search_host(request, bk_biz_id, bk_supplier_account="", bk_supplier_id=
host["agent"] = agent_info.get("bk_agent_alive", -1)

# search host lock status
if request.GET.get("search_host_lock", None):
if request.POST.get("search_host_lock", None):
bk_host_id_list = [host_detail["bk_host_id"] for host_detail in data]
host_lock_status_result = client.cc.search_host_lock({"id_list": bk_host_id_list})
if not host_lock_status_result["result"]:
Expand Down

0 comments on commit 4b41460

Please sign in to comment.