@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); } }
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)); } }
/** * 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)); }
/** * 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); } }
private void deleteVolumeForSnap(String snap) { waitForVolume(snap); String volId = getVolume(snap).getVolumeId(); log.info("Deleting volume " + volId); ec2Client.deleteVolume(new DeleteVolumeRequest().withVolumeId(volId)); }
/** * 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; }
@Override public void deleteVolume(DeleteVolumeRequest deleteVolumeRequest) throws AmazonServiceException, AmazonClientException { throw new UnsupportedOperationException("Not supported in mock"); }
/** * Deletes an ebs volume. */ public void deleteVolume(DeleteVolumeRequest req, AsyncHandler<DeleteVolumeRequest, DeleteVolumeResult> deletionHandler) { this.client.deleteVolumeAsync(req, deletionHandler); }
/** * Delete a Volume */ public static void deleteVolume(AmazonEC2AsyncClient client, String diskId) { client.deleteVolume(new DeleteVolumeRequest().withVolumeId(diskId)); }