com.baidubce.services.eip
Class EipClient

java.lang.Object
  extended by com.baidubce.AbstractBceClient
      extended by com.baidubce.services.eip.EipClient

public class EipClient
extends AbstractBceClient

Provides the client for accessing the Elastic Ip Service (EIP).


Field Summary
 
Fields inherited from class com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
 
Constructor Summary
EipClient()
           
EipClient(BceClientConfiguration clientConfiguration)
          Constructs a new InstanceClient to invoke service methods on eip instance.
 
Method Summary
 void bindEip(BindEipRequest request)
          bind the eip to a specified instanceId and instanceType(BCC|BLB).
 void bindEip(String eip, String instanceId, String instanceType)
          bind the eip to a specified instanceId and instanceType(BCC|BLB).
 CreateEipResponse createEip(CreateEipRequest request)
          Create an eip with the specified options.
 CreateEipResponse createEip(int bandwidthInMbps)
          Create an eip with the specified options.
protected  void fillPayload(InternalRequest internalRequest, AbstractBceRequest bceRequest)
          the method to fill the internalRequest's content field with bceRequest only support HttpMethodName.POST or HttpMethodName.PUT
 ListEipsResponse listEips()
          get a list of eips owned by the authenticated user and default conditions
 ListEipsResponse listEips(ListEipsRequest request)
          get a list of eips owned by the authenticated user and specified conditions we can Also get a single eip function through this interface by eip condition if query by the instanceId or instanceType condition, must provides both of them at the same time
 void purchaseReservedEip(PurchaseReservedEipRequest request)
          PurchaseReserved eip with fixed duration only Prepaid eip can do this This is an asynchronous interface
 void purchaseReservedEip(String eip, int reservationLength, String reservationTimeUnit)
          PurchaseReserved eip with fixed duration only Prepaid eip can do this
 void purchaseReservedEipInMonth(String eip, int reservationLength)
          PurchaseReserved eip with specified duration in month
 void releaseEip(ReleaseEipRequest request)
          release the eip(delete operation) Only the Postpaid instance or Prepaid which is expired can be released.
 void releaseEip(String eip)
          release the eip(delete operation)
 void resizeEip(ResizeEipRequest request)
          Resizing eip The Prepaid eip can not be downgrade.
 void resizeEip(String eip, int newBandwidthInMbps)
          Resizing eip
 void unbindEip(String eip)
          unbind the eip from a specified instance
 void unbindEip(UnbindEipRequest request)
          unbind the eip from a specified instance
 
Methods inherited from class com.baidubce.AbstractBceClient
getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EipClient

public EipClient()

EipClient

public EipClient(BceClientConfiguration clientConfiguration)
Constructs a new InstanceClient to invoke service methods on eip instance.

Parameters:
clientConfiguration - The BCE client configuration options.
Method Detail

createEip

public CreateEipResponse createEip(int bandwidthInMbps)
Create an eip with the specified options.

Parameters:
bandwidthInMbps - specify the bandwidth in Mbps
Returns:

createEip

public CreateEipResponse createEip(CreateEipRequest request)
Create an eip with the specified options. This is an asynchronous interface

Parameters:
request - The request containing all options for creating an eip.
Returns:
created eip address

resizeEip

public void resizeEip(String eip,
                      int newBandwidthInMbps)
Resizing eip

Parameters:
eip - eip address to be resized
newBandwidthInMbps - specify new bandwidth in Mbps for eip

resizeEip

public void resizeEip(ResizeEipRequest request)
Resizing eip The Prepaid eip can not be downgrade. This is an asynchronous interface.

Parameters:
request - eip & newBandwidthInMbps must be provided

purchaseReservedEipInMonth

public void purchaseReservedEipInMonth(String eip,
                                       int reservationLength)
PurchaseReserved eip with specified duration in month

Parameters:
eip -
reservationLength -

purchaseReservedEip

public void purchaseReservedEip(String eip,
                                int reservationLength,
                                String reservationTimeUnit)
PurchaseReserved eip with fixed duration only Prepaid eip can do this

Parameters:
eip - eip address to be renewed
reservationLength - purchase length
reservationTimeUnit - time unit of purchasing, optional parameter default value 'Month'

purchaseReservedEip

public void purchaseReservedEip(PurchaseReservedEipRequest request)
PurchaseReserved eip with fixed duration only Prepaid eip can do this This is an asynchronous interface

Parameters:
request - The request containing all options for renewing eip with fixed duration.

bindEip

public void bindEip(String eip,
                    String instanceId,
                    String instanceType)
bind the eip to a specified instanceId and instanceType(BCC|BLB).

Parameters:
eip - eip address to be bound
instanceId - id of instance to be bound
instanceType - type of instance to be bound

bindEip

public void bindEip(BindEipRequest request)
bind the eip to a specified instanceId and instanceType(BCC|BLB). the status of eip must be available and thd instance not be expired or boundByEip

Parameters:
request - The request containing all options for binding eip

unbindEip

public void unbindEip(String eip)
unbind the eip from a specified instance

Parameters:
eip - eip address to be unbound

unbindEip

public void unbindEip(UnbindEipRequest request)
unbind the eip from a specified instance

Parameters:
request - The request containing all options for unbinding eip

releaseEip

public void releaseEip(String eip)
release the eip(delete operation)

Parameters:
eip - eip address to be released

releaseEip

public void releaseEip(ReleaseEipRequest request)
release the eip(delete operation) Only the Postpaid instance or Prepaid which is expired can be released. if the eip has been bound, must unbind before releasing

Parameters:
request - The request containing all options for releasing eip

listEips

public ListEipsResponse listEips()
get a list of eips owned by the authenticated user and default conditions

Returns:

listEips

public ListEipsResponse listEips(ListEipsRequest request)
get a list of eips owned by the authenticated user and specified conditions we can Also get a single eip function through this interface by eip condition if query by the instanceId or instanceType condition, must provides both of them at the same time

Parameters:
request - The request containing all options for query
Returns:

fillPayload

protected void fillPayload(InternalRequest internalRequest,
                           AbstractBceRequest bceRequest)
the method to fill the internalRequest's content field with bceRequest only support HttpMethodName.POST or HttpMethodName.PUT

Parameters:
internalRequest - A request object, populated with endpoint, resource path, ready for callers to populate any additional headers or parameters, and execute.
bceRequest - The original request, as created by the user.


Copyright © 2018. All rights reserved.