public void deleteLoadBalancer(AwsProcessClient awsProcessClient, Long loadBalancerNo) { AwsLoadBalancer awsLoadBalancer = awsLoadBalancerDao.read(loadBalancerNo); // ロードバランサの削除 DeleteLoadBalancerRequest request = new DeleteLoadBalancerRequest(); request.withLoadBalancerName(awsLoadBalancer.getName()); awsProcessClient.getElbClient().deleteLoadBalancer(request); if (log.isInfoEnabled()) { log.info(MessageUtils.getMessage("IPROCESS-200112", awsLoadBalancer.getName())); } // イベントログ出力 processLogger.debug(null, null, "AwsElbDelete", new Object[] { awsProcessClient.getPlatform().getPlatformName(), awsLoadBalancer.getName() }); // データベース更新 awsLoadBalancer = awsLoadBalancerDao.read(loadBalancerNo); awsLoadBalancer.setDnsName(null); awsLoadBalancerDao.update(awsLoadBalancer); }
private DeferredResult<AWSLoadBalancerContext> deleteLoadBalancer( AWSLoadBalancerContext context) { DeleteLoadBalancerRequest request = new DeleteLoadBalancerRequest() .withLoadBalancerName(context.loadBalancerStateExpanded.name); String message = "Delete AWS Load Balancer with name [" + context.loadBalancerStateExpanded.name + "]"; AWSDeferredResultAsyncHandler<DeleteLoadBalancerRequest, DeleteLoadBalancerResult> handler = new AWSDeferredResultAsyncHandler<>(this, message); context.client.deleteLoadBalancerAsync(request, handler); return handler.toDeferredResult().thenApply(ignore -> context); }
public static void deleteLBsUsingLBClient(AmazonElasticLoadBalancingAsyncClient client, VerificationHost host, String lbName) throws Throwable { DeleteLoadBalancerRequest deleteLoadBalancerRequest = new DeleteLoadBalancerRequest() .withLoadBalancerName(lbName); try { client.deleteLoadBalancer(deleteLoadBalancerRequest); } catch (Exception e) { host.log(Level.SEVERE, "Error encountered in deleting load balancer on AWS: %s", Utils.toString(e)); } }
private void deleteAwsLoadBalancer(String name) { if (this.isMock) { return; } try { DeleteLoadBalancerRequest deleteRequest = new DeleteLoadBalancerRequest(name); this.client.deleteLoadBalancer(deleteRequest); } catch (Exception e) { this.host.log("Exception deleting a load balancer '%s': %s", name, e.toString()); } }
public static void deleteLoadBalancer(String name) { if (name == null || name.trim().length() == 0) throw new RuntimeException( "The name of the load balancer cannot be empty!"); connect(); DeleteLoadBalancerRequest req = new DeleteLoadBalancerRequest(); req.setLoadBalancerName(name); client.deleteLoadBalancer(req); }
public void deleteELB(String elbName) { logger.info("delete elb, elbName={}", elbName); elb.deleteLoadBalancer(new DeleteLoadBalancerRequest(elbName)); }