com.baidubce.services.bbc
Class BbcClient

java.lang.Object
  extended by com.baidubce.AbstractBceClient
      extended by com.baidubce.services.bbc.BbcClient

public class BbcClient
extends AbstractBceClient

Created by fulinhua on 2019-02-18


Field Summary
 
Fields inherited from class com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
 
Constructor Summary
BbcClient()
          Constructs a new client to invoke service methods on bbc.
BbcClient(BceClientConfiguration clientConfiguration)
          Constructs a new bbc client using the client configuration to access bbc.
BbcClient(BceClientConfiguration config, HttpResponseHandler[] responseHandlers)
           
BbcClient(BceClientConfiguration config, HttpResponseHandler[] responseHandlers, boolean isHttpAsyncPutEnabled)
           
 
Method Summary
 void bindInstanceTag(BindBbcTagsRequest request)
          Binding the bbc instance to specified list of tags.
 CreateBbcImageResponse createBbcImage(CreateBbcImageRequest request)
          Creating a customized image which can be used for creating instance in the future.
 CreateBbcInstanceResponse createInstance(CreateBbcInstanceRequest request)
          Create a bcc Instance with the specified options, see all the supported instance in InstanceType You must fill the field of clientToken,which is especially for keeping idempotent.
 void deleteImage(DeleteImageRequest request)
          Deleting the specified image.
 GetBbcFlavorResponse getBbcFlavor(GetBbcFlavorRequest request)
          Geting the flavor information of a flavor
 GetBbcFlavorRaidResponse getBbcFlavorRaid(GetBbcFlavorRequest request)
          Geting the flavor raid information of a raid
 GetImageResponse getImage(GetImageRequest request)
          Get the detail information of specified image.
 GetBbcInstanceResponse getInstance(GetInstanceRequest request)
          Get the detail information of specified bbc instance.
 GetInstanceVpcResponse getInstanceVpcsubnet(GetInstanceVpcRequest request)
          Get the Vpc/Subnet information of specified bbc instance.
 ListBbcFlavorResponse listBbcFlavors(ListBbcFlavorsRequest request)
          Listing all the flavors of the bbc instance
 ListBbcInstancesResponse listBbcInstances(ListBbcInstancesRequest request)
          Return a list of instances owned by the authenticated user.
 ListOperationLogResponse listBbcOperationLog(ListOperationLogRequest request)
          Listing the operation log of the bbc.
 ListImagesResponse listImages(ListImagesRequest request)
          Listing bbc images owned by the authenticated user.
 void modifyBbcPassword(ModifyInstancePasswordRequest request)
          Modifying the password of the bbc instance.
 void modifyInstanceDesc(ModifyInstanceDescRequest request)
          Modifying the special describe to new value of the instance.
 void rebootInstance(RebootInstanceRequest request)
          Rebooting the bbc instance owned by the user.
 void rebuildBbcInstance(RebuildBbcInstanceRequest request)
          Rebuilding the bbc instance owned by the user.
 void releaseBbcInstance(ReleaseInstanceRequest request)
          Releasing the instance owned by the user.
 void renameBbcInstance(RenameBbcInstanceRequest request)
          Modifying the special attribute to new value of the instance.
 void startInstance(StartInstanceRequest request)
          Starting the bbc instance owned by the user.
 void stopInstance(StopInstanceRequest request)
          Stopping the bbc instance owned by the user.
 void unBindInstanceTag(BindBbcTagsRequest request)
          Unbinding the bbc instance to specified list of tags.
 
Methods inherited from class com.baidubce.AbstractBceClient
computeServiceId, 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

BbcClient

public BbcClient(BceClientConfiguration clientConfiguration)
Constructs a new bbc client using the client configuration to access bbc.

Parameters:
clientConfiguration - The bcc client configuration options controlling how this client connects to bbc (e.g. proxy settings, retry counts, etc).

BbcClient

public BbcClient(BceClientConfiguration config,
                 HttpResponseHandler[] responseHandlers,
                 boolean isHttpAsyncPutEnabled)

BbcClient

public BbcClient(BceClientConfiguration config,
                 HttpResponseHandler[] responseHandlers)

BbcClient

public BbcClient()
Constructs a new client to invoke service methods on bbc.

Method Detail

bindInstanceTag

public void bindInstanceTag(BindBbcTagsRequest request)
Binding the bbc instance to specified list of tags.

Parameters:
request - The request containing all options for binding the instance to specified list of tags.

unBindInstanceTag

public void unBindInstanceTag(BindBbcTagsRequest request)
Unbinding the bbc instance to specified list of tags.

Parameters:
request - The request containing all options for unbinding the instance to specified list of tags.

modifyBbcPassword

public void modifyBbcPassword(ModifyInstancePasswordRequest request)
                       throws BceClientException
Modifying the password of the bbc instance.

You can reboot the instance only when the instance is Running or Stopped , otherwise,it's will get 409 errorCode.

Parameters:
request - The request containing all options for modifying the bbc instance password.
Throws:
BceClientException

getInstanceVpcsubnet

public GetInstanceVpcResponse getInstanceVpcsubnet(GetInstanceVpcRequest request)
                                            throws BceClientException
Get the Vpc/Subnet information of specified bbc instance.

Parameters:
request - The request containing all options for getting the Vpc/Subnet information
Returns:
A List of Vpc/Subnet information
Throws:
BceClientException

listBbcInstances

public ListBbcInstancesResponse listBbcInstances(ListBbcInstancesRequest request)
Return a list of instances owned by the authenticated user.

