Skip to content

Commit

Permalink
minor: 云区域描述全量切换为管控区域
Browse files Browse the repository at this point in the history
  • Loading branch information
normal-wls committed Jul 19, 2023
1 parent 5d5efe0 commit a11ae43
Show file tree
Hide file tree
Showing 75 changed files with 368 additions and 522 deletions.
2 changes: 1 addition & 1 deletion docs/features/variables_engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AgentInstallService(Service):

### IP选择器
可以选择业务下的静态 IP 列表,也可以选择业务拓扑或者输入业务拓扑某些层级的动态生成 IP,变量的值是当前业务下合法的主机内网 IP,
用户可以选择是否包含云区域信息,多个用英文逗号 `,` 分隔,如 `127.0.0.1,127.0.0.2``0:127.0.0.1,0:127.0.0.2`(假设 IP 所在云区域 ID 是 0),
用户可以选择是否包含管控区域信息,多个用英文逗号 `,` 分隔,如 `127.0.0.1,127.0.0.2``0:127.0.0.1,0:127.0.0.2`(假设 IP 所在管控区域 ID 是 0),
不合法的IP(包括非IP字符和非当前业务下的IP)都会被自动过滤掉。

### 下拉框
Expand Down
10 changes: 5 additions & 5 deletions docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
- 修复ProjectConfig和StaffGroup接口无权限中心校验问题
- improvement
- 注册所有常用操作到IAM
- 从ip_str中匹配IP信息在纯IP格式和云区域ID:IP格式下支持host_innerip为多ip情况
- 从ip_str中匹配IP信息在纯IP格式和管控区域ID:IP格式下支持host_innerip为多ip情况

## 3.7.0

Expand Down Expand Up @@ -279,7 +279,7 @@
- bugfix
- 修复集群资源筛选变量导入excel数据时ip列为空问题
- 修复修复 lazy 类型变量支持预渲染引入的问题问题
- 修复集群模块选择器手动输入 IP 可能会输出位于多个云区域下重复 IP 的问题
- 修复集群模块选择器手动输入 IP 可能会输出位于多个管控区域下重复 IP 的问题
- 修复无法选择非标准空闲机池模块下 IP 的问题
- 修复表格tag操作按钮在任务执行开始后禁用态不生效问题
- improvement
Expand Down Expand Up @@ -325,7 +325,7 @@
- 密码变量中公私钥支持从环境变量中读取
- 任务节点强制失败后支持重试和跳过
- 职能化任务通过普通任务打开时重定向到职能化任务链接
- 优化批量修改主机属性插件校验逻辑,支持云区域ID:IP的填写方式
- 优化批量修改主机属性插件校验逻辑,支持管控区域ID:IP的填写方式
- 插件列表按照版本号递增排序
- 优化 快速执行脚本v1.0版本 脚本名称模糊匹配问题
- IP 选择器筛选条件支持自定义分隔符
Expand Down Expand Up @@ -1177,7 +1177,7 @@
## 3.5.2

- 新功能
- IP 选择器支持配置值是否带云区域 ID
- IP 选择器支持配置值是否带管控区域 ID
- 后端添加版本日志功能
- 优化项
- 用户第一次进入应用时,为其在常用业务中初始化有权限的业务
Expand Down Expand Up @@ -1411,7 +1411,7 @@
- 非数据列表页面添加返回按钮,用户可以快速返回到之前的数据列表页面
- 二级导航的父级允许点击,默认打开二级导航列表的第一项
- 二级导航列表选中态样式优化
- IP 选择器样式多处优化,去掉静态IP选择列表中云区域中多余右括号
- IP 选择器样式多处优化,去掉静态IP选择列表中管控区域中多余右括号
- 导出流程弹窗和编辑周期任务弹窗按钮添加loading效果
- bug fix
- 修复数据统计时间筛选条件右侧点展开关闭弹窗击无效的问题
Expand Down
2 changes: 1 addition & 1 deletion en_docs/features/variables_engine.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ It has been updated to "IP selector". This might be removed in future versions.

### IP Selector
You can select a static IP list in the business, select the dynamically generated IPs from business topology or input the dynamically generated IPs from certain layer of business topology. The value of the variable is the legal intranet IP of the host machine in the current business.
The user can decide whether to include cloud region information. Multiple IPs are separated by comma `,` For example, `127.0.0.1,127.0.0.2` or `0:127.0.0.1,0:127.0.0.2` (assuming the cloud region ID of these IPs is 0).
The user can decide whether to include BK-Net information. Multiple IPs are separated by comma `,` For example, `127.0.0.1,127.0.0.2` or `0:127.0.0.1,0:127.0.0.2` (assuming the BK-Net ID of these IPs is 0).
Illegal IPs (including non-IP characters and IPs not in the current business) will be automatically filtered.

