We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
你想要什么功能 配置模板支持主机动态渲染
为什么需要 根据拓扑节点 / 模板等信息,在模板渲染时解析出相应的 IP,获取的主机信息按 IP 保证有序
IP
建议如何实现
接口:get_hosts_by_node
get_hosts_by_node
接口协议
// 动态拓扑 [{"bk_biz_id": 2, "bk_inst_id": 2, "bk_obj_id": "set"}] // 集群模板 [{"bk_biz_id": 2, "bk_inst_id": 11, "bk_obj_id": "SET_TEMPLATE"}] // 服务模板 [{"bk_biz_id": 2, "bk_inst_id": 111, "bk_obj_id": "SERVICE_TEMPLATE"}]
支持属性
示例模板
# 获取拨测目标信息 {% set instances = get_hosts_by_node(nodes) %} tasks: - task_id: {{ task_id }} bk_biz_id: {{ bk_biz_id }} {% if instances %}ips: {% for instance in instances %}- {{ instance["bk_host_innerip"] }} {% endfor %} {% endif %}
渲染结果
tasks: - task_id: 1 bk_biz_id: 2 ips: - 127.0.0.1 - 127.0.0.2
The text was updated successfully, but these errors were encountered:
feature: 配置模板支持主机动态渲染 (closed TencentBlueKing#1466)
512cf32
195cb00
feature: 配置模板支持主机动态渲染 (closed #1466)
854bbe2
sprintfix: 增加主机节点的场景 (closed TencentBlueKing#1466)
6b9e749
sprintfix: 增加主机节点的场景 (closed #1466)
4346e95
9ee7aa4
b8f7ae4
ZhuoZhuoCrayon
No branches or pull requests
你想要什么功能
配置模板支持主机动态渲染
为什么需要
根据拓扑节点 / 模板等信息,在模板渲染时解析出相应的 IP,获取的主机信息按
IP
保证有序建议如何实现
协议
接口:
get_hosts_by_node
接口协议
支持属性
调用方法
示例模板
渲染结果
The text was updated successfully, but these errors were encountered: