調用DescribeCollector,擷取採集器執行個體的詳細資料。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
要求標頭
該介面使用公用要求標頭,無特殊要求標頭。請參見公用請求參數文檔。
請求文法
GET /openapi/collectors/[ResId] HTTP/1.1
請求參數
| 名稱 | 類型 | 位置 | 是否必選 | 樣本值 | 描述 |
| ResId | String | Path | 是 | ct-cn-rg31ahn82m0qd**** | 採集器執行個體ID。 |
返回資料
| 名稱 | 類型 | 樣本值 | 描述 |
| RequestId | String | 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1**** | 請求ID。 |
| Result | Struct | 返回結果。 |
|
| collectorPaths | List | ["/var/log"] | Filebeat採集路徑。 |
| configs | Array of configs | 採集器的設定檔資訊。 |
|
| content | String | fileBeat.inputs:xxx | 檔案內容。 |
| fileName | String | filebeat.yml | 檔案名稱。 |
| dryRun | Boolean | false | 是否校正並建立採集器。支援:
|
| extendConfigs | Array of extendConfigs | 採集器擴充配置。 |
|
| configType | String | collectorDeployMachine | 配置類型。支援:
|
| enableMonitoring | Boolean | true | 是否啟用Monitoring,當configType為collectorTargetInstance時顯示。支援:
|
| groupId | String | default_ct-cn-5i2l75bz4776**** | 機器組ID。當configType為collectorDeployMachine時顯示。 |
| host | String | es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601 | 啟用Kibana Dashboard後,Kibana的私網地址。當configType為collectorElasticsearchForKibana時顯示。 |
| hosts | List | ["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"] | 採集器Output指定執行個體的訪問地址清單。當configType為collectorTargetInstance時顯示。 |
| instanceId | String | es-cn-n6w1o1**** | 採集器關聯的執行個體ID。當configType為collectorTargetInstance時,為採集器Output的執行個體ID;當configType為collectorDeployMachines,且type為ACKCluster時,為ACK(容器Kubernetes)叢集ID。 |
| instanceType | String | elasticsearch | 採集器Output指定的執行個體類型。支援elasticsearch、logstash。當configType為collectorTargetInstance時顯示。 |
| kibanaHost | String | https://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601 | 啟用Kibana Dashboard後,Kibana的公網訪問地址。當configType為collectorElasticsearchForKibana時顯示。 |
| machines | Array of machines | 採集器所部署的ECS機器列表資訊。當configType為collectorDeployMachines,且type為ECSInstanceId時顯示。 |
|
| agentStatus | String | heartOk | ECS上各採集器的狀態。支援:
|
| instanceId | String | i-bp1gyhphjaj73jsr**** | ECS機器ID列表。 |
| protocol | String | HTTP | 傳輸協議,需要與採集器Output指定執行個體的訪問協議保持一致。支援HTTP、HTTPS。當configType為collectorTargetInstance時顯示。 |
| successPodsCount | String | 8 | ACK叢集所有採集成功的Pod節點數。 |
| totalPodsCount | String | 10 | ACK叢集所有採集的Pod節點數。 |
| type | String | ECSInstanceId | 採集器部署的機器類型,當configType為collectorDeployMachine時顯示。支援:
|
| userName | String | elastic | 採集器Output指定執行個體的訪問使用者名稱,預設為elastic。當configType為collectorTargetInstance或collectorElasticsearchForKibana時顯示。 |
| gmtCreatedTime | String | 2020-06-20T07:26:47.000+0000 | 採集器建立時間。 |
| gmtUpdateTime | String | 2020-06-20T07:26:47.000+0000 | 採集器更新時間。 |
| name | String | ct-cn-4135is2tj194p**** | 採集器名稱。 |
| ownerId | String | 16852099488***** | 帳號ID。 |
| resId | String | ct-cn-rg31ahn82m0qd**** | 採集器執行個體ID。 |
| resType | String | fileBeat | 採集器類型。支援fileBeat、metricBeat、heartBeat和auditBeat。 |
| resVersion | String | 6.8.5_with_community | 採集器版本。 |
| status | String | active | 採集器狀態。支援:
|
| vpcId | String | vpc-bp16k1dvzxtma***** | 採集器所在的專用網路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****"
}
]
}
錯誤碼
訪問錯誤中心查看更多錯誤碼。