Assigns a public endpoint to an ApsaraDB for MongoDB instance.

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 parameters

Parameter Type Required Example Description
Action String No AllocatePublicNetworkAddress

The operation that you want to perform. Set the value to AllocatePublicNetworkAddress.

RegionId String No cn-hangzhou

The region ID of the instance. You can call the DescribeRegions operation to query the region ID of the instance.

DBInstanceId String Yes dds-bp11483712c1****

The ID of the instance.

Note If you set this parameter to the ID of a sharded cluster instance, you must also specify the NodeId parameter.
NodeId String No s-bp18e6d84ae3****

The ID of the mongos, shard, or Configserver node in the sharded cluster instance. You can call the DescribeDBInstanceAttribute operation to view the ID of the mongos, shard, or Configserver node.

Note This parameter is required only when you specify the DBInstanceId parameter to the ID of a sharded cluster instance.

Response parameters

Parameter Type Example Description
RequestId String 8AA45036-497F-52E7-B951-F9C7B239****

The ID of the request.

Examples

Sample requests

http(s)://mongodb.aliyuncs.com/?Action=AllocatePublicNetworkAddress
&DBInstanceId=dds-bp11483712c1****
&NodeId=s-bp18e6d84ae3****
&<Common request parameters>

Sample responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<AllocatePublicNetworkAddressResponse>
    <RequestId>8AA45036-497F-52E7-B951-F9C7B239****</RequestId>
</AllocatePublicNetworkAddressResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "8AA45036-497F-52E7-B951-F9C7B239****"
}

Error codes

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