更新时间:2021-12-17 GMT+08:00
分享

创建采集任务

功能介绍

创建采集任务。

URI

  • URI格式
    POST /softcomai/datalake/collection/v1.0/task
  • 参数说明

    无。

请求

  • 请求样例
    POST https://ip:port/softcomai/datalake/collection/v1.0/task
    {
    "taskName": "sftp协议7",
    "collectTaskType": "consoleServer",
    "collectionMode": "AGENT",
    "collectorId": "Collector-f90e5e07",
    "protocolType": "sftp",
    "protocolCategory": "",
    "note": "我是个备注",
    "tag": "12333",
    "dataInfo": {
    "mainCategory": "pipe",
    "subCategory": "access",
    "device": "NCE-FAN",
    "dataType": "PM",
    "version": "common"
    },
    "strategy": "interval",
    "interval":{
    "acquisitionUnit":"min",
    "acquisitionCycle":"30"
    },
    "cron": {
    "jobType": 3,
    "second": 0,
    "minute": 15,
    "hour": 14
    },
    "protocolList": [
    {
    "host": "xx.xx.xx.xx",
    "port": "22",
    "userName": "root",
    "password": "Abc@123",
    "path": "/yy"
    },
    {
    "host": "xx.xx.xx.xx",
    "port": "22",
    "userName": "root",
    "password": "Abc@123",
    "path": "/opt/test"
    }
    ]
    }
  • 参数说明

    参数名

    是否必选

    参数类型

    备注

    taskName

    String

    任务名称。

    collectTaskType

    String

    创建采集任务方式(appmarket/dataplan/ consoleServer/logService/netMap)。

    tag

    String

    ossId(数据准备)。

    collectorId

    String

    采集ID。

    collectionMode

    String

    采集类型(EIP AGENT VPN)。

    protocolType

    String

    协议类型。

    protocolCategory

    String

    协议子类型。

    note

    String

    备注。

    dataType

    否(collectTaskType=netMap必选)

    String

    数据类型。

    taskId

    String

    任务ID。

    strategy

    String

    采集周期。

    • once:一次性采集。
    • period:周期性采集。
    • interval:间隔性采集。

    serviceNames

    String

    服务名称。

    dataInfo

    Object

    数据信息对象。

    dataInfo.mainCategory

    String

    主类别。

    dataInfo.subCategory

    String

    子类别。

    dataInfo.device

    String

    网管、设备信息。

    dataInfo.dataType

    String

    数据类型。

    dataInfo.version

    String

    版本。

    interval

    否(strategy=interval必选)

    Object

    间隔性策略。

    interval.acquisitionUnit

    String

    间隔单位。

    • min:分钟。
    • hour:小时。

    interval.acquisitionCycle

    String

    间隔时长。取值范围:1~10000。

    cron

    否(strategy=period必选)

    Object

    周期性策略。

    cron.jobType

    int

    cron作业类型。取值范围:0~6。

    cron.second

    int

    秒。取值范围:0~59。

    cron.minute

    int

    分钟。取值范围:0~59。

    cron.hour

    int

    小时。取值范围:0~23。

    protocolList

    List

    协议列表。具体参数说明请参见表1

    表1 protocolList参数说明

    参数名

    是否必选

    参数类型

    备注

    protocolList.host

    String

    数据源IP。

    protocolList.port

    String

    数据源端口,取值范围为:1~65535。

    protocolList.userName

    String

    数据源名称。

    protocolList.password

    String

    数据源密码。

    protocolList.path

    String

    数据源路径。

    protocolList.database

    String

    数据库名(数据源为Database使用)。

    protocolList.tables

    String

    表名(数据源为Database使用)。

    protocolList.protocolVersion

    String

    数据库版本(数据源为Database使用)。

    protocolList.dataTable

    String

    硬盘数据表(数据源为硬盘使用)。

    protocolList.dataId

    String

    硬盘数据ID(数据源为硬盘使用)。

    protocolList.localhost

    String

    采集机IP(数据源为Corba使用)。

    protocolList.sslMode

    String

    SSL认证(数据源为Corba使用)。

    protocolList.kafkaId

    String

    kafkaId(数据源为Kafka使用)。

    protocolList.brokers

    String

    kafka集群地址(数据源为Kafka使用)。

    protocolList.principal

    String

    kerberos用户(数据源为Kafka使用)。

    protocolList.truststorePassword

    String

    truststore证书密码(数据源为Kafka使用)。

    protocolList.keystorePassword

    String

    keystore证书密码(数据源为Kafka使用)。

    protocolList.sslMode

    String

    SSL认证(数据源为Corba使用)。

响应

  • 响应样例
    {"success":true,"returnData":"fcbca5cf75394b0295ef099d062d36a3"}
  • 要素说明

    参数名

    参数类型

    备注

    success

    boolean

    请求是否成功。

    returnData

    Object

    返回值。

状态码

具体请参考状态码

分享:

    相关文档

    相关产品