### Dropdown Box
Expand Down
8 changes: 4 additions & 4 deletions gcloud/utils/cmdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_business_host(username, bk_biz_id, supplier_account, host_fields, ip_lis
:type host_fields: list
:param ip_list: 主机内网 IP 列表
:type ip_list: list
:param bk_cloud_id: IP列表对应的云区域
:param bk_cloud_id: IP列表对应的管控区域
:type bk_cloud_id: int
:return:
[
Expand All @@ -122,7 +122,7 @@ def get_business_host(username, bk_biz_id, supplier_account, host_fields, ip_lis
"""
kwargs = {"bk_biz_id": bk_biz_id, "bk_supplier_account": supplier_account, "fields": list(host_fields or [])}

# 带云区域的主机数据查询
# 带管控区域的主机数据查询
if ip_list and bk_cloud_id:
kwargs["host_property_filter"] = {
"condition": "AND",
Expand Down Expand Up @@ -191,7 +191,7 @@ def get_business_host_ipv6(username, bk_biz_id, supplier_account, host_fields, i
:type host_fields: list
:param ip_list: 主机内网 IP 列表
:type ip_list: list
:param bk_cloud_id: IP列表对应的云区域
:param bk_cloud_id: IP列表对应的管控区域
:type bk_cloud_id: int
:return:
[
Expand Down Expand Up @@ -237,7 +237,7 @@ def get_business_set_host_ipv6(username, supplier_account, host_fields, ip_list=
:type host_fields: list
:param ip_list: 主机内网 IP 列表
:type ip_list: list
:param bk_cloud_id: IP列表对应的云区域
:param bk_cloud_id: IP列表对应的管控区域
:type bk_cloud_id: int
:return:
[
Expand Down
8 changes: 4 additions & 4 deletions gcloud/utils/ip.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
specific language governing permissions and limitations under the License.
"""
import ipaddress
import re
import logging
import re
from enum import Enum

ip_pattern = re.compile(r"(?<!\d)((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)(?!\d)")
Expand Down Expand Up @@ -61,7 +61,7 @@ def extend_ipv6(ip_list):

def get_ipv6_and_cloud_id_from_ipv6_cloud_str(ipv6_cloud_str):
""" "
从ipv6+云区域的格式中提取出来ipv6和云区域地址
从ipv6+管控区域的格式中提取出来ipv6和管控区域地址
ipv6_cloud_str: 0:[0000:0000:0000:0000:0000:0000]
"""
cloud_id = ipv6_cloud_str.split(":")[0]
Expand Down Expand Up @@ -140,7 +140,7 @@ def extract_ip_from_ip_str(ip_str):
ipv4_list_with_cloud_id, ip_str_without_ipv4_with_cloud_id = get_ip_by_regex_type(
IpRegexType.IPV4_WITH_CLOUD_ID.value, ip_str_without_ipv6
)
# 在ipv6下,云区域+ip 将不再唯一
# 在ipv6下,管控区域+ip 将不再唯一
ipv4_list, ip_str_without_ipv4 = get_ip_by_regex_type(IpRegexType.IPV4.value, ip_str_without_ipv4_with_cloud_id)

host_id_list, _ = get_ip_by_regex_type(IpRegexType.HOST_ID.value, ip_str_without_ipv4)
Expand All @@ -150,7 +150,7 @@ def extract_ip_from_ip_str(ip_str):

def get_plat_ip_by_regex(ip_str):
"""
从给定文本匹配【云区域ID:IP】并返回,【IP】格式云区域默认为0
从给定文本匹配【管控区域ID:IP】并返回,【IP】格式管控区域默认为0
@param ip_str:
@return: [
{
Expand Down
Binary file modified locale/en/LC_MESSAGES/django.mo
Binary file not shown.
60 changes: 30 additions & 30 deletions locale/en/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3684,8 +3684,8 @@ msgstr "Single target IP information"
#: pipeline_plugins/components/collections/sites/open/job/all_biz_fast_execute_script/base_service.py:88
#: pipeline_plugins/components/collections/sites/open/job/all_biz_fast_push_file/base_service.py:47
#: pipeline_plugins/components/collections/sites/open/job/all_biz_fast_push_file/base_service.py:76
msgid "云区域ID, 默认为0"
msgstr "Cloud region ID, default is 0"
msgid "管控区域ID, 默认为0"
msgstr "BK-Net ID, default is 0"

#: pipeline_plugins/components/collections/sites/open/job/all_biz_fast_execute_script/base_service.py:89
msgid "待执行目标机器 IP,多IP请使用;分隔"
Expand Down Expand Up @@ -3993,8 +3993,8 @@ msgid "执行作业"
msgstr "Execution JOB"

#: pipeline_plugins/components/collections/sites/open/job/execute_task/legacy.py:47
msgid "跨业务选项打开时IP参数需要按照(云区域ID:IP)格式填写,否则会尝试从本业务下获取IP信息"
msgstr "IP should be [Cloud ID:IP] when use different business, otherwise it will try to obtain IP information from this business"
msgid "跨业务选项打开时IP参数需要按照(管控区域ID:IP)格式填写,否则会尝试从本业务下获取IP信息"
msgstr "IP should be [BK-Net ID:IP] when use different business, otherwise it will try to obtain IP information from this business"

#: pipeline_plugins/components/collections/sites/open/job/execute_task/v1_0.py:49
msgid ""
Expand Down Expand Up @@ -4104,8 +4104,8 @@ msgstr "Use IP From Diff-Busi."

#: pipeline_plugins/components/collections/sites/open/job/fast_execute_script/v1_0.py:117
#: pipeline_plugins/components/collections/sites/open/job/fast_execute_script/v1_1.py:119
msgid "是否允许跨业务(跨业务需在作业平台添加白名单),允许时,源文件IP格式需为【云区域ID:IP】"
msgstr "The format should be [Cloud ID:IP] when use IP from different business"
msgid "是否允许跨业务(跨业务需在作业平台添加白名单),允许时,源文件IP格式需为【管控区域ID:IP】"
msgstr "The format should be [BK-Net ID:IP] when use IP from different business"

#: pipeline_plugins/components/collections/sites/open/job/fast_execute_script/v1_0.py:135
msgid "自定义任务名"
Expand Down Expand Up @@ -4194,8 +4194,8 @@ msgstr "Quick File Distribution"
#: pipeline_plugins/components/collections/sites/open/job/fast_push_file/v1_0.py:49
#: pipeline_plugins/components/collections/sites/open/job/fast_push_file/v2_0.py:49
#: pipeline_plugins/components/collections/sites/open/job/local_content_upload/base_service.py:78
msgid "是否允许跨业务,如果允许,源文件IP格式需为【云区域ID:IP】"
msgstr "the format should be [Cloud ID:IP] when use different business IP"
msgid "是否允许跨业务,如果允许,源文件IP格式需为【管控区域ID:IP】"
msgstr "the format should be [BK-Net ID:IP] when use different business IP"

#: pipeline_plugins/components/collections/sites/open/job/fast_push_file/v1_0.py:177
msgid "该版本不支持目标 IP 跨业务,需要目标 IP 跨业务分发请使用 2.0 及以上版本插件"
Expand Down Expand Up @@ -4247,8 +4247,8 @@ msgid "目标IP"
msgstr "Target IP"

#: pipeline_plugins/components/collections/sites/open/job/local_content_upload/base_service.py:59
msgid "IP必须填写【云区域ID:IP】或者【IP】格式之一,多个用换行分隔;【IP】格式需要保证所填写的内网IP在配置平台(CMDB)的该业务中是唯一的"
msgstr "IP should be filled with format [Cloud ID:IP] or [IP], separated by newline; [IP] format should be guaranteed unique of the CMDB business inner ips."
msgid "IP必须填写【管控区域ID:IP】或者【IP】格式之一,多个用换行分隔;【IP】格式需要保证所填写的内网IP在配置平台(CMDB)的该业务中是唯一的"
msgstr "IP should be filled with format [BK-Net ID:IP] or [IP], separated by newline; [IP] format should be guaranteed unique of the CMDB business inner ips."

#: pipeline_plugins/components/collections/sites/open/job/local_content_upload/base_service.py:66
msgid "请输入在蓝鲸作业平台上注册的账户名"
Expand Down Expand Up @@ -4592,12 +4592,12 @@ msgstr "log: "

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/legacy.py:214
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v2_0.py:223
msgid "云区域 ID"
msgstr "Cloud ID"
msgid "管控区域 ID"
msgstr "BK-Net ID"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/legacy.py:217
msgid "节点所在云区域 ID"
msgstr "Node cloud ID"
msgid "节点所在管控区域 ID"
msgstr "Node BK-Net ID"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/legacy.py:220
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v3_0.py:219
Expand All @@ -4623,8 +4623,8 @@ msgstr "Host"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/legacy.py:242
#: pipeline_plugins/components/collections/sites/open/nodeman/plugin_operate/v1_0.py:76
msgid "主机所在云区域 ID"
msgstr "Host cloud ID"
msgid "主机所在管控区域 ID"
msgstr "Host BK-Net ID"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/legacy.py:244
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v2_0.py:247
Expand Down Expand Up @@ -4719,8 +4719,8 @@ msgstr "Obtaining the node management public key failed, please check the node l
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v3_0.py:178
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py:167
#: pipeline_plugins/components/collections/sites/open/nodeman/plugin_operate/v1_0.py:114
msgid "获取bk_host_id失败:{},请确认云区域是否正确"
msgstr "Get bk_host_id failed: {}, please confirm cloud area's correctness"
msgid "获取bk_host_id失败:{},请确认管控区域是否正确"
msgstr "Get bk_host_id failed: {}, please confirm BK-Net's correctness"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v2_0.py:187
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v3_0.py:191
Expand Down Expand Up @@ -4791,8 +4791,8 @@ msgstr "AGENT or PROXY"
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v3_0.py:261
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py:237
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py:256
msgid "云区域ID"
msgstr "Cloud Region ID"
msgid "管控区域ID"
msgstr "BK-Net ID"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v3_0.py:243
#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py:238
Expand All @@ -4806,10 +4806,10 @@ msgstr "Host Info(For Upgrade,Install,Reinstall)"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v3_0.py:278
msgid ""
"v3.0版本支持多云区域主机新建任务 \n"
"v3.0版本支持多管控区域主机新建任务 \n"
"注意:节点类型PROXY仅支持非直连区域"
msgstr ""
"v3.0 version supports multi-cloud regional host creation tasks \n"
"v3.0 version supports multi-BK-Net host creation tasks \n"
"Note: Node type PROXY only supports non-directly connected areas"

#: pipeline_plugins/components/collections/sites/open/nodeman/create_task/v4_0.py:273
Expand Down Expand Up @@ -4959,8 +4959,8 @@ msgid "节点管理(NODEMAN)"
msgstr "NodeMan"

#: pipeline_plugins/components/utils/sites/open/utils.py:511
msgid "允许跨业务时IP格式需满足:【云区域ID:IP】。失败 IP: {}"
msgstr "Format should be [Cloud ID:IP] when use different business IP"
msgid "允许跨业务时IP格式需满足:【管控区域ID:IP】。失败 IP: {}"
msgstr "Format should be [BK-Net ID:IP] when use different business IP"

#: pipeline_plugins/components/utils/sites/open/utils.py:515
#: pipeline_plugins/components/utils/sites/open/utils.py:574
Expand Down Expand Up @@ -5171,16 +5171,16 @@ msgid ""
"筛选条件和排除条件为 AND 关系\n"
"- 筛选:会从IP列表中筛选出符合条件的IP\n"
"- 排除:会从IP列表中去除符合条件的IP\n"
"变量值是否带云区域\n"
"- 是,返回格式为{cloud_id}:{ip},{cloud_id}:{ip}\n"
"变量值是否带管控区域\n"
"- 是,返回格式为{BK-Net_id}:{ip},{BK-Net_id}:{ip}\n"
"- 否,返回格式为{ip},{ip}"
msgstr ""
"The output format is a string separated by ',' for the selected IP\n"
"Filter and exclude conditions are AND relationships\n"
"- Filter: Filter out eligible IPs from the IP list\n"
"- Exclude: Remove eligible IPs from IP list\n"
"Whether the variable value has cloud area\n"
"- True,The return format is {cloud_id}:{IP},{cloud_id}:{IP}\n"
"Whether the variable value has BK-Net\n"
"- True,The return format is {BK-Net_id}:{ip},{BK-Net_id}:{ip}\n"
"- False,The return format is {IP},{IP}"

#: pipeline_plugins/variables/collections/sites/open/cc.py:199
Expand Down Expand Up @@ -5848,8 +5848,8 @@ msgstr "Business"
msgid "注意: 1.屏蔽方案选择自定义监控时,屏蔽范围CC大区和集群必须选择all, 2.当按业务屏蔽时,使用当前项目选择的业务值"
msgstr "Note: 1. When the shielding scheme is selected to customize monitoring, the shielding range CC region and cluster must choose ALL. 2. When the business is shielded, use the business value of the current project selection"

msgid "移除填写方式,只支持主机IP方式\n 云区域ID、主机IP支持 设置为变量 \n 云区域ID 支持AllowCreate \n"
msgstr "Remove the filling method, only support the host IP method \n cloud area ID, host IP support setting to variable \n cloud area ID supports supportingCreate \n"
msgid "移除填写方式,只支持主机IP方式\n 管控区域ID、主机IP支持 设置为变量 \n 管控区域ID 支持AllowCreate \n"
msgstr "Remove the filling method, only support the host IP method \n BK-Net ID, host IP support setting to variable \n BK-Net ID supports supportingCreate \n"


#~ msgid "信号模块名"
Expand Down
Binary file modified locale/en/LC_MESSAGES/djangojs.mo
Binary file not shown.
Loading

0 comments on commit a11ae43

Please sign in to comment.