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

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

Introduction

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

Prototype


public String getId() 

Source Link

Document

The identifier that Amazon Route 53assigned to the health check when you created it.

Usage

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

License:Apache License

protected void deleteHealthChecks(NamerRequest req, LambdaContext context) {
    String marker = null;/*from   ww  w .  j  av 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));
}