|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.baidubce.AbstractBceClient
com.baidubce.services.bcc.BccClient
public class BccClient
Provides the client for accessing the Baidu Cloud Compute Service(bcc).
Field Summary |
---|
Fields inherited from class com.baidubce.AbstractBceClient |
---|
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX |
Constructor Summary | |
---|---|
BccClient()
Constructs a new client to invoke service methods on bcc. |
|
BccClient(BceClientConfiguration clientConfiguration)
Constructs a new bcc client using the client configuration to access bcc. |
Method Summary | |
---|---|
AttachVolumeResponse |
attachVolume(AttachVolumeRequest request)
Attaching the specified volume to a specified instance. |
AttachVolumeResponse |
attachVolume(String volumeId,
String instanceId)
Attaching the specified volume to a specified instance. |
void |
authorizeSecurityGroupRule(SecurityGroupRuleOperateRequest request)
authorizing a security group rule to a specified security group |
void |
bindInstanceToSecurityGroup(BindSecurityGroupRequest request)
Binding the instance to specified securitygroup. |
void |
bindInstanceToSecurityGroup(String instanceId,
String securityGroupId)
Binding the instance to specified securitygroup. |
CreateImageResponse |
createImage(CreateImageRequest request)
Creating a customized image which can be used for creating instance in the future. |
CreateImageResponse |
createImageFromInstance(String imageName,
String instanceId)
Creating a customized image from the instance.. |
CreateImageResponse |
createImageFromSnapshot(String imageName,
String snapshotId)
Creating a customized image from specified snapshot. |
CreateInstanceResponse |
createInstance(CreateInstanceRequest 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. |
CreateSecurityGroupResponse |
createSecurityGroup(CreateSecurityGroupRequest request)
Creating a newly SecurityGroup with specified rules. |
CreateSnapshotResponse |
createSnapshot(CreateSnapshotRequest request)
Creating snapshot from specified volume. |
CreateSnapshotResponse |
createSnapshot(String volumeId,
String snapshotName)
Creating snapshot from specified volume. |
CreateSnapshotResponse |
createSnapshot(String volumeId,
String snapshotName,
String desc)
Creating snapshot from specified volume. |
CreateVolumeResponse |
createVolume(CreateVolumeRequest request)
Create a volume with the specified options. |
void |
deleteImage(DeleteImageRequest request)
Deleting the specified image. |
void |
deleteImage(String imageId)
Deleting the specified image. |
void |
deleteSecurityGroup(DeleteSecurityGroupRequest request)
Deleting the specified SecurityGroup. |
void |
deleteSecurityGroup(String securityGroupId)
Deleting the specified SecurityGroup. |
void |
deleteSnapshot(DeleteSnapshotRequest request)
Deleting the specified snapshot. |
void |
deleteSnapshot(String snapshotId)
Deleting the specified snapshot. |
void |
detachVolume(DetachVolumeRequest request)
Detaching the specified volume from a specified instance. |
void |
detachVolume(String volumeId,
String instanceId)
Detaching the specified volume from a specified instance. |
GetImageResponse |
getImage(GetImageRequest request)
Get the detail information of specified image. |
GetImageResponse |
getImage(String imageId)
Get the detail information of specified image. |
GetInstanceResponse |
getInstance(GetInstanceRequest request)
Get the detail information of specified instance. |
GetInstanceResponse |
getInstance(String instanceId)
Get the detail information of specified instance. |
GetInstanceVncResponse |
getInstanceVnc(GetInstanceVncRequest request)
Getting the vnc url to access the instance. |
GetInstanceVncResponse |
getInstanceVnc(String instanceId)
Getting the vnc url to access the instance. |
GetSnapshotResponse |
getSnapshot(GetSnapshotRequest request)
Getting the detail information of specified snapshot. |
GetSnapshotResponse |
getSnapshot(String snapshotId)
Get the detail information of specified snapshot. |
GetVolumeResponse |
getVolume(GetVolumeRequest request)
Get the detail information of specified volume. |
GetVolumeResponse |
getVolume(String volumeId)
Get the detail information of specified volume. |
ListImagesResponse |
listImages()
Listing images owned by the authenticated user. |
ListImagesResponse |
listImages(ListImagesRequest request)
Listing images owned by the authenticated user. |
ListInstancesResponse |
listInstances()
Return a list of instances owned by the authenticated user. |
ListInstancesResponse |
listInstances(ListInstancesRequest request)
Return a list of instances owned by the authenticated user. |
ListInstanceSpecsResponse |
listInstanceSpecs()
Deprecated. |
ListInstanceSpecsResponse |
listInstanceSpecs(ListInstanceSpecsRequest request)
Deprecated. |
ListSecurityGroupsResponse |
listSecurityGroups(ListSecurityGroupsRequest request)
Listing SecurityGroup owned by the authenticated user. |
ListSnapshotsResponse |
listSnapshots(ListSnapshotsRequest request)
Listing snapshots owned by the authenticated user. |
ListVolumesResponse |
listVolumes()
Listing volumes owned by the authenticated user. |
ListVolumesResponse |
listVolumes(ListVolumesRequest request)
Listing volumes owned by the authenticated user. |
ListZonesResponse |
listZones()
listing zones within current region |
ListZonesResponse |
listZones(AbstractBceRequest request)
listing zones within current region |
void |
modifyInstanceAttributes(ModifyInstanceAttributesRequest request)
Modifying the special attribute to new value of the instance. |
void |
modifyInstancePassword(ModifyInstancePasswordRequest request)
Modifying the password of the instance. |
void |
modifyInstancePassword(String instanceId,
String adminPass)
Modifying the password of the instance. |
void |
purchaseReservedInstance(PurchaseReservedInstanceRequeset request)
Renewing the instance with fixed duration. |
void |
purchaseReservedInstance(String instanceId,
int reservationLength,
String reservationTimeUnit)
PurchaseReserved the instance with fixed duration. |
void |
purchaseReservedVolume(PurchaseReservedVolumeRequest request)
PurchaseReserved the instance with fixed duration. |
void |
purchaseReservedVolume(String volumeId,
int reservationLength,
String reservationTimeUnit)
PurchaseReserved the instance with fixed duration. |
void |
rebootInstance(RebootInstanceRequest request)
Rebooting the instance owned by the user. |
void |
rebootInstance(String instanceId)
Rebooting the instance owned by the user. |
void |
rebootInstance(String instanceId,
boolean forceStop)
Rebooting the instance owned by the user. |
void |
rebuildInstance(RebuildInstanceRequest request)
Rebuilding the instance owned by the user. |
void |
rebuildInstance(String instanceId,
String imageId,
String adminPass)
Rebuilding the instance owned by the user. |
void |
releaseInstance(ReleaseInstanceRequest request)
Releasing the instance owned by the user. |
void |
releaseInstance(String instanceId)
Releasing the instance owned by the user. |
void |
releaseVolume(ReleaseVolumeRequest request)
Releasing the specified volume owned by the user. |
void |
releaseVolume(String volumeId)
Releasing the specified volume owned by the user. |
void |
resizeInstance(ResizeInstanceRequest request)
Resizing the instance owned by the user. |
void |
resizeVolume(ResizeVolumeRequest request)
Resizing the specified volume with newly size. |
void |
resizeVolume(String volumeId,
int newCdsSizeInGB)
Resizing the specified volume with newly size. |
void |
revokeSecurityGroupRule(SecurityGroupRuleOperateRequest request)
revoking a security group rule from the specified security group |
void |
rollbackVolume(RollbackVolumeRequest request)
Rollback the volume with the specified volume snapshot. |
void |
rollbackVolume(String volumeId,
String snapshotId)
Rollback the volume with the specified volume snapshot. |
void |
startInstance(StartInstanceRequest request)
Starting the instance owned by the user. |
void |
startInstance(String instanceId)
Starting the instance owned by the user. |
void |
stopInstance(StopInstanceRequest request)
Stopping the instance owned by the user. |
void |
stopInstance(String instanceId)
Stopping the instance owned by the user. |
void |
stopInstance(String instanceId,
boolean forceStop)
Stopping the instance owned by the user. |
void |
unbindInstanceFromSecurityGroup(String instanceId,
String securityGroupId)
Unbinding the instance from securitygroup. |
void |
unbindInstanceFromSecurityGroup(UnbindSecurityGroupRequest request)
Unbinding the instance from securitygroup. |
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 |
---|
public BccClient()
public BccClient(BceClientConfiguration clientConfiguration)
clientConfiguration
- The bcc client configuration options controlling how this client
connects to bcc (e.g. proxy settings, retry counts, etc).Method Detail |
---|
public CreateInstanceResponse createInstance(CreateInstanceRequest request) throws BceClientException
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)
request
- The request containing all options for creating a bcc Instance.
BceClientException
public ListInstancesResponse listInstances()
public ListInstancesResponse listInstances(ListInstancesRequest request)
request
- The request containing all options for listing own's bcc Instance.
public GetInstanceResponse getInstance(String instanceId)
instanceId
- The id of the instance.
public GetInstanceResponse getInstance(GetInstanceRequest request)
request
- The request containing all options for getting the instance info.
public void startInstance(String instanceId)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
instanceId
- The id of the instance.public void startInstance(StartInstanceRequest request)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
request
- The request containing all options for starting the instance.public void stopInstance(String instanceId)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
instanceId
- The id of the instance.public void stopInstance(String instanceId, boolean forceStop)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
instanceId
- The id of the instance.forceStop
- The optional parameter to stop the instance forcibly.If true
,
it will stop the instance just like power off immediately
and it may result in losing important data which have not been written to disk.public void stopInstance(StopInstanceRequest request)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
request
- The request containing all options for stopping the instance.public void rebootInstance(String instanceId)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
instanceId
- The id of the instance.public void rebootInstance(String instanceId, boolean forceStop)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
instanceId
- The id of the instance.forceStop
- The option param to stop the instance forcibly.If true
,
it will stop the instance just like power off immediately
and it may result int losing important data which have not written to disk.public void rebootInstance(RebootInstanceRequest request)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
request
- The request containing all options for rebooting the instance.public void modifyInstancePassword(String instanceId, String adminPass) throws BceClientException
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
instanceId
- The id of the instance.adminPass
- The new password to update.
The adminPass will be encrypted in AES-128 algorithm
with the substring of the former 16 characters of user SecretKey.
BceClientException
public void modifyInstancePassword(ModifyInstancePasswordRequest request) throws BceClientException
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
request
- The request containing all options for modifying the instance password.
BceClientException
public void modifyInstanceAttributes(ModifyInstanceAttributesRequest request)
409
errorCode.
request
- The request containing all options for modifying the instance attribute.public void rebuildInstance(String instanceId, String imageId, String adminPass) throws BceClientException
getInstance(GetInstanceRequest)
instanceId
- The id of the instance.imageId
- The id of the image which is used to rebuild the instance.adminPass
- The admin password to login the instance.
The admin password will be encrypted in AES-128 algorithm
with the substring of the former 16 characters of user SecretKey.
See more detail on
BCE API doc
BceClientException
public void rebuildInstance(RebuildInstanceRequest request) throws BceClientException
getInstance(GetInstanceRequest)
request
- The request containing all options for rebuilding the instance.
BceClientException
public void releaseInstance(String instanceId)
instanceId
- The id of the instance.public void releaseInstance(ReleaseInstanceRequest request)
request
- The request containing all options for releasing the instance.public void resizeInstance(ResizeInstanceRequest request)
409
errorCode.
After resizing the instance,it will be reboot once.
This is an asynchronous interface,
you can get the latest status by invoke getInstance(GetInstanceRequest)
request
- The request containing all options for resizing the instance.public void bindInstanceToSecurityGroup(String instanceId, String securityGroupId)
instanceId
- The id of the instance.securityGroupId
- The id of the securitygroup.public void bindInstanceToSecurityGroup(BindSecurityGroupRequest request)
request
- The request containing all options for binding the instance to specified securitygroup.public void unbindInstanceFromSecurityGroup(String instanceId, String securityGroupId)
instanceId
- The id of the instance.securityGroupId
- The id of the securitygroup.public void unbindInstanceFromSecurityGroup(UnbindSecurityGroupRequest request)
request
- The request containing all options for unbinding the instance from securitygroup.public GetInstanceVncResponse getInstanceVnc(String instanceId)
instanceId
- The id of the instance.public GetInstanceVncResponse getInstanceVnc(GetInstanceVncRequest request)
request
- The request containing all options for getting the vnc url.public void purchaseReservedInstance(String instanceId, int reservationLength, String reservationTimeUnit)
getInstance(GetInstanceRequest)
instanceId
- The id of the instance.reservationLength
- The fixed duration to purchaseReserved,available is [1,2,3,4,5,6,7,8,9,12,24,36]reservationTimeUnit
- The timeUnit to renew the instance,only support "month" now.public void purchaseReservedInstance(PurchaseReservedInstanceRequeset request)
getInstance(GetInstanceRequest)
request
- The request containing all options for renewing the instance with fixed duration.@Deprecated public ListInstanceSpecsResponse listInstanceSpecs()
@Deprecated public ListInstanceSpecsResponse listInstanceSpecs(ListInstanceSpecsRequest request)
request
- The request containing all options for Listing all of specification for instance resource.
public CreateVolumeResponse createVolume(CreateVolumeRequest request)
request
- The request containing all options for creating a volume.
public ListVolumesResponse listVolumes()
public ListVolumesResponse listVolumes(ListVolumesRequest request)
request
- The request containing all options for listing volumes owned by the authenticated user.
public GetVolumeResponse getVolume(String volumeId)
volumeId
- The id of the volume.
public GetVolumeResponse getVolume(GetVolumeRequest request)
request
- The request containing all options for getting the detail information of specified volume.
public AttachVolumeResponse attachVolume(String volumeId, String instanceId)
409
errorCode.
volumeId
- The id of the volume which will be attached to specified instance.instanceId
- The id of the instance which will be attached with a volume.
public AttachVolumeResponse attachVolume(AttachVolumeRequest request)
409
errorCode.
request
- The request containing all options for attaching the specified volume to a specified instance.
public void detachVolume(String volumeId, String instanceId)
409
errorCode.
volumeId
- The id of the volume which has been attached to specified instance.instanceId
- The id of the instance which will be detached a volume.public void detachVolume(DetachVolumeRequest request)
409
errorCode.
request
- The request containing all options for detaching the specified volume from a specified instance.public void releaseVolume(String volumeId)
409
errorCode.
volumeId
- The id of the volume which will be released.public void releaseVolume(ReleaseVolumeRequest request)
409
errorCode.
request
- The request containing all options for releasing the specified volume.public void resizeVolume(String volumeId, int newCdsSizeInGB)
409
errorCode.
The prepaid volume can not be downgrade.
This is an asynchronous interface,
you can get the latest status by invoke getVolume(String)
volumeId
- The id of volume which you want to resize.newCdsSizeInGB
- The new volume size you want to resize in GB.public void resizeVolume(ResizeVolumeRequest request)
409
errorCode.
The prepaid volume can not be downgrade.
This is an asynchronous interface,
you can get the latest status by invoke getVolume(String)
request
- The request containing all options for resize the specified volume.public void rollbackVolume(String volumeId, String snapshotId)
You can rollback the specified volume only when the volume is Available,
otherwise,it's will get 409
errorCode.
The snapshot used to rollback must be created by the volume,
otherwise,it's will get 404
errorCode.
If rolling back the system volume,the instance must be Running or Stopped,
otherwise,it's will get 409
errorCode.After rolling back the
volume,all the system disk data will erase.
volumeId
- The id of volume which will be rollback.snapshotId
- The id of snapshot which will be used to rollback the volume.public void rollbackVolume(RollbackVolumeRequest request)
You can rollback the specified volume only when the volume is Available,
otherwise,it's will get 409
errorCode.
The snapshot used to rollback must be created by the volume,
otherwise,it's will get 404
errorCode.
If rolling back the system volume,the instance must be Running or Stopped,
otherwise,it's will get 409
errorCode.After rolling back the
volume,all the system disk data will erase.
request
- The request containing all options for rolling back the specified volume.public void purchaseReservedVolume(String volumeId, int reservationLength, String reservationTimeUnit)
getVolume(String)
volumeId
- The id of volume which will be renew.reservationLength
- The fixed duration to renew,available is [1,2,3,4,5,6,7,8,9,12,24,36]reservationTimeUnit
- The timeUnit to renew the instance,only support "month" now.public void purchaseReservedVolume(PurchaseReservedVolumeRequest request)
getVolume(String)
request
- The request containing all options for renew the specified volume.public CreateImageResponse createImageFromInstance(String imageName, String instanceId)
While creating an image from an instance,the instance must be Running or Stopped,
otherwise,it's will get 409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getImage(GetImageRequest)
imageName
- The name of image that will be created.instanceId
- The id of instance which will be used to create image.
public CreateImageResponse createImageFromSnapshot(String imageName, String snapshotId)
409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getImage(GetImageRequest)
imageName
- The name of image that will be created.snapshotId
- The id of snapshot which will be used to create image.
public CreateImageResponse createImage(CreateImageRequest request)
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.
This is an asynchronous interface,
you can get the latest status by invoke getImage(GetImageRequest)
request
- The request containing all options for creating a new image.
public ListImagesResponse listImages()
public ListImagesResponse listImages(ListImagesRequest request)
request
- The request containing all options for listing images owned by user.
public GetImageResponse getImage(String imageId)
imageId
- The id of image.
public GetImageResponse getImage(GetImageRequest request)
request
- The request containing all options for getting the detail information of specified image.
public void deleteImage(String imageId)
403
errorCode.
imageId
- The id of image.public void deleteImage(DeleteImageRequest request)
403
errorCode.
request
- The request containing all options for deleting the specified image.public CreateSnapshotResponse createSnapshot(String volumeId, String snapshotName)
409
errorCode.
While creating snapshot from CDS volume,,the volume must be InUse or Available,
otherwise,it's will get 409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getSnapshot(GetSnapshotRequest)
volumeId
- The id of volume which will be used to create snapshot.snapshotName
- The name of snapshot will be created.
public CreateSnapshotResponse createSnapshot(String volumeId, String snapshotName, String desc)
409
errorCode.
While creating snapshot from CDS volume,,the volume must be InUs or Available,
otherwise,it's will get 409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getSnapshot(GetSnapshotRequest)
volumeId
- The id of volume which will be used to create snapshot.snapshotName
- The name of snapshot will be created.desc
- The optional parameter to describe the newly created snapshot.
public CreateSnapshotResponse createSnapshot(CreateSnapshotRequest request)
409
errorCode.
While creating snapshot from CDS volume,,the volume must be InUs or Available,
otherwise,it's will get 409
errorCode.
This is an asynchronous interface,
you can get the latest status by invoke getSnapshot(GetSnapshotRequest)
request
- The request containing all options for creating a new snapshot.
public ListSnapshotsResponse listSnapshots(ListSnapshotsRequest request)
request
- The request containing all options for listing snapshot.
public GetSnapshotResponse getSnapshot(String snapshotId)
snapshotId
- The id of snapshot.
public GetSnapshotResponse getSnapshot(GetSnapshotRequest request)
request
- The request containing all options for getting the detail information of specified snapshot.
public void deleteSnapshot(String snapshotId)
403
errorCode.
snapshotId
- The id of snapshot.public void deleteSnapshot(DeleteSnapshotRequest request)
403
errorCode.
request
- The request containing all options for deleting the specified snapshot.public ListSecurityGroupsResponse listSecurityGroups(ListSecurityGroupsRequest request)
request
- The request containing all options for listing SecurityGroup owned by user.
public CreateSecurityGroupResponse createSecurityGroup(CreateSecurityGroupRequest request)
request
- The request containing all options for creating a new SecurityGroup.
public void authorizeSecurityGroupRule(SecurityGroupRuleOperateRequest request)
request
- The request containing all options for authorizing security group rulepublic void revokeSecurityGroupRule(SecurityGroupRuleOperateRequest request)
request
- The request containing all options for revoking security group rulepublic void deleteSecurityGroup(String securityGroupId)
securityGroupId
- The id of SecurityGroup that will be deleted.public void deleteSecurityGroup(DeleteSecurityGroupRequest request)
request
- The request containing all options for deleting the specified SecurityGroup owned by user.public ListZonesResponse listZones()
public ListZonesResponse listZones(AbstractBceRequest request)
request
- use withRequestCredentials
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |