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)
- perf: 执行历史归档优化-分批归档与删除
- A graphical operation and maintenance inspection tool 面向个人的可视化运维巡检工具,个人运维工具中的 瑞士军刀 ,无需安装,开箱即用! 目前基础功能已开发完成,基本可用,还处于完善阶段 大概功能构想为: 创建一个项目,在项目里创建资源,再创建巡检模板,模板里可选择目标主机/主机组,选择要执行的巡检命令或操作,可定时执行,执行完成后可发邮件通知 以及在线批量shell交互,shell终端支持彩色及自定义单词/字符高亮 开源地址: https://github.com/limaofu/cofable HOT 1
- feat: 文件分发增加增量分发功能
- fix: 全局设置中windows默认账号命名规则与描述不符
- perf: 脚本编辑器增加日志输出大小限制提醒 tips
- feat: 容器执行支持灰度
- fix: 运营分析数据最后更新时间不准确
- fix: get_step_instance_status接口缺少所有结果分组的基本信息
- fix: 文件分发添加本地大文件上传失败
- feat: 本地文件上传类型限制,需要支持.xx.xx类型
- perf: 脚本任务执行结果拉取优化
- fix: job 调用 cmdb list_kube_workload api 查询条件不正确导致循环查询
- fix: 定时任务服务更新后偶现任务不触发
- perf: 执行微服务进程 OOM 之后,确保任务能够重新调度
- feat: 执行历史归档源 DB 支持独立配置
- fix: 跨环境导入含本地文件作业后本地文件失效
- fix: 轻量化部署模式下分发配置文件失败 HOT 1
- perf: 将依赖Agent的Pod所在节点是否安装Agent作为健康指标之一
- feat: 作业平台支持修改账号管理中用户信息的API接口
- fix: 普通用户没有删除公共脚本管理权限,去申请跳转至404页面
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.