调用DescribeCollector,获取采集器实例的详细信息。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
GET /openapi/collectors/[ResId] HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
ResId | String | Path | 是 | ct-cn-rg31ahn82m0qd**** |
采集器实例ID。 |
返回数据
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、totalPodsCount、successPodsCount
-
示例
请求示例
GET /openapi/collectors/ct-cn-6z8b5eblvi706**** HTTP/1.1
公共请求头
正常返回示例
JSON
格式
{
"name": "filebeats",
"resVersion": "6.8.5_with_community",
"resId": "ct-cn-6fy17c8z99c7i****",
"resType": "fileBeat",
"ownerId": "168520994880****",
"status": "active",
"vpcId": "vpc-bp16k1dvzxtmagcva****",
"dryRun": false,
"gmtCreatedTime": "2020-11-05T12:42:47.000+0000",
"gmtUpdateTime": "2020-11-06T05:13:10.000+0000",
"collectorPaths": "/var/log/*.log",
"configs": {
"fileName": "/conf/filebeat.yml",
"content": "fileBeat.inputs:xxx"
},
"extendConfigs": [
{
"instanceId": "es-cn-n6w1o1x0w001c****",
"configType": "collectorElasticsearchForKibana",
"host": "es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601",
"kibanaHost": "https://es-cn-n6w1o1x0w001c****.kibana.elasticsearch.aliyuncs.com:5601",
"userName": "elastic",
"protocol": "HTTPS"
},
{
"instanceId": "es-cn-n6w1o1x0w001c****",
"instanceType": "elasticsearch",
"configType": "collectorTargetInstance",
"hosts": [
"es-cn-n6w1o1x0w001c****.elasticsearch.aliyuncs.com:9200",
"es-cn-nif1z89fz003i****.elasticsearch.aliyuncs.com:9200"
],
"userName": "elastic",
"protocol": "HTTPS",
"enableMonitoring": true
},
{
"machines": [
{
"instanceId": "es-cn-n6w1o1x0w001c****",
"agentStatus": "heartOk"
},
{
"instanceId": "es-cn-nif1z89fz003i****",
"agentStatus": "heartOk"
}
],
"type": "ECSInstanceId",
"configType": "collectorDeployMachine",
"groupId": "default_ct-cn-6fy17c8z99c7i****"
}
]
}
错误码
访问错误中心查看更多错误码。