DescribeCollector - 获取采集器实例信息

更新时间:
复制 MD 格式

获取采集器实例的详细信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

elasticsearch:DescribeCollector

get

*collectors

acs:elasticsearch:{#regionId}:{#accountId}:collectors/{#collectorsId}

无 无

请求语法

GET /openapi/collectors/{ResId} HTTP/1.1

路径参数

名称

类型

必填

描述

示例值

ResId

string

是

采集器实例 ID。

ct-cn-rg31ahn82m0qd****

请求参数

名称

类型

必填

描述

示例值

当前API无需请求参数

返回参数

名称

类型

描述

示例值

object

RequestId

string

请求 ID。

5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****

Result

object

返回结果。

resId

string

采集器实例 ID。

ct-cn-rg31ahn82m0qd****

gmtUpdateTime

string

采集器更新时间。

2020-06-20T07:26:47.000+0000

dryRun

boolean

是否校验并创建采集器。支持:

  • true:只校验不创建

  • false:校验并创建

false

ownerId

string

账号 ID。

16852099488*****

vpcId

string

采集器所在的专有网络 ID。

vpc-bp16k1dvzxtma*****

resType

string

采集器类型。支持 fileBeat、metricBeat、heartBeat 和 auditBeat。

fileBeat

resVersion

string

采集器版本。

6.8.5_with_community

gmtCreatedTime

string

采集器创建时间。

2020-06-20T07:26:47.000+0000

status

string

采集器状态。支持:

  • activing:生效中

  • active:已生效

active

name

string

采集器名称。

ct-cn-4135is2tj194p****

configs

array<object>

采集器的配置文件信息。

object

content

string

文件内容。

fileBeat.inputs:xxx

fileName

string

文件名称。

filebeat.yml

extendConfigs

array<object>

采集器扩展配置。

array<object>

successPodsCount

string

ACK 集群所有采集成功的 Pod 节点数。

8

protocol

string

传输协议,需要与采集器 Output 指定实例的访问协议保持一致。支持 HTTP、HTTPS。当 configType 为 collectorTargetInstance 时显示。

HTTP

userName

string

采集器 Output 指定实例的访问用户名,默认为 elastic。当 configType 为 collectorTargetInstance 或 collectorElasticsearchForKibana 时显示。

elastic

totalPodsCount

string

ACK 集群所有采集的 Pod 节点数。

10

type

string

采集器部署的机器类型,当 configType 为 collectorDeployMachine 时显示。支持:

  • ECSInstanceId:ECS

  • ACKCluster:容器 Kubernetes

ECSInstanceId

kibanaHost

string

启用 Kibana Dashboard 后,Kibana 的公网访问地址。当 configType 为 collectorElasticsearchForKibana 时显示。

https://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601

enableMonitoring

boolean

是否启用 Monitoring,当 configType 为 collectorTargetInstance 时显示。支持:

  • true:启用

  • false:不启用

true

configType

string

配置类型。支持:

  • collectorTargetInstance:采集器 Output

  • collectorDeployMachine:采集器的部署机器

  • collectorElasticsearchForKibana:支持 Kibana 仪表盘的 Elasticsearch 实例信息

collectorDeployMachine

instanceType

string

采集器 Output 指定的实例类型。支持 elasticsearch、logstash。当 configType 为 collectorTargetInstance 时显示。

elasticsearch

groupId

string

机器组 ID。当 configType 为 collectorDeployMachine 时显示。

default_ct-cn-5i2l75bz4776****

host

string

启用 Kibana Dashboard 后,Kibana 的私网地址。当 configType 为 collectorElasticsearchForKibana 时显示。

es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601

instanceId

string

采集器关联的实例 ID。当 configType 为 collectorTargetInstance 时,为采集器 Output 的实例 ID;当 configType 为 collectorDeployMachines,且 type 为 ACKCluster 时,为 ACK(容器 Kubernetes)集群 ID。

es-cn-n6w1o1****

machines

array<object>

采集器所部署的 ECS 机器列表信息。当 configType 为 collectorDeployMachines,且 type 为 ECSInstanceId 时显示。

object

agentStatus

string

ECS 上各采集器的状态。支持:

  • heartOk:心跳正常

  • heartLost:心跳异常

  • uninstalled:未安装

  • failed:安装失败

heartOk

instanceId

string

ECS 机器 ID 列表。

i-bp1gyhphjaj73jsr****

hosts

array

采集器目标实例的主机地址列表。

string

采集器 Output 指定实例的访问地址列表。当 configType 为 collectorTargetInstance 时显示。

["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"]

collectorPaths

array

Filebeat 采集路径列表。

string

Filebeat 采集路径。

["/var/log"]

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

示例

正常返回示例

JSON格式

{
  "RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****",
  "Result": {
    "resId": "ct-cn-rg31ahn82m0qd****",
    "gmtUpdateTime": "2020-06-20T07:26:47.000+0000",
    "dryRun": false,
    "ownerId": "16852099488*****",
    "vpcId": "vpc-bp16k1dvzxtma*****",
    "resType": "fileBeat",
    "resVersion": "6.8.5_with_community",
    "gmtCreatedTime": "2020-06-20T07:26:47.000+0000",
    "status": "active",
    "name": "ct-cn-4135is2tj194p****",
    "configs": [
      {
        "content": "fileBeat.inputs:xxx",
        "fileName": "filebeat.yml"
      }
    ],
    "extendConfigs": [
      {
        "successPodsCount": "8",
        "protocol": "HTTP",
        "userName": "elastic",
        "totalPodsCount": "10",
        "type": "ECSInstanceId",
        "kibanaHost": "https://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601",
        "enableMonitoring": true,
        "configType": "collectorDeployMachine",
        "instanceType": "elasticsearch",
        "groupId": "default_ct-cn-5i2l75bz4776****",
        "host": "es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601",
        "instanceId": "es-cn-n6w1o1****",
        "machines": [
          {
            "agentStatus": "heartOk",
            "instanceId": "i-bp1gyhphjaj73jsr****"
          }
        ],
        "hosts": [
          "[\"es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200\"]"
        ]
      }
    ],
    "collectorPaths": [
      "[\"/var/log\"]"
    ]
  }
}

错误码

HTTP status code

错误码

错误信息

描述

400 ComponentCodeValueError component value is disable
401 UserNotOpen Aliyun account is not open elasticsearch
401 StsRoleAccountNoPermission Role account has no permission or expired
401 SubAccountNoPermission Aliyun sub account has no permission, please authorize your sub account in Aliyun RAM
401 UserUnauthorized Authentication required

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情。