Parameters:
request - The request containing all options for listing own's bcc Instance.
Returns:
The response containing a list of instances owned by the authenticated user.

getInstance

public GetBbcInstanceResponse getInstance(GetInstanceRequest request)
Get the detail information of specified bbc instance.

Parameters:
request - The request containing all options for getting the instance info.
Returns:
A instance detail model for the instanceId.

startInstance

public void startInstance(StartInstanceRequest request)
Starting the bbc instance owned by the user.

You can start the instance only when the instance is Stopped, otherwise,it's will get 409 errorCode.

This is an asynchronous interface, you can get the latest status by invoke getInstance(GetInstanceRequest)

Parameters:
request - The request containing all options for starting the instance.

stopInstance

public void stopInstance(StopInstanceRequest request)
Stopping the bbc instance owned by the user.

You can stop the instance only when the instance is Running, otherwise,it's will get 409 errorCode.

This is an asynchronous interface, you can get the latest status by invoke getInstance(GetInstanceRequest)

Parameters:
request - The request containing all options for stopping the instance.

rebootInstance

public void rebootInstance(RebootInstanceRequest request)
Rebooting the bbc instance owned by the user.

You can reboot the instance only when the instance is Running, otherwise,it's will get 409 errorCode.

This is an asynchronous interface, you can get the latest status by invoke getInstance(GetInstanceRequest)

Parameters:
request - The request containing all options for rebooting the instance.

renameBbcInstance

public void renameBbcInstance(RenameBbcInstanceRequest request)
Modifying the special attribute to new value of the instance.

You can reboot the instance only when the instance is Running or Stopped , otherwise,it's will get 409 errorCode.

Parameters:
request - The request containing all options for modifying the instance attribute.

modifyInstanceDesc

public void modifyInstanceDesc(ModifyInstanceDescRequest request)
Modifying the special describe to new value of the instance.

Parameters:
request - The request containing all options for modifying the instance desc.

rebuildBbcInstance

public void rebuildBbcInstance(RebuildBbcInstanceRequest request)
                        throws BceClientException
Rebuilding the bbc instance owned by the user.

After rebuilding the instance, all of snapshots created from original instance system disk will be deleted, all of customized images created from original instance system disk will be saved.

This is an asynchronous interface, you can get the latest status by invoke getInstance(GetInstanceRequest)

Parameters:
request - The request containing all options for rebuilding the instance.
Throws:
BceClientException

releaseBbcInstance

public void releaseBbcInstance(ReleaseInstanceRequest request)
Releasing the instance owned by the user.

Only the Postpaid instance or Prepaid which is expired can be released. After releasing the instance, all of the data will be deleted. all of volumes attached will be detached,but the volume snapshots will be saved. all of snapshots created from original instance system disk will be deleted, all of customized images created from original instance system disk will be reserved.

Parameters:
request - The request containing all options for releasing the instance.

listBbcFlavors

public ListBbcFlavorResponse listBbcFlavors(ListBbcFlavorsRequest request)
Listing all the flavors of the bbc instance

Parameters:
request -
Returns:

getBbcFlavor

public GetBbcFlavorResponse getBbcFlavor(GetBbcFlavorRequest request)
Geting the flavor information of a flavor

Parameters:
request - The request containing all options for releasing the instance.
Returns:

getBbcFlavorRaid

public GetBbcFlavorRaidResponse getBbcFlavorRaid(GetBbcFlavorRequest request)
Geting the flavor raid information of a raid

Parameters:
request - The request containing all options for releasing the instance.
Returns:

createBbcImage

public CreateBbcImageResponse createBbcImage(CreateBbcImageRequest request)
Creating a customized image which can be used for creating instance in the future.

You can create an image from an instance or you can create from an snapshot. The parameters of instanceId and snapshotId can no be null simultaneously. when both instanceId and snapshotId are assigned,only instanceId will be used.

While creating an image from an instance,the instance must be Running or Stopped, otherwise,it's will get 409 errorCode.

You can create the image only from system snapshot. While creating an image from a system snapshot,the snapshot must be Available, otherwise,it's will get 409 errorCode.

Parameters:
request - The request containing all options for creating a new image.
Returns:
The response with id of image newly created.

listImages

public ListImagesResponse listImages(ListImagesRequest request)
Listing bbc images owned by the authenticated user.

Parameters:
request - The request containing all options for listing images owned by user.
Returns:
The response with list of images.

getImage

public GetImageResponse getImage(GetImageRequest request)
Get the detail information of specified image.

Parameters:
request - The request containing all options for getting the detail information of specified image.
Returns:
The response with the image detail information.

deleteImage

public void deleteImage(DeleteImageRequest request)
Deleting the specified image.

Only the customized image can be deleted, otherwise,it's will get 403 errorCode.

Parameters:
request - The request containing all options for deleting the specified image.

listBbcOperationLog

public ListOperationLogResponse listBbcOperationLog(ListOperationLogRequest request)
Listing the operation log of the bbc. The startTime and endTime means the time quantum that the log had taken. If the starTime or the endTime is empty,it means searching the operation log of today.

Parameters:
request -
Returns:

createInstance

public CreateBbcInstanceResponse createInstance(CreateBbcInstanceRequest request)
                                         throws BceClientException
Create a bcc Instance with the specified options, see all the supported instance in InstanceType You must fill the field of clientToken,which is especially for keeping idempotent.

This is an asynchronous interface, you can get the latest status by invoke getInstance(GetInstanceRequest)

Parameters:
request - The request containing all options for creating a bcc Instance.
Returns:
List of instanceId newly created
Throws:
BceClientException


Copyright © 2020. All rights reserved.