Call the UpdateCollector to update the collector instance information.
Debugging
Request header
This operation uses only the common request header. For more information, see Common request parameters.
Request structure
PUT /openapi/collectors/[ResId] HTTP/1.1
Request parameters
Parameter | Type | Position | Required | Example | Description |
---|---|---|---|---|---|
ResId | String | Path | Yes | ct-cn-77uqof2s7rg5c**** |
The collector instance ID. |
ClientToken | String | Query | No | 5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
This parameter is used to ensure the idempotence of the request. The value of this parameter is generated by the client and is unique among different requests. The maximum length is 64 ASCII characters. |
RequestBody
The following parameters must be filled in the RequestBody to specify the configuration information of the collector to be updated.
HTTP status code |
Type |
Required |
Example |
Description |
---|---|---|---|---|
dryRun |
boolean |
Yes |
false |
Whether to verify and update the collector. Optional values: true (only check but not update), false (check and update). |
name |
String |
Yes |
ct-test |
The name of the collector. |
status |
String |
Yes |
activing |
The collector status. Optional values: active (in effect) and active (in effect). |
resType |
String |
Yes |
fileBeat |
The collector type. Optional values: fileBeat, metricBeat, heartBeat, auditBeat. |
vpcId |
String |
Yes |
vpc-bp16k1dvzxtma***** |
Virtual Private Cloud ID. where the collector is located |
resVersion |
String |
Yes |
6.8.5_with_community |
The collector version. |
ownerId |
String |
Yes |
16852099488***** |
The ID of the Alibaba Cloud account. |
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 collector update time. |
collectorPaths |
List<String> |
No |
["/var/log"] |
Filebeat collection path. |
configs |
List |
Yes |
The configuration file information of the collector. |
|
└fileName |
String |
Yes |
filebeat.yml |
The name of the mezzanine file. |
└content |
String |
Yes |
"filebeat.inputs:xxx" |
The content of the remote file. |
extendConfigs |
Array |
Yes |
Collector expansion configuration. |
|
└configType |
String |
Yes |
collectorElasticsearchForKibana |
The type of the configuration. Optional values: collectorTargetInstance (collector Output), collectorDeployMachine (collector's deployment machine), collector Elasticsearch ForKibana (Elasticsearch instance information supporting Kibana dashboard). |
└type |
String |
Yes |
ECSInstanceId |
The type of machine that the collector is deployed. Optional values: ECSInstanceId(ECS), ACKCluster (Container Kubernetes). Required when the configType is collectorDeployMachine. |
└machines |
Array |
An array of node roles. |
The list of ECS machines deployed by the collector. Required when the configType is collectorDeployMachines and the type is ECSInstanceId. |
|
└└instanceId |
String |
No |
i-bp13y63575oypr9d**** |
The list of ECS machine IDs. |
└└agentStatus |
String |
No |
failed |
The status of each collector on ECS. Optional values: heartOk (normal heartbeat), heartLost (abnormal heartbeat), uninstalled (not installed), failed (installation failed). |
└groupId |
String |
default_ct-cn-5i2l75bz4776**** |
The ID of the host group. Required when the configType is collectorDeployMachine. |
|
└instanceId |
String |
Yes |
es-cn-nif1z89fz003i**** |
The instance ID associated with the collector. When the configType is collectorTargetInstance, the instance ID of collector Output; When the configType is collectorDeployMachines and the type is ACKCluster, it is ACK cluster ID. |
└protocol |
String |
Yes |
HTTP |
The transmission protocol needs to be consistent with the access protocol of the instance specified by the collector Output. Optional values HTTP and HTTPS. Required when the configType is collectorTargetInstance. |
└userName |
String |
Yes |
elastic |
Output specifies the user name of the instance. The default name is elastic. Required when the configType is collectorTargetInstance or collectorElasticsearchForKibana. |
└enableMonitoring |
Boolean |
Yes |
true |
Whether to enable Monitoring is required when the configType is collectorTargetInstance and the instanceType is Elasticsearch. Optional values: true (enabled) and false (not enabled). |
└hosts |
List<String> |
No |
["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"] |
Collector Output specifies the list of access addresses of the instance. Required when the configType is collectorTargetInstance. |
└instanceType |
String |
Yes |
elasticsearch |
The instance type specified by the collector Output. Optional value: Elasticsearch , logstash. Required when the configType is collectorTargetInstance. |
└host |
String |
No |
es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601 |
The private network access address of Kibana after Kibana Dashboard is enabled. Required when the configType is collectorElasticsearchForKibana. |
└kibanaHost |
String |
No |
https://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601 |
The Internet access address of Kibana after Kibana Dashboard is enabled. Required when the configType is collectorElasticsearchForKibana. |
Special parameter description
extendConfigs There are three configType types, namely, collectorTargetInstance, collectorElasticsearchForKibana and collectorDeployMachine. The deployment machines are different and the parameters to be configured are different. The specific combination method is as follows:
- 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
-
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D*** |
The ID of the request. |
Result | Struct |
The returned results. |
|
collectorPaths | List | ["/var/log"] |
The acquisition path of Filebeat. |
configs | Array of configs |
The configuration file information of the collector. |
|
content | String | filebeat.inputs:xxx |
File content |
fileName | String | filebeat.yml |
File Name |
dryRun | Boolean | false |
Whether to verify and create a collector. Then, you can perform the following operations:
|
extendConfigs | Array of extendConfigs |
The extended parameter information. |
|
configType | String | collectorDeployMachine |
The type of the configuration. Then, you can perform the following operations:
|
enableMonitoring | Boolean | true |
Whether to enable Monitoring, when configType For collectorTargetInstance , and instanceType For elasticsearch When displayed. True (enabled) and false (not enabled) are supported. |
groupId | String | default_ct-cn-5i2l75bz4776**** |
machine group ID. When configType For collectorDeployMachine When displayed. |
host | String | es-cn-n6w1o1x0w001c****-kibana.internal.elasticsearch.aliyuncs.com:5601 |
The private network access address of Kibana after Kibana Dashboard is enabled. When configType For collectorElasticsearchForKibana When displayed. |
hosts | List | ["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"] |
Collector Output specifies the list of access addresses of the instance. When configType For collectorTargetInstance When displayed. |
instanceId | String | es-cn-nif1z89fz003i**** |
The instance ID associated with the collector. When configType For collectorTargetInstance is the instance ID of the collector Output; when configType For collectorDeployMachines , and type For ACKCluster is the ACK (Container Kubernetes) cluster ID. |
instanceType | String | elasticsearch |
The instance type specified by the collector Output. Support Elasticsearch , logstash. When configType For collectorTargetInstance When displayed. |
kibanaHost | String | https://es-cn-nif1z89fz003i****.kibana.elasticsearch.aliyuncs.com:5601 |
The Internet access address of Kibana after Kibana Dashboard is enabled. When configType For collectorElasticsearchForKibana When displayed. |
machines | Array of machines |
collectorDeployMachine type specific: Deploy ECS machine /ACK cluster information |
|
agentStatus | String | heartOk |
The status of each collector on ECS. Then, you can perform the following operations:
|
instanceId | String | i-bp13y63575oypr9d**** |
The list of ECS machine IDs. |
protocol | String | HTTP |
The transmission protocol needs to be consistent with the access protocol of the instance specified by the collector Output. HTTP and HTTPS are supported. When configType For collectorTargetInstance When displayed. |
successPodsCount | String | 8 |
The number of all successfully collected pod nodes of the ACK cluster. When configType For collectorDeployMachines , and type For ACKCluster When displayed. |
totalPodsCount | String | 10 |
The number of all collected pod nodes of the ACK cluster. When configType For collectorDeployMachines , and type For ACKCluster When displayed. |
type | String | ECSInstanceId |
The type of machine deployed by the collector, when configType For collectorDeployMachine When displayed. Then, you can perform the following operations:
|
userName | String | elastic |
Output specifies the user name of the instance. The default name is elastic. When configType For collectorTargetInstance or collectorElasticsearchForKibana When displayed. |
gmtCreatedTime | String | 2020-06-20T07:26:47.000+0000 |
The time when the collector was created. |
gmtUpdateTime | String | 2020-06-20T07:26:47.000+0000 |
The collector update time. |
name | String | ct-test |
The name of the collector. |
ownerId | String | 16852099488***** |
The ID of the Alibaba Cloud account. |
resId | String | ct-cn-0v3xj86085dvq**** |
The collector instance ID. |
resType | String | fileBeat |
The collector type. FileBeat, metricBeat, heartBeat, and auditBeat are supported. |
resVersion | String | 6.8.5_with_community |
The collector version. |
status | String | active |
The collector status. Then, you can perform the following operations:
|
vpcId | String | vpc-bp16k1dvzxtma***** |
Virtual Private Cloud ID. where the collector is located |
Examples
Sample requests
PUT /openapi/collectors/ct-cn-77uqof2s7rg5c**** HTTP/1.1 public request header {"dryrun": false, "name": "fileBeat", "resVersion": "6.8.5_with_community", "extendConfigs": [ { "instanceId": "es-cn-sfd", "configType": "collectorElasticsearchForKibana", "hosts": [ "es-cn-abc.elasticsearch.aliyuncs.com:9200", "es-cn-abd.elasticsearch.aliyuncs.com:9200" ], "userName": "elastic", "password": "******", "protocol": "https" }, { "instanceId": "ec-cn-targ", "instanceType": "elasticsearch", "configType": "collectorTargetInstance", "hosts": [ "es-cn-abc.elasticsearch.aliyuncs.com:9200", "es-cn-abd.elasticsearch.aliyuncs.com:9200" ], "userName": "elastic", "password": "******", "protocol": "https" }, { "values": [ { "instanceId": "id1" }, { "instanceId": "id2" } ], "type": "ECSInstanceId", "configType": "collectorDeployMachine" } ], "resType": "fileBeat", "vpcId": "vpc-cn-abc", "configs": [ { "fileName": "filebeat.yml", "content": "filebeat.inputs:xxx" } ] }
Sample success responses
JSON
format
{ "RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D***", "Result": { "configs": { "fileName": "filebeat.yml", "content": "filebeat.inputs:xxx" }, "dryRun": false, "resType": "fileBeat", "ownerId": "16852099488*****", "resId": "ct-cn-0v3xj86085dvq****", "collectorPaths": ["/var/log"], "gmtUpdateTime": "2020-06-20T07:26:47.000+0000", "extendConfigs": [ { "enableMonitoring": true, "groupId": "default_ct-cn-5i2l75bz4776****", "instanceType": "elasticsearch", "type": "ECSInstanceId", "userName": "elastic", "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": { "agentStatus": "heartOk", "instanceId": "i-bp13y63575oypr9d****" } }, { "hosts": ["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"] } ], "resVersion": "6.8.5_with_community", "vpcId": "vpc-bp16k1dvzxtma*****", "name": "ct-test", "gmtCreatedTime": "2020-06-20T07:26:47.000+0000", "status": "active" } }
Error codes
For a list of error codes, visit the API Error Center.