Comments (1)
功能描述
根据ip列表批量查询作业执行日志
请求参数
{{ bkapi_authorization_description }}
Header参数
字段 | 类型 | 必选 | 描述 |
---|---|---|---|
X-Bkapi-Authorization | string | 是 | 认证信息 |
Accept | string | 是 | 固定值。application/json |
Content-Type | string | 是 | 固定值。application/json |
Body参数
字段 | 类型 | 必选 | 描述 |
---|---|---|---|
bk_biz_id | long | 是 | 业务ID |
job_instance_id | long | 是 | 作业实例ID |
step_instance_id | long | 是 | 步骤实例ID |
ip_list | array | 是 | 源/目标主机IP列表,定义见ip |
ip
字段 | 类型 | 必选 | 描述 |
---|---|---|---|
bk_cloud_id | int | 是 | 云区域ID |
ip | string | 是 | IP地址 |
请求参数示例
- POST
{
"bk_biz_id": 1,
"job_instance_id": 100,
"step_instance_id": 200,
"ip_list": [
{
"bk_cloud_id": 0,
"ip": "10.0.0.1"
},
{
"bk_cloud_id": 0,
"ip": "10.0.0.2"
}
]
}
返回结果示例
脚本执行步骤
{
"result": true,
"code": 0,
"message": "",
"data": {
"log_type": 1,
"task_instance_id": 100,
"step_instance_id": 200,
"script_task_logs": [
{
"ip": "10.0.0.1",
"bk_cloud_id": 0,
"log_content": "[2018-03-15 14:39:30][PID:56875] job_start\n"
},
{
"ip": "10.0.0.2",
"bk_cloud_id": 0,
"log_content": "[2018-03-15 14:39:30][PID:16789] job_start\n"
}
]
}
}
文件分发步骤
{
"result": true,
"code": 0,
"message": "",
"data": {
"log_type": 2,
"task_instance_id": 100,
"step_instance_id": 200,
"file_task_logs": [
{
"ip": "10.0.0.1",
"bk_cloud_id": 0,
"file_logs": [
{
"mode": 1,
"src_ip": {
"bk_cloud_id": 0,
"ip": "10.0.0.2"
},
"src_path": "/data/1.log",
"dest_ip": {
"bk_cloud_id": 0,
"ip": "10.0.0.1"
},
"dest_path": "/tmp/1.log",
"status": 4,
"log_content": "[2021-06-28 11:32:16] FileName: /tmp/1.log FileSize: 9.0 Bytes State: dest agent success download file Speed: 1 KB/s Progress: 100% StatusDesc: dest agent success download file Detail: success"
}
]
},
{
"ip": "10.0.0.2",
"bk_cloud_id": 0,
"file_logs": [
{
"mode": 0,
"src_ip": {
"bk_cloud_id": 0,
"ip": "10.0.0.2"
},
"src_path": "/data/1.log",
"status": 4,
"log_content": "[2021-06-28 11:32:16] FileName: /data/1.log FileSize: 9.0 Bytes State: source agent success upload file Speed: 1 KB/s Progress: 100% StatusDesc: source agent success upload file Detail: success upload"
}
]
}
]
}
}
文件任务返回结果说明
- 如果需要返回文件源的上传日志,需要在ip_list添加源文件服务器IP
返回结果说明
data
字段 | 类型 | 描述 |
---|---|---|
bk_cloud_id | int | 目标服务器云区域ID |
ip | string | 目标服务器IP地址 |
log_type | int | 日志类型。1-脚本执行任务日志;2-文件分发任务日志 |
script_task_logs | array | 脚本执行任务日志。定义见script_task_log |
file_task_logs | array | 文件分发任务日志。定义见file_task_log |
script_task_log
字段 | 类型 | 描述 |
---|---|---|
bk_cloud_id | long | 云区域ID |
ip | string | 目标IP地址 |
log_content | string | 脚本执行日志内容 |
file_task_log
字段 | 类型 | 描述 |
---|---|---|
bk_cloud_id | long | 云区域ID |
ip | string | 源/目标IP地址 |
file_logs | array | 文件分发日志内容。定义见file_log |
file_log
字段 | 类型 | 描述 |
---|---|---|
mode | 分发模式 | 0:上传;1:下载 |
src_ip | object | 文件源主机IP。定义见ip |
src_path | string | 源文件路径 |
dest_ip | object | 分发目标主机IP,mode=1时有值。定义见ip |
dest_path | string | 目标路径,mode=1时有值 |
status | int | 任务状态。1-等待开始;2-上传中;3-下载中;4-成功;5-失败 |
log_content | string | 文件分发日志内容 |
ip
字段 | 类型 | 描述 |
---|---|---|
bk_cloud_id | long | 云区域ID |
ip | string | IP地址 |
from bk-job.
Related Issues (20)
- feature: 查看作业模板执行脚本步骤时隐藏敏感参数
- fix: 作业模板编辑鉴权时未校验关联的查看权限
- perf: 对第三方系统的幂等请求支持重试
- fix: 国际化规范
- fix: 大业务量环境下job-manage CPU持续飚高 HOT 1
- perf: 版本日志支持按版本号排序
- fix: 含有无效主机的作业模板导入报错
- perf: 跨微服务错误信息传递不完整
- feature: crontab国际化
- fix: exeucte_job_plan API,全局变量-主机传入空的主机列表,报系统内部错误 HOT 1
- fix: 导入作业模版,如果文件中的主机失效(hostId:-1),导入异常
- fix: get_job_instance_ip_log 返回的 bk_host_id 字段为 null HOT 1
- perf: file-worker日志格式化策略优化
- perf: 优化对 GSE任务查询结果为空的处理
- fix: 定时任务偶现启动失败
- fix: 主机AgentId更新后,小概率出现使用旧AgentId下发任务
- feat: Job 支持保存用户语言环境到用户管理
- docs: 3.7.4 版本日志
- perf: Job 后端国际化
- perf: 作业执行引擎支持特定类型的异常作业的重新调度
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bk-job.