调用UpdateCollectorName,修改采集器名称。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
调试
授权信息
|
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
|
elasticsearch:UpdateCollectorName |
update |
*全部资源
|
无 | 无 |
请求语法
POST /openapi/collectors/{ResId}/actions/rename HTTP/1.1
路径参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ResId |
string |
是 |
采集器 ID。 |
ct-cn-77uqof2s7rg5c**** |
请求参数
|
名称 |
类型 |
必填 |
描述 |
示例值 |
| ClientToken |
string |
否 |
用于保证请求的幂等性。由客户端生成该参数值,要保证在不同请求间唯一,最大不超过 64 个 ASCII 字符。 |
5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
| body |
string |
否 |
修改后的采集器名称。 |
{"name":"collectorName1"} |
RequestBody
RequestBody 中还需填入以下参数,用来指定修改后的采集器名称。 | 名称 | 类型 | 是否必选 | 示例值 | 描述 | | ---- | ---- | ---- | ---- | | name| String | 是 |collectorName1 |修改后的采集器名称。|
示例如下。
{
"name": "collectorName1"
}
返回参数
|
名称 |
类型 |
描述 |
示例值 |
|
object |
|||
| RequestId |
string |
请求 ID。 |
5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1**** |
| Result |
object |
返回结果。 |
|
| resId |
string |
采集器实例 ID。 |
ct-cn-77uqof2s7rg5c**** |
| gmtUpdateTime |
string |
采集器更新时间。格式为 YYYY-MM-DDTHH:mm:ss.SSS+HHMM,末尾为时区偏移量。 |
2020-06-20T07:26:47.000+0000 |
| dryRun |
boolean |
是否校验并创建采集器。支持:
|
false |
| ownerId |
string |
账号 ID。 |
16852099488***** |
| vpcId |
string |
采集器所在的专有网络 ID。 |
vpc-bp16k1dvzxtma***** |
| resType |
string |
采集器类型,支持 fileBeat、metricBeat、heartBeat 和 audiBeat。 |
fileBeat |
| resVersion |
string |
采集器版本。支持的版本与采集器的部署机器类型相关,具体如下:
|
6.8.5_with_community |
| gmtCreatedTime |
string |
采集器创建时间。格式为 YYYY-MM-DDTHH:mm:ss.SSS+HHMM,末尾为时区偏移量。 |
2020-06-20T07:26:47.000+0000 |
| status |
string |
采集器状态。支持 activing(生效中)和 active(已生效)。 |
active |
| name |
string |
采集器名称。 |
ct-test |
| configs |
array<object> |
采集器的配置文件信息。 |
|
|
object |
|||
| content |
string |
文件内容。 |
- key: log\n title: Log file content\n description: >\n Contains log file lines.\n .... |
| fileName |
string |
文件名。 |
fields.yml |
| extendConfigs |
array<object> |
采集器扩展配置。 |
|
|
array<object> |
|||
| successPodsCount |
string |
ACK 集群所有成功采集的 Pod 节点数。当 configType 为 collectorDeployMachines,且 type 为 ACKCluster 时显示。 |
8 |
| protocol |
string |
传输协议,支持 HTTP、HTTPS。 |
HTTP |
| userName |
string |
采集器 Output 指定实例的访问用户名,默认为 elastic。当 configType 为 collectorTargetInstance 或 collectorElasticsearchForKibana 时显示。 |
elastic |
| totalPodsCount |
string |
ACK 集群所有采集的 Pod 节点数。当 configType 为 collectorDeployMachines,且 type 为 ACKCluster 时显示。 |
10 |
| type |
string |
采集器部署的机器类型,当 configType 为 collectorDeployMachine 时显示。支持:
|
ECSInstanceId |
| kibanaHost |
string |
启用 Kibana Dashboard 后,Kibana 的公网访问地址。当 configType 为 collectorElasticsearchForKibana 时显示。 |
https://es-cn-4591jumei000u****.kibana.elasticsearch.aliyuncs.com:5601 |
| enableMonitoring |
boolean |
是否启用 Monitoring。当 configType 为 collectorTargetInstance,且 instanceType 为 elasticsearch 时显示。支持:
|
true |
| configType |
string |
配置类型。支持:
|
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-4591jumei000u****-kibana.internal.elasticsearch.aliyuncs.com:5601 |
| instanceId |
string |
采集器关联的实例 ID。当 configType 为 collectorTargetInstance 时,为采集器 Output 的实例 ID;当 configType 为 collectorDeployMachines,且 type 为 ACKCluster 时,为 ACK 集群 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 列表。 |
c1b9fde5172b84f82b9928e825a7b8988 |
| hosts |
array |
采集器 Output 指定实例的访问地址列表。当 configType 为 collectorTargetInstance 时显示。 |
|
|
string |
采集器 Output 指定实例的访问地址列表。当 configType 为 collectorTargetInstance 时显示。 |
["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"] |
|
| collectorPaths |
array |
fileBeat 采集路径。当采集器的部署机器为 ECS 时显示。 |
|
|
string |
fileBeat 采集路径。当采集器的部署机器为 ECS 时显示。 |
["/var/log"] |
示例
正常返回示例
JSON格式
{
"RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****",
"Result": {
"resId": "ct-cn-77uqof2s7rg5c****",
"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": "- key: log\\n title: Log file content\\n description: >\\n Contains log file lines.\\n ....",
"fileName": "fields.yml"
}
],
"extendConfigs": [
{
"successPodsCount": "8",
"protocol": "HTTP",
"userName": "elastic",
"totalPodsCount": "10",
"type": "ECSInstanceId",
"kibanaHost": "https://es-cn-4591jumei000u****.kibana.elasticsearch.aliyuncs.com:5601",
"enableMonitoring": true,
"configType": "collectorDeployMachine",
"instanceType": "elasticsearch",
"groupId": "default_ct-cn-5i2l75bz4776****",
"host": "es-cn-4591jumei000u****-kibana.internal.elasticsearch.aliyuncs.com:5601",
"instanceId": "es-cn-n6w1o1****",
"machines": [
{
"agentStatus": "heartOk",
"instanceId": "c1b9fde5172b84f82b9928e825a7b8988"
}
],
"hosts": [
"[\"es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200\"]"
]
}
],
"collectorPaths": [
"[\"/var/log\"]"
]
}
}
错误码
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。