ListCollectors

Updated at:

Retrieves the list of collectors.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

elasticsearch:ListCollectors

get

*All Resource

*

None None

Request syntax

GET /openapi/collectors HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

resId

string

No

The collector ID.

ct-cn-77uqof2s7rg5c****

name

string

No

The collector name.

collectorName1

instanceId

string

No

The instance ID associated with the collector.

es-cn-nif1q8auz0003****

page

integer

No

The page number of the returned results. Default value: 1. Minimum value: 1. Maximum value: 200.

1

size

integer

No

The number of results per page. Default value: 20. Minimum value: 1. Maximum value: 500.

10

sourceType

string

No

Specifies the type of machine on which the collector is deployed. If you do not specify this parameter, all types are returned. Valid values:

  • ECS: ECS instance

  • ACK: ACK cluster

ECS

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Headers

object

The response headers.

X-Total-Count

integer

The number of returned records.

5

Result

array<object>

The returned results.

array<object>

configs

array<object>

The configuration file information of the collector.

object

fileName

string

The file name.

fields.yml

content

string

The file content.

- key: log\n title: Log file content\n description: >\n Contains log file lines.\n ....

dryRun

boolean

Specifies whether to verify and create the collector. Valid values:

  • true: only verifies the collector without creating it

  • false: verifies and creates the collector

false

resType

string

The collector type. Valid values: fileBeat, metricBeat, heartBeat, and auditBeat.

fileBeat

ownerId

string

The account ID.

168520994880****

resId

string

The collector instance ID.

ct-cn-0v3xj86085dvq****

collectorPaths

array

The list of Filebeat collection paths.

string

The Filebeat collection path.

["/var/log"]

gmtUpdateTime

string

The time when the collector was updated.

2020-08-18T09:40:43.000+0000

extendConfigs

array<object>

The extended parameter information.

array<object>

enableMonitoring

boolean

Specifies whether to enable Monitoring. This parameter is displayed when configType is set to collectorTargetInstance and instanceType is set to elasticsearch. Valid values:

  • true: enabled

  • false: disabled

true

hosts

array

The list of host addresses of the target instance for the collector.

string

The list of access addresses of the instance specified in the collector output. This parameter is displayed when configType is set to collectorTargetInstance.

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

instanceType

string

The type of the instance specified in the collector output. Valid values: elasticsearch and logstash. This parameter is displayed when configType is set to collectorTargetInstance.

elasticsearch

groupId

string

The machine group ID. This parameter is displayed when configType is set to collectorDeployMachine.

default_ct-cn-5i2l75bz4776****

userName

string

The username used to access the instance specified in the collector output. Default value: elastic. This parameter is displayed when configType is set to collectorTargetInstance or collectorElasticsearchForKibana.

elastic

type

string

The type of machine on which the collector is deployed. This parameter is displayed when configType is set to collectorDeployMachine. Valid values:

  • ECSInstanceId: ECS

  • ACKCluster: ACK cluster

ECSInstanceId

configType

string

The configuration type. Valid values:

  • collectorTargetInstance: the collector output

  • collectorDeployMachine: the machine on which the collector is deployed

  • collectorElasticsearchForKibana: the information about the Elasticsearch instance that supports Kibana dashboards

collectorDeployMachine

protocol

string

The transmission protocol, which must be consistent with the access protocol of the instance specified in the collector output. Valid values: HTTP and HTTPS. This parameter is displayed when configType is set to collectorTargetInstance.

HTTP

instanceId

string

Instance ID of the instance associated with the collector. When configType is set to collectorTargetInstance, this parameter indicates instance ID of the instance in the collector output. When configType is set to collectorDeployMachines and type is set to ACKCluster, this parameter indicates the ACK cluster ID.

es-cn-nif1z89fz003i****

host

string

The private network access address of Kibana after Kibana Dashboard is enabled. This parameter is displayed when configType is set to collectorElasticsearchForKibana.

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

kibanaHost

string

The public network access address of Kibana after Kibana Dashboard is enabled. This parameter is displayed when configType is set to collectorElasticsearchForKibana.

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

totalPodsCount

string

The total number of pods collected in the ACK cluster. This parameter is displayed when configType is set to collectorDeployMachines and type is set to ACKCluster.

10

successPodsCount

string

The number of pods successfully collected in the ACK cluster. This parameter is displayed when configType is set to collectorDeployMachines and type is set to ACKCluster.

8

machines

array<object>

The list of ECS instances on which the collector is deployed. This parameter is displayed when configType is set to collectorDeployMachines and type is set to ECSInstanceId.

object

instanceId

string

The list of ECS instance IDs.

i-bp13y63575oypr9d****

agentStatus

string

The status of each collector on the ECS instance. Valid values:

  • heartOk: The heartbeat is normal.

  • heartLost: The heartbeat is abnormal.

  • uninstalled: The collector is not installed.

  • failed: The installation failed.

heartOk

resVersion

string

The collector version.

6.8.5_with_community

vpcId

string

The ID of the VPC where the collector resides.

vpc-bp16k1dvzxtma*****

name

string

The collector name.

FileBeat001

gmtCreatedTime

string

The time when the collector was created.

2020-08-18T02:06:12.000+0000

status

string

The collector status. Valid values:

  • activing: taking effect

  • active: effective

active

extendConfigs includes three types of configType: collectorTargetInstance, collectorElasticsearchForKibana, and collectorDeployMachine. The returned parameters vary based on the deployment machine. The specific combinations are as follows:

  • collectorTargetInstance

    • ECS configType, instanceId, instanceType, hosts, userName, password, protocol, and enableMonitoring

    • ACK configType, instanceId, instanceType, userName, password, protocol, and enableMonitoring

  • collectorElasticsearchForKibana

    • ECS configType, instanceId, host, kibanaHost, userName, password, and protocol

    • ACK configType

  • collectorDeployMachine

    • ECS configType, type, machines, and groupId

    • ACK configType, type, instanceId, totalPodsCount, and successPodsCount

Examples

Success response

JSON format

{
  "RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****",
  "Headers": {
    "X-Total-Count": 5
  },
  "Result": [
    {
      "configs": [
        {
          "fileName": "fields.yml",
          "content": "- key: log\\n title: Log file content\\n description: >\\n Contains log file lines.\\n ...."
        }
      ],
      "dryRun": false,
      "resType": "fileBeat",
      "ownerId": "168520994880****",
      "resId": "ct-cn-0v3xj86085dvq****",
      "collectorPaths": [
        "[\"/var/log\"]"
      ],
      "gmtUpdateTime": "2020-08-18T09:40:43.000+0000",
      "extendConfigs": [
        {
          "enableMonitoring": true,
          "hosts": [
            "[\"es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200\"]"
          ],
          "instanceType": "elasticsearch",
          "groupId": "default_ct-cn-5i2l75bz4776****",
          "userName": "elastic",
          "type": "ECSInstanceId",
          "configType": "collectorDeployMachine",
          "protocol": "HTTP",
          "instanceId": "es-cn-nif1z89fz003i****",
          "host": "es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601",
          "kibanaHost": "https://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601",
          "totalPodsCount": "10",
          "successPodsCount": "8",
          "machines": [
            {
              "instanceId": "i-bp13y63575oypr9d****",
              "agentStatus": "heartOk"
            }
          ]
        }
      ],
      "resVersion": "6.8.5_with_community",
      "vpcId": "vpc-bp16k1dvzxtma*****",
      "name": "FileBeat001",
      "gmtCreatedTime": "2020-08-18T02:06:12.000+0000",
      "status": "active"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.