EIP Instance
Last Updated:2020-08-05
Apply for EIP
- Apply for an EIP, which can be used to bind to any BCC instance.
- Identity Verification is required for creation of EIP, if you fail to pass identity verification, you can go to identity verification under security authentication in [Baidu Open Cloud Console](https://console.bce.baidu.com/qualify/? _=1567871861163#/qualify/result) for authentication.
public function createEip($eipClient, $name, $bandwidthInMbps, $billing) {
$result = $eipClient->createEip($bandwidthInMbps, $name, $billing);
echo $result->id;
}
Capacity Expansion and Reduction of EIP Bandwidth
- Used for the bandwidth capacity expansion and reduction of specified EIP.
- Check whether EIP capacity expansion and reduction state is completed by querying EIP list.
public function resizeEip($eipClient, $eip, $bandwidthInMbps) {
$eipClient->resizeEip($eip, $bandwidthInMbps);
}
Bind EIP
- Bind EIP to an instance, and only BCC is supported currently.
- Only the EIP in available state supports binding operation.
- The bound instance cannot have any existing EIP binding relationship.
- The bound instance cannot be in arrearage state.
public function bindEip($eipClient, $eip, $instanceId, $instanceType) {
$eipClient->bindEip($eip, $instanceId, $instanceType);
}
Unbind EIP
- Unbind the specified EIP.
- The unbound EIP must have been bound to any instance.
public function unbindEip($eipClient, $eip) {
$eipClient->unbindEip($eip);
}
Release EIP
- Release the specified EIP, and the released EIP cannot be recovered.
- If EIP is bound to any instance, it can be released after unbinding.
public function releaseEip($eipClient, $eip) {
$eipClient->releaseEip($eip);
}
Query EIP List
- EIP list can be queried according to multiple conditions.
- If it is only needed to query the details of a single EIP, you only need to provide eip parameters.
- If you only need to query the EIP bound to a specified instance, you only need to provide instanceType parameter.
- If you only need to query the details of EIP bound to a specified instance, you only need to provide instanceType and instanceId parameter.
- If no query condition is provided, the default query overwrites all EIPs.
- The returned result is the query result of intersection of multiple conditions, i.e. when multiple conditions are provided, EIP meeting all conditions simultaneously is returned.
- The query result above supports marker paging, with paging size of 1,000 by default, which can be specified via maxKeys parameter.
public function listEips($eipClient, $eip) {
$result = $eipClient->listEips($eip);
var_dump($result);
}
Renew EIP
- For the renewal operation of specified EIP, extend the expiration time.
- No renewal operation can be conducted during EIP capacity expansion and reduction.
public function purchaseReservedEip($eipClient, $billing, $eip) {
$result = $eipClient->purchaseReservedEip($eip,$billing);
var_dump($result);
}