UpdateCollector

Updated at:

Modifies the configuration of a collector.

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:UpdateCollector

update

*collectors

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

None None

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

ResId

string

Yes

The collector instance ID.

ct-cn-77uqof2s7rg5c****

Request parameters

Parameter

Type

Required

Description

Example

ClientToken

string

No

The client token that is used to ensure the idempotence of the request. The value is generated by the client and must be unique across different requests. The value can be up to 64 ASCII characters in length.

5A2CFF0E-5718-45B5-9D4D-70B3FF****

body

string

No

The collector configuration to be updated, in JSON string format.

{"name":"collector-demo","resType":"fileBeat","resVersion":"6.8.5_with_community","vpcId":"vpc-bp1example123456789","collectorPaths":["/var/log/app.log"],"extendConfigs":[{"configType":"collectorDeployMachine","type":"ECSInstanceId","machines":[{"instanceId":"i-bp1example123456789"}]},{"configType":"collectorTargetInstance","instanceType":"elasticsearch","instanceId":"es-cn-example12345678","protocol":"HTTP","hosts":["es-cn-example12345678.elasticsearch.aliyuncs.com:9200"],"userName":"elastic","password":"ExamplePwd123!","enableMonitoring":false}]}

RequestBody

You must also specify the following parameters in the request body to configure the collector to be updated.

ParameterTypeRequiredExampleDescription
dryRunbooleanYesfalseSpecifies whether to verify and update the collector. Valid values: true (verifies the configuration without updating the collector) and false (verifies the configuration and updates the collector).
nameStringYesct-testThe name of the collector.
statusStringYesactivingThe status of the collector. Valid values: activing (taking effect) and active (effective).
resTypeStringYesfileBeatThe type of the collector. Valid values: fileBeat, metricBeat, heartBeat, and auditBeat.
vpcIdStringYesvpc-bp16k1dvzxtma*****The ID of the VPC where the collector is deployed.
resVersionStringYes6.8.5_with_communityThe version of the collector.
ownerIdStringYes16852099488*****The account ID.
gmtCreatedTimeDateYes2020-06-20T07:26:47.000+0000The time when the collector was created.
gmtUpdateTimeDateYes2020-06-20T07:26:47.000+0000The time when the collector was updated.
collectorPathsListNo["/var/log"]The Filebeat collection paths.
configsListYesThe configuration file information of the collector.
└fileNameStringYesfilebeat.ymlThe name of the file.
└contentStringYes"filebeat.inputs:xxx"The content of the file.
extendConfigsArrayYesThe extension configurations of the collector.
└configTypeStringYescollectorElasticsearchForKibanaThe configuration type. Valid values: collectorTargetInstance (the output of the collector), collectorDeployMachine (the deployment machine of the collector), and collectorElasticsearchForKibana (the information about the Elasticsearch instance that supports the Kibana dashboard).
└typeStringYesECSInstanceIdThe type of the deployment machine for the collector. Valid values: ECSInstanceId (ECS instance) and ACKCluster (ACK cluster). This parameter is required when configType is set to collectorDeployMachine.
└machinesArrayNoThe list of ECS instances for collector deployment. This parameter is required when configType is set to collectorDeployMachines and type is set to ECSInstanceId.
└└instanceIdStringNoi-bp13y63575oypr9d****The list of ECS instance IDs.
└└agentStatusStringNofailedThe status of each collector on the ECS instance. Valid values: heartOk (normal heartbeat), heartLost (abnormal heartbeat), uninstalled (not installed), and failed (installation failed).
└groupIdStringNodefault_ct-cn-5i2l75bz4776****The ID of the machine group. This parameter is required when configType is set to collectorDeployMachine.
└instanceIdStringYeses-cn-nif1z89fz003i****The instance ID of the instance associated with the collector. If configType is set to collectorTargetInstance, this parameter indicates the instance ID of the instance specified by the collector output. If configType is set to collectorDeployMachines and type is set to ACKCluster, this parameter indicates the instance ID of the ACK cluster.
└protocolStringYesHTTPThe transmission protocol, which must be consistent with the access protocol of the instance specified by the collector output. Valid values: HTTP and HTTPS. This parameter is required when configType is set to collectorTargetInstance.
└userNameStringYeselasticThe username used to access the instance specified by the collector output. Default value: elastic. This parameter is required when configType is set to collectorTargetInstance or collectorElasticsearchForKibana.
└enableMonitoringBooleanYestrueSpecifies whether to enable monitoring. This parameter is required when configType is set to collectorTargetInstance and instanceType is set to elasticsearch. Valid values: true (enables monitoring) and false (disables monitoring).
└hostsListNo["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"]The list of access addresses of the instance specified by the collector output. This parameter is required when configType is set to collectorTargetInstance.
└instanceTypeStringYeselasticsearchThe type of the instance specified by the collector output. Valid values: elasticsearch and logstash. This parameter is required when configType is set to collectorTargetInstance.
└hostStringNoes-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601The internal-facing access address of Kibana over the private network after the Kibana dashboard is enabled. This parameter is required when configType is set to collectorElasticsearchForKibana.
└kibanaHostStringNohttps://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601The public network access address of Kibana after the Kibana dashboard is enabled. This parameter is required when configType is set to collectorElasticsearchForKibana.
Note

