CreateCollector
创建采集器,采集指定服务上的数据
服务地址:
华东1 金融云
输入参数
只看必填
clientToken用于保证请求的幂等性
body请求体参数
dryRun是否校验并创建采集器
请选择布尔值
name采集器名称
resType采集器类型
vpcId采集器所在的专有网络ID
resVersion采集器版本
collectorPathsfileBeat采集路径
0fileBeat采集路径
configs采集器的配置文件信息
0采集器的配置文件信息
fileName文件名
content文件内容
extendConfigs采集器扩展配置
0采集器扩展配置
插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

请求语法

POST /openapi/collectors HTTP/1.1

请求参数

字段名称字段详情
clientTokenstring

用于保证请求的幂等性。由客户端生成该参数值,要保证在不同请求间唯一,最大不超过 64 个 ASCII 字符。

示例值:5A2CFF0E-5718-45B5-9D4D-70B3FF****
bodyobject

请求体参数。用来指定待创建采集器的配置信息。

示例值:{ "dryRun": false, "name": "test_beats_1", "resType": "fileBeat", "resVersion": "6.8.5_with_community", "vpcId": "vpc-bp12nu14urf0upaf*****", "collectorPaths": [ "/var/log" ], "configs": [ { "fileName": "filebeat.yml", "content": "filebeat.inputs:xxx" } ] }

请求说明

extendConfigs 参数说明

extendConfigs 中的参数含义如下。

名称类型是否必选示例值描述
extendConfigsArray采集器扩展配置。
└configTypeStringcollectorElasticsearchForKibana配置类型。可选值:collectorTargetInstance(采集器 Output)、collectorDeployMachine(采集器的部署机器)、collectorElasticsearchForKibana(支持 Kibana 仪表盘的 Elasticsearch 实例信息)。
└typeStringECSInstanceId采集器部署的机器类型。可选值:ECSInstanceId(ECS)、ACKCluster(容器 Kubernetes)。当 configTypecollectorDeployMachine 时必填。
└instanceTypeStringelasticsearch采集器 Output 指定的实例类型。可选值:elasticsearch、logstash。当 configTypecollectorTargetInstance 时必填。
└instanceIdStringes-cn-nif201ihd0012****采集器关联的实例 ID。当 configTypecollectorTargetInstance 时,为采集器 Output 的实例 ID;当 configTypecollectorDeployMachines,且 typeACKCluster 时,为 ACK 集群 ID。
└machinesArray采集器所部署的 ECS 机器列表信息。当 configTypecollectorDeployMachines,且 typeECSInstanceId 时,必填。
└└instanceIdStringi-bp11u91xgubypcuz****ECS 机器 ID 列表。
└groupIdStringdefault_ct-cn-5i2l75bz4776****机器组 ID。当 configTypecollectorDeployMachine 时,必填。
└protocolStringHTTP传输协议,需要与采集器 Output 指定实例的访问协议保持一致。可选值:HTTP、HTTPS。当 configTypecollectorTargetInstance 时必填。
└userNameStringelastic采集器 Output 指定实例的访问用户名,默认为 elastic。当 configTypecollectorTargetInstancecollectorElasticsearchForKibana 时必填。
└passwordString*****对应用户名的密码。
└enableMonitoringBooleantrue是否启用 Monitoring,当 configTypecollectorTargetInstance,且 instanceTypeelasticsearch 时必填。可选值:true(启用)、false(不启用)。
└hostsList["es-cn-nif201i*****.elasticsearch.aliyuncs.com:9200"]采集器 Output 指定实例的访问地址列表。当 configTypecollectorTargetInstance 时必填。
└hostStringes-cn-nif201ihd0012****-kibana.internal.elasticsearch.aliyuncs.com:5601启用 Kibana Dashboard 后,Kibana 的私网访问地址。当 configTypecollectorElasticsearchForKibana 时必填。
└kibanaHostStringhttps://es-cn-nif201ihd0012****.kibana.elasticsearch.aliyuncs.com:5601启用 Kibana Dashboard 后,Kibana 的公网访问地址。当 configTypecollectorElasticsearchForKibana 时必填。
说明 └表示子参数。

extendConfigs 中包括 3 种 configType,分别为 collectorTargetInstance、collectorElasticsearchForKibana、collectorDeployMachine,部署机器不同,需要配置的参数不同,具体组合方式如下:

  • collectorTargetInstance

    • ECS configType、instanceId、instanceType、hosts、userName、password、protocol、enableMonitoring
    • ACK configType、instanceId、instanceType、userName、password、protocol、enableMonitoring
  • collectorElasticsearchForKibana

    • ECS configType、instanceId、host、kibanaHost、userName、password、protocol
    • ACK configType
  • collectorDeployMachine

    • ECS configType、type、machines、groupId
    • ACK configType、type、instanceId

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:8466BDFB-C513-4B8D-B4E3-5AB256AB****
Resultobject

返回结果。

变更历史
变更时间变更内容概要操作
2022-12-28
新增请求参数body
  • 1
  • 2
  • 10 条/页