You can call this operation to enable or disable public network access for a specified Elasticsearch instance.

Notice Before you call this operation, make sure that the instance is not in the activating, invalid, or inactive state.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request header

This operation only uses common request headers. For more information, see the Common request parameters topic.

Request syntax

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

Request parameters

Parameter Type Required Example Description
InstanceId String Yes es-cn-xxx

The ID of the instance.

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

A unique token generated by the client to guarantee the idempotency of the request. The maximum length of the token is 64 ASCII characters.

You must specify request body parameters. For more information, see Sample requests.

Response parameters

Parameter Type Example Description
RequestId String 2A88ECA1-D827-4581-AD39-05149586****

The ID of the request.

Result

The returned public network access information.

enablePublic Boolean false

The status of the public network access switch.

Examples

Sample requests

POST /openapi/instances/[InstanceId]/public-network HTTP/1.1
Common request header
{
  "InstanceId": "es-cn-xxx"
}

Request body

 Sample request body:
{
  "enablePublic": true
}

Sample success responses

XML format

<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 format

{
	"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****"
}
Notice The sample responses may contain parameters that are not described in the preceding table. These parameters are only for reference. You must make sure that your application is not strongly reliant on these parameters.

Error codes

For a list of error codes, visit the API Error Center.