Call UpdatePublicNetwork to open or close the public network address of the specified elasticsearch instance.

When you call this operation, take note of the following items:

When the instance is in the activating, invalid, or inactive state, its configuration cannot be updated.

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 uses common request parameters only. For more information, see Common parameters.

Request syntax

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

Request parameters

Parameter Type Required Example Description
InstanceId String Yes es-cn-nif1q9o8r0008****

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. You can use the client to generate the value, but you must ensure that it is unique among different requests. The token can only contain ASCII characters and cannot exceed 64 characters in length.

RequestBody

You can also enter the enablePublic parameter in RequestBody (optional). The default value is false. The Boolean type. A value of true indicates that access to public endpoint is enabled. A value of false indicates that access to public endpoint is disabled. Example:

You can also fill in the enablePublic parameter in the RequestBody (optional, the default is false). Boolean type. True means that public network address access is enabled and false means disabled. Example:


{
  "enablePublic": true
}
            

Response parameters

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

The ID of the request.

Result Struct

The return results.

enablePublic Boolean false

The status of the public network access switch.

Note The following response examples are only used for reference. For more information about Parameter descriptions, see ListInstance. The program cannot forcibly depend on obtaining these parameters.

Examples

Sample requests

PATCH /openapi/instances/es-cn-nif1q9o8r0008****/public-network HTTP/1.1
Common request parameters
{
  "enablePublic": true
}

Sample success responses

JSON format

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

Error codes

HttpCode Error code Error message Description
400 InstanceNotFound The instanceId provided does not exist. The error message returned because the specified instance cannot be found. Check the instance status.

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