Java 类com.amazonaws.services.ec2.model.DeleteVolumeRequest 实例源码

项目:photon-model    文件:TestAWSEnumerationTask.java   
@After
public void tearDown() throws Throwable {
    if (this.testEbsId != null) {
        DetachVolumeRequest detachVolumeRequest = new DetachVolumeRequest().withVolumeId(this.testEbsId);
        this.client.detachVolume(detachVolumeRequest);
    }
    if (this.host == null) {
        return;
    }
    if (this.bucketToBeDeleted != null) {
        this.s3Client.deleteBucket(this.bucketToBeDeleted);
    }
    tearDownAwsVMs();
    tearDownTestVpc(this.client, this.host, this.awsTestContext, this.isMock);
    this.client.shutdown();
    this.s3Client.shutdown();
    if (ENABLE_LOAD_BALANCER_ENUMERATION) {
        tearDownAwsLoadBalancer();
        this.lbClient.shutdown();
    }
    setAwsClientMockInfo(false, null);
    if (this.testEbsId != null) {
        DeleteVolumeRequest deleteVolumeRequest = new DeleteVolumeRequest().withVolumeId(this.testEbsId);
        this.client.deleteVolume(deleteVolumeRequest);
    }
}
项目:primecloud-controller    文件:AwsVolumeProcess.java   
public void deleteVolume(AwsProcessClient awsProcessClient, Long instanceNo, Long volumeNo) {
    AwsVolume awsVolume = awsVolumeDao.read(volumeNo);
    String volumeId = awsVolume.getVolumeId();

    // イベントログ出力
    Component component = null;
    if (awsVolume.getComponentNo() != null) {
        component = componentDao.read(awsVolume.getComponentNo());
    }
    Instance instance = null;
    if (instanceNo != null) {
        instance = instanceDao.read(instanceNo);
    }
    processLogger.debug(component, instance, "AwsEbsDelete", new Object[] {
            awsProcessClient.getPlatform().getPlatformName(), awsVolume.getVolumeId() });

    // ボリュームの削除
    DeleteVolumeRequest request = new DeleteVolumeRequest();
    request.withVolumeId(volumeId);
    awsProcessClient.getEc2Client().deleteVolume(request);

    // ログ出力
    if (log.isInfoEnabled()) {
        log.info(MessageUtils.getMessage("IPROCESS-100127", volumeId));
    }
}
项目:photon-model    文件:TestAWSSetupUtils.java   
/**
 * Deletes ebs volume on AWS
 *
 */
public static void deleteEbsVolumeUsingEC2Client(AmazonEC2AsyncClient client,
        VerificationHost host, String volumeId)
        throws Throwable {

    host.log("Deleting disk with id " + volumeId
            + " from the AWS endpoint using the EC2 client.");

    client.deleteVolume(new DeleteVolumeRequest().withVolumeId(volumeId));
}
项目:director-aws-plugin    文件:EBSAllocator.java   
/**
 * Deletes a specified collection of volumes.
 *
 * @param volumeIds the collection of volume ids to delete.
 */
public void deleteVolumes(Collection<String> volumeIds) {
  LOG.info(">> Deleting {} volumes", volumeIds.size());
  for (String id : volumeIds) {
    // TODO volumes that are attached need to be detached before we can delete
    DeleteVolumeRequest request = new DeleteVolumeRequest().withVolumeId(id);
    client.deleteVolume(request);
  }
}
项目:data-lifecycle-service-broker    文件:AWSHelper.java   
private void deleteVolumeForSnap(String snap) {

        waitForVolume(snap);
        String volId = getVolume(snap).getVolumeId();
        log.info("Deleting volume " + volId);
        ec2Client.deleteVolume(new DeleteVolumeRequest().withVolumeId(volId));
    }
项目:aws-mock    文件:BaseTest.java   
/**
 * Delete Volume.
 *
 * @param volumeId the volume id
 * @return true if deleted, otherwise false.
 */
protected final boolean deleteVolume(final String volumeId) {
    DeleteVolumeRequest req = new DeleteVolumeRequest();
    req.setVolumeId(volumeId);
    DeleteVolumeResult result = amazonEC2Client.deleteVolume(req);
    if (result != null) {
        return true;
    }

    return false;
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public void deleteVolume(DeleteVolumeRequest deleteVolumeRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:photon-model    文件:AwsDiskClient.java   
/**
 * Deletes an ebs volume.
 */
public void deleteVolume(DeleteVolumeRequest req,
        AsyncHandler<DeleteVolumeRequest, DeleteVolumeResult> deletionHandler) {
    this.client.deleteVolumeAsync(req, deletionHandler);
}
项目:photon-model    文件:TestAWSSetupUtils.java   
/**
 * Delete a Volume
 */
public static void deleteVolume(AmazonEC2AsyncClient client, String diskId) {
    client.deleteVolume(new DeleteVolumeRequest().withVolumeId(diskId));
}