調用UpdatePublicNetwork,開啟或關閉指定Elasticsearch實例的公網地址。

調用該接口時,請注意:

當實例狀態為生效中(activating)、失效(invalid)和凍結(inactive)時,無法更新信息。

調試

您可以在OpenAPI Explorer中直接運行該接口,免去您計算簽名的困擾。運行成功后,OpenAPI Explorer可以自動生成SDK代碼示例。

請求頭

該接口使用公共請求頭,無特殊請求頭。請參見公共請求參數文檔。

請求語法

PATCH|POST /openapi/instances/[InstanceId]/public-network HTTP/1.1

請求參數

名稱 類型 位置 是否必選 示例值 描述
InstanceId String Path es-cn-nif1q9o8r0008****

實例ID。

clientToken String Query 5A2CFF0E-5718-45B5-9D4D-70B3FF****

用于保證請求的冪等性。由客戶端生成該參數值,要保證在不同請求間唯一,最大不超過64個ASCII字符。

RequestBody

您還可以在RequestBody中填入enablePublic參數(可選,默認為false)。Boolean類型,為true時表示開啟公網地址訪問,為false時表示關閉公網地址訪問,示例如下。


{
  "enablePublic": true
}

返回數據

名稱 類型 示例值 描述
RequestId String 2A88ECA1-D827-4581-AD39-05149586****

請求ID。

Result Struct

返回結果。

enablePublic Boolean false

公網地址開關狀態。

說明 下文返回示例中,本文只保證包含返回數據列表中的參數,而未提到的參數僅供參考,參數說明請參見ListInstance。程序中不能強制依賴獲取這些參數。

示例

請求示例

PATCH /openapi/instances/es-cn-nif1q9o8r0008****/public-network HTTP/1.1
公共請求頭
{
  "enablePublic": true
}

正常返回示例

JSON格式

{
	"Result": {
		"instanceId": "es-cn-nif1q9o8r0008****",
		"version": "6.7.0_with_X-Pack",
		"description": "es-cn-nif1q9o8r0008****",
		"nodeAmount": 4,
		"paymentType": "postpaid",
		"status": "active",
		"privateNetworkIpWhiteList": [
			"0.0.0.0/0"
		],
		"enablePublic": true,
		"nodeSpec": {
			"spec": "elasticsearch.n4.small",
			"disk": 20,
			"diskType": "cloud_ssd",
			"diskEncryption": false
		},
		"networkConfig": {
			"vpcId": "vpc-bp16k1dvzxtmagcva****",
			"vswitchId": "vsw-bp1k4ec6s7sjdbudw****",
			"vsArea": "cn-hangzhou-i",
			"type": "vpc"
		},
		"createdAt": "2020-07-07T04:05:16.791Z",
		"updatedAt": "2020-07-07T10:15:14.498Z",
		"commodityCode": "elasticsearch",
		"extendConfigs": [
			{
				"configType": "usageScenario",
				"value": "general"
			},
			{
				"configType": "maintainTime",
				"maintainStartTime": "02:00Z",
				"maintainEndTime": "06:00Z"
			},
			{
				"configType": "aliVersion",
				"aliVersion": "ali1.2.0"
			}
		],
		"endTime": 4749811200000,
		"clusterTasks": [
			{
				"type": "MigrateData",
				"progress": 100,
				"detail": {},
				"status": "FINISHED",
				"canCancelable": false,
				"interruptible": false,
				"subTasks": [
					{
						"type": "FindShrinkNodeAction",
						"progress": 100,
						"detail": {},
						"status": "FINISHED",
						"canCancelable": false,
						"interruptible": false,
						"subTasks": []
					},
					{
						"type": "MigrateDataAction",
						"progress": 100,
						"detail": {
							"doneMigrateNodeIps": [
								"172.16.**.**"
							],
							"allMigrateNodeIps": [
								"172.16.**.**"
							]
						},
						"status": "FINISHED",
						"canCancelable": false,
						"interruptible": false,
						"subTasks": []
					}
				]
			}
		],
		"vpcInstanceId": "es-cn-nif1q9o8r0008****-worker",
		"resourceGroupId": "rg-acfm2h5vbzdokea",
		"zoneCount": 1,
		"protocol": "HTTP",
		"zoneInfos": [
			{
				"zoneId": "cn-hangzhou-i",
				"status": "NORMAL"
			}
		],
		"instanceType": "elasticsearch",
		"inited": true,
		"tags": [],
		"domain": "es-cn-nif1q9o8r0008****.elasticsearch.aliyuncs.com",
		"port": 9200,
		"esVersion": "6.7.0_with_X-Pack",
		"esConfig": {
			"thread_pool.bulk.queue_size": "500"
		},
		"esIPWhitelist": [
			"0.0.0.0/0"
		],
		"esIPBlacklist": [],
		"kibanaIPWhitelist": [
			"0.0.0.0/0",
			"::/0"
		],
		"kibanaPrivateIPWhitelist": [],
		"publicIpWhitelist": [],
		"kibanaDomain": "es-cn-nif1q9o8r0008****.kibana.elasticsearch.aliyuncs.com",
		"kibanaPort": 5601,
		"haveKibana": true,
		"instanceCategory": "x-pack",
		"dedicateMaster": false,
		"advancedDedicateMaster": false,
		"masterConfiguration": {},
		"haveClientNode": false,
		"warmNode": false,
		"warmNodeConfiguration": {},
		"clientNodeConfiguration": {},
		"kibanaConfiguration": {
			"spec": "elasticsearch.n4.small",
			"amount": 1,
			"disk": 0
		},
		"dictList": [
			{
				"name": "SYSTEM_MAIN.dic",
				"fileSize": 2782602,
				"sourceType": "ORIGIN",
				"type": "MAIN"
			},
			{
				"name": "SYSTEM_STOPWORD.dic",
				"fileSize": 132,
				"sourceType": "ORIGIN",
				"type": "STOP"
			}
		],
		"synonymsDicts": [
			{
				"name": "dict_0.txt",
				"fileSize": 220,
				"sourceType": "ORIGIN",
				"type": "SYNONYMS"
			}
		],
		"ikHotDicts": [],
		"aliwsDicts": [],
		"haveGrafana": false,
		"haveCerebro": false,
		"enableKibanaPublicNetwork": true,
		"enableKibanaPrivateNetwork": false,
		"advancedSetting": {
			"gcName": "CMS"
		}
	},
	"RequestId": "17632473-6A3B-4D0C-A603-A56D5743****"
}

錯誤碼

HttpCode 錯誤碼 錯誤信息 描述
400 InstanceNotFound The instanceId provided does not exist. 實例找不到,請核對實例狀態。

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