└ indicates a child parameter.

Special parameter descriptions

extendConfigs includes three configType values: collectorTargetInstance, collectorElasticsearchForKibana, and collectorDeployMachine. The parameters that you must configure 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

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

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

Result

object

The result.

resId

string

The collector instance ID.

ct-cn-0v3xj86085dvq****

gmtUpdateTime

string

The time when the collector was updated.

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

dryRun

boolean

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

  • true: Verifies the configuration without creating the collector.

  • false: Verifies the configuration and creates the collector.

false

ownerId

string

The account ID.

16852099488*****

vpcId

string

The ID of the VPC where the collector is deployed.

vpc-bp16k1dvzxtma*****

resType

string

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

fileBeat

resVersion

string

The version of the collector.

6.8.5_with_community

gmtCreatedTime

string

The time when the collector was created.

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

status

string

The status of the collector. Valid values:

  • activing: Taking effect.

  • active: Effective.

active

name

string

The name of the collector.

ct-test

configs

array<object>

The configuration file information of the collector.

object

content

string

The content of the file.

filebeat.inputs:xxx

fileName

string

The name of the file.

filebeat.yml

extendConfigs

array<object>

The extended configuration information.

array<object>

successPodsCount

string

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

8

protocol

string

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

HTTP

userName

string

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

elastic

totalPodsCount

string

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

10

type

string

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

  • ECSInstanceId: ECS instance.

  • ACKCluster: ACK cluster.

ECSInstanceId

kibanaHost

string

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

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

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 (enables monitoring) and false (disables monitoring).

true

configType

string

The configuration type. Valid values:

  • collectorTargetInstance: the output of the collector.

  • collectorDeployMachine: the machine on which the collector is deployed.

  • collectorElasticsearchForKibana: the information about the Elasticsearch instance that supports the Kibana dashboard.

collectorDeployMachine

instanceType

string

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

elasticsearch

groupId

string

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

default_ct-cn-5i2l75bz4776****

host

string

The internal-facing access address of Kibana over the private network after the Kibana dashboard is enabled. This parameter is displayed when configType is set to collectorElasticsearchForKibana.

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

instanceId

string

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

es-cn-nif1z89fz003i****

machines

array<object>

Applicable only to the collectorDeployMachine type:

The information about the ECS instances or ACK cluster on which the collector is deployed.

object

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

instanceId

string

The list of ECS instance IDs.

i-bp13y63575oypr9d****

hosts

array

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

string

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

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

collectorPaths

array

The list of Filebeat collection paths.

string

The Filebeat collection path.

["/var/log"]

Examples

Success response

JSON format

{
  "RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D***",
  "Result": {
    "resId": "ct-cn-0v3xj86085dvq****",
    "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-test",
    "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-nif1z89fz003i****",
        "machines": [
          {
            "agentStatus": "heartOk",
            "instanceId": "i-bp13y63575oypr9d****"
          }
        ],
        "hosts": [
          "[\"es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200\"]"
        ]
      }
    ],
    "collectorPaths": [
      "[\"/var/log\"]"
    ]
  }
}

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.