跳到主要内容

查询集群机器列表

接口描述

根据集群id查询机器列表。

接口地址

/cloudcanal/console/api/v1/openapi/worker/listworkers

请求方式

POST

请求参数

参数名称参数说明请求类型是否必须数据类型
clusterId集群 idbodylong
sourceInstanceId源端数据源实例 idbodylong
targetInstanceId目标数据源实例 idbodylong

公共响应结果

参数名称参数说明类型(java)不为空
code1:成功 0:失败string
dataobject
msgstring
requestIdstring

data 参数说明

data 为数组,其中每一组数据中的字段说明如下:

参数名称参数说明类型(java)不为空
id节点idlong
gmtCreate创建时间string
gmtModified修改时间string
clusterId集群idlong
privateIp私网ipstring
publicIp公网ip(出口ip)string
cloudOrIdcNameALIBABA_CLOUD(阿里云)
SELF_MAINTENANCE(自建)
string
region集群所在区域String
workerName节点名称string
workerSeqNumber节点唯一标识string
workerDesc节点描述string
totalTaskMemMb任务逻辑占用内存(MB)long
taskHeapSizeMb任务物理占用内存(MB)long
memOverSoldPercent内存占用比例,超过100则超卖int
physicMemMb物理内存容量(MB)long
physicCoreNum物理核数量int
logicalCoreNum逻辑核数量int
physicDiskGb物理磁盘容量(GB)long
workerType节点类型,

BARE_METAL(物理机)
VM(虚拟机)
ECS(云虚拟机)
string
workerState节点状态,

WAIT_TO_ONLINE(等待上线)
ONLINE(在线)
WAIT_TO_OFFLINE(等待下线)
OFFLINE(下线)
ABNORMAL(异常)
NOT_EXIST(不存在)
string
cpuUseRatiocpu使用率double
memUseRatio内存使用率double
healthLevel节点健康状况,

Unhealthy(不健康)
SubHealth(亚健康)
Health(健康)
string
freeMemMb空闲内存(MB)long
freeDiskGb空闲磁盘(GB)long
workerLoad节点loaddouble
installConsoleJobId节点安装的异步任务idlong
uninstallConsoleJobId节点卸载的异步任务idlong
deployStatus节点部署状态,

INSTALLING(安装中)
INSTALLED(安装完毕)
UNINSTALLING(卸载中)
UNINSTALLED(卸载完毕)
string
consoleJobId添加节点的异步任务idlong
consoleTaskState添加节点的异步任务状态,

WAIT_START(等待启动)
EXECUTE(执行中)
SUCCESS(成功)
FAILED(失败)
CANCELED(取消)
SKIP(跳过)
string
taskScheduleVOs挂载在该机器的任务信息,结构为一个数组list
alertConfigVO告警配置object
installOrUpgradeDate安装或升级时间string
installOrUpgradeVersion安装或升级后的软件版本string

taskScheduleVOs 说明

该参数为一个列表,其中列表中每一个元素的字段说明如下

参数名称参数说明类型(java)不为空
id调度数据的idlong
gmtCreate创建时间string
taskIdData Task idlong
jobIdData Job idlong
taskNameData Task 名字string
jobNameData Job 名字string
jobDescData Job 描述string
workerIp挂载的节点 ipstring
workerId挂载的节点 idstring
clusterName节点所属的集群名称string
clusterId节点所属的集群idlong
jvmHeapMbData Task 任务内存(MB)string
srcDsId源端数据源idlong
srcDsDesc源端数据源描述string
dstDsId目标数据源idlong
dstDsDesc目标数据源描述string

alertConfigVO 说明

该参数为一个对象,其中字段说明如下

参数名称参数说明类型(java)不为空
id告警配置idlong
uid所属用户uidstring
phone是否发送电话告警(目前无效)boolean
email是否发送电子邮件告警boolean
dingding是否发送即时通信工具告警boolean
sms是否发送短信告警boolean
ruleName告警规则名称string
expression告警表达式string
sendAdmin是否发送给业务管理员(未使用)boolean
sendSystem是否发送给系统管理员boolean
dataJobIdData Job idlong
workerId节点idlong
alarmLevel告警级别,

Major(普通)
Critical(致命)
Blocker(完全不可用)
string
eventType异常事件类型,

TASK_EXCEPTION_EVENT(任务异常)
TASK_POSITION_DELAY_EVENT(任务延迟)
SIDECAR_EXCEPTION_EVENT(节点报错)
CONSOLE_EXCEPTION_EVENT(控制台报错)
WORKER_ABNORMAL_EVENT(节点异常)
TASK_NORMAL_EVENT(任务恢复正常)
string
alertReceivers告警接受人,是一个映射结构,key为uid,value为用户名map

响应示例

