Example usage for com.amazonaws.services.route53.model HealthCheck getCallerReference

List of usage examples for com.amazonaws.services.route53.model HealthCheck getCallerReference

Introduction

In this page you can find the example usage for com.amazonaws.services.route53.model HealthCheck getCallerReference.

Prototype


public String getCallerReference() 

Source Link

Document

A unique string that you specified when you created the health check.

Usage

From source file:com.deploymentio.ec2namer.helpers.DnsRegistrar.java

License:Apache License

protected void deleteHealthChecks(NamerRequest req, LambdaContext context) {
    String marker = null;/*  www.  j  a v a  2 s  .com*/
    do {
        ListHealthChecksResult result = route53
                .listHealthChecks(new ListHealthChecksRequest().withMarker(marker));
        for (HealthCheck hc : result.getHealthChecks()) {
            if (hc.getCallerReference().startsWith(req.getInstanceId())) {
                String hcId = hc.getId();
                route53.deleteHealthCheck(new DeleteHealthCheckRequest().withHealthCheckId(hcId));
                context.log("Deleted health-check: Id=" + hcId + " FQDN="
                        + hc.getHealthCheckConfig().getFullyQualifiedDomainName());
            }
        }

    } while (!StringUtils.isEmpty(marker));
}