全部產品
Search
文件中心

Elasticsearch:UpdateCollectorName

更新時間:Jan 16, 2025

調用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"
}

返回資料

名稱 類型 樣本值 描述
RequestId String 5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1****

請求ID。

Result Struct

返回結果。

collectorPaths List ["/var/log"]

fileBeat採集路徑。當採集器的部署機器為ECS時顯示。

configs Array of configs

採集器的設定檔資訊。

content String - key: log\n title: Log file content\n description: >\n Contains log file lines.\n ....

檔案內容。

fileName String fields.yml

檔案名稱。

dryRun Boolean false

是否校正並建立採集器。支援:

  • true:只校正不更新
  • false:校正並更新
extendConfigs Array of extendConfigs

採集器擴充配置。

configType String collectorDeployMachine

配置類型。支援:

  • collectorTargetInstance:採集器Output
  • collectorDeployMachine:採集器的部署機器
  • collectorElasticsearchForKibana:支援Kibana儀錶盤的Elasticsearch執行個體資訊
enableMonitoring Boolean true

是否啟用Monitoring。當configTypecollectorTargetInstance,且instanceTypeelasticsearch時顯示。支援:

  • true:啟用
  • false:不啟用
groupId String default_ct-cn-5i2l75bz4776****

機器組ID。當configTypecollectorDeployMachine時顯示。

host String es-cn-4591jumei000u****-kibana.internal.elasticsearch.aliyuncs.com:5601

啟用Kibana Dashboard後,Kibana的私網訪問地址。當configTypecollectorElasticsearchForKibana時顯示。

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

採集器Output指定執行個體的訪問地址清單。當configTypecollectorTargetInstance時顯示。

instanceId String es-cn-n6w1o1****

採集器關聯的執行個體ID。當configTypecollectorTargetInstance時,為採集器Output的執行個體ID;當configTypecollectorDeployMachines,且typeACKCluster時,為ACK叢集ID。

instanceType String elasticsearch

採集器Output指定的執行個體類型,支援:elasticsearch、logstash。當configTypecollectorTargetInstance時顯示。

kibanaHost String https://es-cn-4591jumei000u****.kibana.elasticsearch.aliyuncs.com:5601

啟用Kibana Dashboard後,Kibana的公網訪問地址。當configTypecollectorElasticsearchForKibana時顯示。

machines Array of machines

採集器所部署的ECS機器列表資訊。當configTypecollectorDeployMachines,且typeECSInstanceId時顯示。

agentStatus String heartOk

ECS上各採集器的狀態。支援:heartOk(心跳正常)、heartLost(心跳異常)、uninstalled(未安裝)和failed(安裝失敗)。

instanceId String c1b9fde5172b84f82b9928e825a7b8988

ECS機器ID列表。

protocol String HTTP

傳輸協議,支援HTTPHTTPS

successPodsCount String 8

ACK叢集所有成功採集的Pod節點數。當configTypecollectorDeployMachines,且typeACKCluster時顯示。

totalPodsCount String 10

ACK叢集所有採集的Pod節點數。當configTypecollectorDeployMachines,且typeACKCluster時顯示。

type String ECSInstanceId

採集器部署的機器類型,當configTypecollectorDeployMachine時顯示。支援:

  • ECSInstanceId:ECS執行個體
  • ACKCluster:容器Kubernetes叢集
userName String elastic

採集器Output指定執行個體的訪問使用者名稱,預設為elastic。當configTypecollectorTargetInstancecollectorElasticsearchForKibana時顯示。

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

採集器建立時間。

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

採集器更新時間。

name String ct-test

採集器名稱。

ownerId String 16852099488*****

帳號ID。

resId String ct-cn-77uqof2s7rg5c****

採集器執行個體ID。

resType String fileBeat

採集器類型,支援fileBeat、metricBeat、heartBeat和audiBeat。

resVersion String 6.8.5_with_community

採集器版本。支援的版本與採集器的部署機器類型相關,具體如下:

  • ECS:6.8.5_with_community
  • ACK:6.8.13_with_community
status String active

採集器狀態。支援activing(生效中)和active(已生效)。

vpcId String vpc-bp16k1dvzxtma*****

採集器所在的專用網路ID。

樣本

請求樣本

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"
}

錯誤碼

訪問錯誤中心查看更多錯誤碼。