EIP Instance
Updated at:2025-10-16
Apply for EIP
- Apply for an EIP, which can be bound to any BCC instance.
- Certification is required for creating EIP. Those who have not passed certification can go to the certification under security certification in the Baidu Open Cloud Official Website Console for certification.
PHP
1public function createEip($eipClient, $name, $bandwidthInMbps, $billing) {
2 $result = $eipClient->createEip($bandwidthInMbps, $name, $billing);
3 echo $result->id;
4}
EIP bandwidth scaling
- Used for scaling the bandwidth of a specified EIP
- Check the EIP scaling status by querying the EIP list
PHP
1public function resizeEip($eipClient, $eip,$bandwidthInMbps) {
2 $eipClient->resizeEip($eip, $bandwidthInMbps);
3}
Bind EIP
- Bind EIP to an instance (only BCC currently supported)
- Binding is supported only for available EIP
- The bound instance must not have any existing EIP binding relationships
- The bound instance cannot be in debt status
PHP
1public function bindEip($eipClient, $eip, $instanceId, $instanceType) {
2 $eipClient->bindEip($eip, $instanceId, $instanceType);
3}
Unbind EIP
- Unbind a specified EIP
- The unbound EIP must have been bound to any instance
PHP
1public function unbindEip($eipClient, $eip) {
2 $eipClient->unbindEip($eip);
3}
Release EIP
- The release of a specified EIP cannot be recovered once it is released
- If an EIP is bound to any instance, it must be unbound before release
PHP
1public function releaseEip($eipClient, $eip) {
2 $eipClient->releaseEip($eip);
3}
Query EIP list
- The EIP list can be filtered using various criteria.
- To view details of a specific EIP, only the eip parameter is needed.
- To see EIPs linked to a particular instance type, only the instanceType parameter is required.
- To view details of EIPs tied to a specific instance, you need to provide both the instanceType and instanceId parameters.
- If no specific criteria are specified, all EIPs will be listed by default.
- The returned results are based on the overlap of multiple conditions, meaning that if multiple conditions are set, the query will return only the EIPs that meet all conditions.
- The query results support marker-based pagination, with a default page size of 1,000. You can adjust this by setting the maxKeys parameter.
PHP
1public function listEips($eipClient, $eip) {
2 $result = $eipClient->listEips($eip);
3 var_dump($result);
4}
Renew EIP
- Renewal operation for specified EIP; extend the expiration period.
- EIP scaling prevents renewal operations from being executed.
PHP
1public function purchaseReservedEip($eipClient, $billing, $eip) {
2 $result = $eipClient->purchaseReservedEip($eip,$billing);
3 var_dump($result);
4}
