调用UpdateCollectorName,修改采集器名称。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
POST /openapi/collectors/[ResId]/actions/rename HTTP/1.1
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
ResId | String | Path | 是 | ct-cn-77uqof2s7rg5c**** |
采集器ID。 |
ClientToken | String | Query | 否 | 5A2CFF0E-5718-45B5-9D4D-70B3FF**** |
用于保证请求的幂等性。由客户端生成该参数值,要保证在不同请求间唯一,最大不超过64个ASCII字符。 |
RequestBody
RequestBody中还需填入以下参数,用来指定修改后的采集器名称。
名称 |
类型 |
是否必选 |
示例值 |
描述 |
---|
名称 |
类型 |
是否必选 |
示例值 |
描述 |
---|---|---|---|---|
name |
String |
是 |
collectorName1 |
修改后的采集器名称。 |
示例如下。
{
"name": "collectorName1"
}
返回数据
示例
请求示例
POST /openapi/collectors/ct-cn-77uqof2s7rg5c****/actions/rename HTTP/1.1
公共请求头
{
"name": "collectorName1"
}
正常返回示例
JSON
格式
{
"Result": {
"gmtCreatedTime": "2021-01-14T08:54:42.000+0000",
"gmtUpdateTime": "2021-01-18T03:59:20.140+0000",
"name": "API_test",
"resId": "ct-cn-tfv81t7vs8608****",
"resVersion": "6.8.5_with_community",
"vpcId": "vpc-bp12nu14urf0upaf4****",
"resType": "fileBeat",
"ownerId": "168520994880****",
"collectorPaths": [
"/opt/test/logs/"
],
"configs": [
{
"fileName": "fields.yml",
"content": "- key: log\n title: Log file content\n description: >\n Contains log file lines.\n fields:\n ......"
},
{
"fileName": "filebeat.yml",
"content": "###################### Filebeat Configuration Example #########################\n\n# This file is an example configuration file ......"
}
],
"status": "active",
"extendConfigs": [
{
"configType": "collectorTargetInstance",
"instanceId": "es-cn-nif201ihd0012****",
"instanceType": "elasticsearch",
"hosts": [
"es-cn-nif201ihd0012****.elasticsearch.aliyuncs.com:9200"
],
"protocol": "HTTP",
"userName": "elastic",
"enableMonitoring": false
},
{
"configType": "collectorDeployMachine",
"type": "ECSInstanceId",
"machines": [
{
"instanceId": "i-bp11u91xgubypcuz****",
"agentStatus": "heartOk"
}
],
"groupId": "default_ct-cn-tfv81t7vs8608****"
}
],
"dryRun": false
},
"RequestId": "9B2BD604-3B93-4F66-91F0-43B4D2D268FF"
}
错误码
访问错误中心查看更多错误码。