{
"requestId": "ebd0b7dc-54ed-11ed-b820-5bd47d77dc8c",
"taskId": 0,
"workerIdentity": null,
"sendBackToTask": false,
"code": "1",
"msg": "request success",
"data": [
{
"id": 1,
"gmtCreate": "2021-11-04T04:25:06.000+0000",
"gmtModified": "2022-10-26T05:20:20.000+0000",
"clusterId": 1,
"privateIp": "192.168.0.149",
"publicIp": "115.192.103.211",
"cloudOrIdcName": "SELF_MAINTENANCE",
"region": "hangzhou",
"totalTaskMemMb": 10240,
"memOverSoldPercent": 200,
"physicMemMb": 65536,
"physicCoreNum": 10,
"logicalCoreNum": 10,
"physicDiskGb": 926,
"workerType": "VM",
"workerState": "ONLINE",
"cpuUseRatio": 20.74,
"memUseRatio": 52,
"healthLevel": "Health",
"taskHeapSizeMb": 0,
"freeMemMb": 30855,
"freeDiskGb": 700,
"workerLoad": 3.03,
"workerName": "worker241gk84d2o6",
"workerSeqNumber": "wsnkhry09td02kdvuxns3olrzpgz915r5s569rt0hail7y63vgha4xcnn3g5a8la",
"workerDesc": "worker241gk84d2o6",
"installConsoleJobId": null,
"uninstallConsoleJobId": null,
"deployStatus": null,
"consoleJobId": 482,
"consoleTaskState": "SUCCESS",
"taskScheduleVOs": [
{
"id": 63,
"gmtCreate": "2022-04-19T10:07:37.000+0000",
"gmtModified": "2022-04-19T10:07:37.000+0000",
"taskId": 71,
"jobId": 455,
"taskName": "canalz1yt0nutvr3_CHECK",
"jobName": "canalz1yt0nutvr3",
"workerIp": "192.168.0.146",
"workerId": 1,
"clusterName": null,
"clusterId": 1,
"jobDesc": "1234",
"jvmHeapMb": 2048,
"srcDsId": 15,
"srcDsDesc": "外网源",
"dstDsId": 101,
"dstDsDesc": "cloudpg12"
},
{
"id": 73,
"gmtCreate": "2022-04-20T08:15:29.000+0000",
"gmtModified": "2022-04-20T08:15:29.000+0000",
"taskId": 81,
"jobId": 459,
"taskName": "canalc51a374175o_CHECK",
"jobName": "canalc51a374175o",
"workerIp": "192.168.0.146",
"workerId": 1,
"clusterName": null,
"clusterId": 1,
"jobDesc": "123",
"jvmHeapMb": 2048,
"srcDsId": 15,
"srcDsDesc": "外网源",
"dstDsId": 104,
"dstDsDesc": "cloudgp_2"
},
{
"id": 93,
"gmtCreate": "2022-04-22T05:46:31.000+0000",
"gmtModified": "2022-04-22T05:46:31.000+0000",
"taskId": 100,
"jobId": 468,
"taskName": "canal1c1zu6ye2dz_CHECK",
"jobName": "canal1c1zu6ye2dz",
"workerIp": "192.168.0.146",
"workerId": 1,
"clusterName": null,
"clusterId": 1,
"jobDesc": "1234",
"jvmHeapMb": 2048,
"srcDsId": 15,
"srcDsDesc": "外网源",
"dstDsId": 16,
"dstDsDesc": "外网目标"
},
{
"id": 878,
"gmtCreate": "2022-10-25T06:46:47.000+0000",
"gmtModified": "2022-10-25T06:46:47.000+0000",
"taskId": 973,
"jobId": 877,
"taskName": "canale4g10grqgk4_INCREMENT",
"jobName": "canale4g10grqgk4",
"workerIp": "192.168.0.149",
"workerId": 1,
"clusterName": null,
"clusterId": 1,
"jobDesc": "123",
"jvmHeapMb": 2048,
"srcDsId": 15,
"srcDsDesc": "外网源",
"dstDsId": 229,
"dstDsDesc": "alikafka_post-cn-zmb2xhefl001"
},
{
"id": 880,
"gmtCreate": "2022-10-25T13:10:42.000+0000",
"gmtModified": "2022-10-25T13:10:42.000+0000",
"taskId": 975,
"jobId": 879,
"taskName": "canal0epg521jc7b_INCREMENT",
"jobName": "canal0epg521jc7b",
"workerIp": "192.168.0.149",
"workerId": 1,
"clusterName": null,
"clusterId": 1,
"jobDesc": "123",
"jvmHeapMb": 2048,
"srcDsId": 229,
"srcDsDesc": "alikafka_post-cn-zmb2xhefl001",
"dstDsId": 229,
"dstDsDesc": "alikafka_post-cn-zmb2xhefl001"
}
],
"alertConfigVO": {
"id": 3,
"uid": "1661225473146964",
"phone": false,
"email": true,
"dingding": true,
"sms": true,
"duplicated": false,
"ruleName": "机器活性探测报警",
"expression": null,
"sendAdmin": false,
"sendSystem": false,
"dataJobId": null,
"workerId": 1,
"alarmLevel": "Major",
"eventType": "WORKER_ABNORMAL_EVENT",
"alertReceivers": {}
},
"installOrUpgradeDate": null,
"installOrUpgradeVersion": null
}
],
"fail": false,
"success": true,
"rsocketDirectionType": null
}