调用UpdatePublicNetwork,开启或关闭指定阿里云Elasticsearch实例的公网地址。

注意 调用该接口时,当实例状态为生效中(activating)、失效(invalid)和冻结(inactive)时,无法更新信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

请求语法

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

请求参数

名称 类型 是否必选 示例值 描述
InstanceId String es-cn-xxx

实例ID。

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

用于保证请求的幂等性。由客户端生成该参数值,要保证在不同请求间唯一,最大不值过64个ASCII字符。

需要填写body请求参数,详情请参见请求示例

返回数据

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

当前请求的Request ID。

Result

当前请求返回的公网地址开关状态。

enablePublic Boolean false

公网地址开关状态。

示例

请求示例

POST /openapi/instances/[InstanceId]/public-network HTTP/1.1
公共请求头
{
  "InstanceId": "es-cn-xxx"
}

请求示例补充说明

 body请求示例:
{
  "enablePublic": true
}

正常返回示例

XML 格式

<Result>
    <instanceId>es-cn-xxx</instanceId>
    <domain>es-cn-xxx.elasticsearch.aliyuncs.com</domain>
    <description>aliyunes_name_test</description>
    <nodeAmount>3</nodeAmount>
    <paymentType>postpaid</paymentType>
    <status>active</status>
    <port>9200</port>
    <esVersion>5.5.3_with_X-Pack</esVersion>
    <esConfig>
        <action.destructive_requires_name>true</action.destructive_requires_name>
        <xpack.security.audit.outputs>index</xpack.security.audit.outputs>
        <xpack.watcher.enabled>false</xpack.watcher.enabled>
        <xpack.security.audit.enabled>true</xpack.security.audit.enabled>
        <action.auto_create_index>+.*,-*</action.auto_create_index>
    </esConfig>
    <esIPWhitelist>192.168.1.0/24</esIPWhitelist>
    <privateNetworkIpWhiteList>192.168.1.0/24</privateNetworkIpWhiteList>
    <kibanaIPWhitelist>::1</kibanaIPWhitelist>
    <kibanaIPWhitelist>110.0.0.0/8</kibanaIPWhitelist>
    <kibanaDomain>es-cn-xxx.kibana.elasticsearch.aliyuncs.com</kibanaDomain>
    <kibanaPort>5601</kibanaPort>
    <enablePublic>true</enablePublic>
    <nodeSpec>
        <spec>elasticsearch.n4.small</spec>
        <disk>20</disk>
        <diskType>cloud_ssd</diskType>
    </nodeSpec>
    <networkConfig>
        <vpcId>vpc-bp1uag5jj38ccmwn1****</vpcId>
        <vswitchId>vsw-bp1knt7m4cyn5k3a7****</vswitchId>
        <vsArea>cn-hangzhou-b</vsArea>
        <type>vpc</type>
    </networkConfig>
    <createdAt>2019-01-17T09:22:45.888Z</createdAt>
    <updatedAt>2019-03-15T13:21:20.728Z</updatedAt>
    <inited>true</inited>
    <dedicateMaster>false</dedicateMaster>
    <advancedDedicateMaster>false</advancedDedicateMaster>
    <masterConfiguration/>
    <haveClientNode>false</haveClientNode>
    <warmNode>false</warmNode>
    <warmNodeConfiguration/>
    <clientNodeConfiguration/>
    <kibanaConfiguration>
        <spec>elasticsearch.n4.small</spec>
        <amount>1</amount>
        <disk>0</disk>
    </kibanaConfiguration>
    <commodityCode>elasticsearch</commodityCode>
    <endTime>4703414400000</endTime>
    <dictList>
        <name>SYSTEM_MAIN</name>
        <fileSize>3058510</fileSize>
        <type>MAIN</type>
        <sourceType>ORIGIN</sourceType>
    </dictList>
    <dictList>
        <name>SYSTEM_STOPWORD</name>
        <fileSize>164</fileSize>
        <type>STOP</type>
        <sourceType>ORIGIN</sourceType>
    </dictList>
    <ikHotDicts>
        <name>test</name>
        <fileSize>8</fileSize>
        <type>MAIN</type>
        <sourceType>ORIGIN</sourceType>
    </ikHotDicts>
    <vpcInstanceId>es-cn-xxx-worker</vpcInstanceId>
</Result>
<RequestId>2A88ECA1-D827-4581-AD39-05149586****</RequestId>

JSON 格式

{
	"Result":{
		"port":9200,
		"nodeAmount":3,
		"kibanaIPWhitelist":[
			"::1",
			"110.0.0.0/8"
		],
		"esVersion":"5.5.3_with_X-Pack",
		"endTime":4703414400000,
		"kibanaPort":5601,
		"enablePublic":true,
		"ikHotDicts":[
			{
				"fileSize":8,
				"sourceType":"ORIGIN",
				"name":"test",
				"type":"MAIN"
			}
		],
		"nodeSpec":{
			"spec":"elasticsearch.n4.small",
			"disk":20,
			"diskType":"cloud_ssd"
		},
		"privateNetworkIpWhiteList":[
			"192.168.1.0/24"
		],
		"inited":true,
		"vpcInstanceId":"es-cn-xxx-worker",
		"description":"aliyunes_name_test",
		"kibanaDomain":"es-cn-xxx.kibana.elasticsearch.aliyuncs.com",
		"createdAt":"2019-01-17T09:22:45.888Z",
		"synonymsDicts":[],
		"masterConfiguration":{},
		"dictList":[
			{
				"fileSize":3058510,
				"sourceType":"ORIGIN",
				"name":"SYSTEM_MAIN",
				"type":"MAIN"
			},
			{
				"fileSize":164,
				"sourceType":"ORIGIN",
				"name":"SYSTEM_STOPWORD",
				"type":"STOP"
			}
		],
		"domain":"es-cn-xxx.elasticsearch.aliyuncs.com",
		"dedicateMaster":false,
		"warmNodeConfiguration":{},
		"publicIpWhitelist":[],
		"esConfig":{
			"xpack.watcher.enabled":"false",
			"action.destructive_requires_name":"true",
			"xpack.security.audit.outputs":"index",
			"action.auto_create_index":"+.*,-*",
			"xpack.security.audit.enabled":"true"
		},
		"status":"active",
		"paymentType":"postpaid",
		"instanceId":"es-cn-xxx",
		"esIPWhitelist":[
			"192.168.1.0/24"
		],
		"kibanaConfiguration":{
			"amount":1,
			"spec":"elasticsearch.n4.small",
			"disk":0
		},
		"warmNode":false,
		"clientNodeConfiguration":{},
		"updatedAt":"2019-03-15T13:21:20.728Z",
		"esIPBlacklist":[],
		"haveClientNode":false,
		"advancedDedicateMaster":false,
		"networkConfig":{
			"vpcId":"vpc-bp1uag5jj38ccmwn1****",
			"vswitchId":"vsw-bp1knt7m4cyn5k3a7****",
			"vsArea":"cn-hangzhou-b",
			"type":"vpc"
		},
		"clusterTasks":[],
		"commodityCode":"elasticsearch"
	},
	"RequestId":"2A88ECA1-D827-4581-AD39-05149586****"
}

返回示例补充说明

以上返回的参数信息中,本文只保证包含返回参数列表中提到的参数信息,而未提到的参数信息仅供参考,程序中不能强制依赖获取这些参数。

错误码

访问错误中心查看更多错误码。