Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Wang , Deng Ke <wangdengke2@huawei.com> Co-committed-by: Wang , Deng Ke <wangdengke2@huawei.com>
11 KiB
Binding or Unbinding an EIP
Function
This API is used to bind or unbind an EIP.
URI
- URI format
PATH: /rds/v1/{project_id}/instances/{instanceId}/action
Method: POST
- Parameter description
Table 1 Parameter description Name
Mandatory
Description
project_id
Yes
Specifies the project ID of a tenant in a region.
instanceId
Yes
Specifies the primary node ID of the DB instance.
NOTE:This field is not the DB instance ID. You are advised to use API v3 and the DB instance ID to perform related operations.
- Restrictions
First, invoke the VPC API to query EIPs by referring to section "Querying Elastic IP Addresses" in the Virtual Private Cloud API Reference. If no EIP is available for the tenant, invoke the VPC API to create an EIP by referring to section "Applying for an Elastic IP Address" in the Virtual Private Cloud API Reference.
EIPs cannot be bound to or unbound from primary/standby DB instances of earlier versions.
Request
- Parameter description
Table 2 Parameter description Name
Mandatory
Type
Description
setPublicIp
Yes
Dictionary data structure. For details, see Table 3.
Returns EIP information.
Table 3 setPublicIp field data structure description Name
Mandatory
Type
Description
action
Yes
String
If this parameter is enablePublicAccess, the EIP is bound to the target DB instance.
If this parameter is disablePublicAccess, the EIP is unbound from the target DB instance.
publicIP
Yes
String
Specifies the EIP obtained by invoking the VPC API. This parameter is not contained in the request when unbinding the EIP.
publicIPId
Yes
String
Specifies the EIP ID obtained by invoking the VPC API. This parameter is not contained in the request when unbinding the EIP.
Normal Response
{}
Abnormal Response
For details, see Abnormal Request Results.