UpdateCollector
Modifies the configuration of a collector.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:UpdateCollector |
update |
*collectors
|
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.
| Parameter | Type | Required | Example | Description |
| dryRun | boolean | Yes | false | Specifies 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). |
| name | String | Yes | ct-test | The name of the collector. |
| status | String | Yes | activing | The status of the collector. Valid values: activing (taking effect) and active (effective). |
| resType | String | Yes | fileBeat | The type of the collector. Valid values: fileBeat, metricBeat, heartBeat, and auditBeat. |
| vpcId | String | Yes | vpc-bp16k1dvzxtma***** | The ID of the VPC where the collector is deployed. |
| resVersion | String | Yes | 6.8.5_with_community | The version of the collector. |
| ownerId | String | Yes | 16852099488***** | The account ID. |
| gmtCreatedTime | Date | Yes | 2020-06-20T07:26:47.000+0000 | The time when the collector was created. |
| gmtUpdateTime | Date | Yes | 2020-06-20T07:26:47.000+0000 | The time when the collector was updated. |
| collectorPaths | List | No | ["/var/log"] | The Filebeat collection paths. |
| configs | List | Yes | The configuration file information of the collector. | |
| └fileName | String | Yes | filebeat.yml | The name of the file. |
| └content | String | Yes | "filebeat.inputs:xxx" | The content of the file. |
| extendConfigs | Array | Yes | The extension configurations of the collector. | |
| └configType | String | Yes | collectorElasticsearchForKibana | The 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). |
| └type | String | Yes | ECSInstanceId | The 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. |
| └machines | Array | No | The list of ECS instances for collector deployment. This parameter is required when configType is set to collectorDeployMachines and type is set to ECSInstanceId. | |
| └└instanceId | String | No | i-bp13y63575oypr9d**** | The list of ECS instance IDs. |
| └└agentStatus | String | No | failed | The status of each collector on the ECS instance. Valid values: heartOk (normal heartbeat), heartLost (abnormal heartbeat), uninstalled (not installed), and failed (installation failed). |
| └groupId | String | No | default_ct-cn-5i2l75bz4776**** | The ID of the machine group. This parameter is required when configType is set to collectorDeployMachine. |
| └instanceId | String | Yes | es-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. |
| └protocol | String | Yes | HTTP | 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 required when configType is set to collectorTargetInstance. |
| └userName | String | Yes | elastic | The 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. |
| └enableMonitoring | Boolean | Yes | true | Specifies 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). |
| └hosts | List | No | ["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. |
| └instanceType | String | Yes | elasticsearch | The type of the instance specified by the collector output. Valid values: elasticsearch and logstash. This parameter is required when configType is set to collectorTargetInstance. |
| └host | String | No | es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601 | The 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. |
| └kibanaHost | String | No | https://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601 | The public network access address of Kibana after the Kibana dashboard is enabled. This parameter is required when configType is set to collectorElasticsearchForKibana. |
└ 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:
|
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:
|
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 |
| 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:
|
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 |
| 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.