Package com.amazonaws.services.route53.model

Examples of com.amazonaws.services.route53.model.CreateHealthCheckRequest


                        log.debug("Skipping duplicate value: {}", value);
                        continue;
                    }
                    values.add(value);

                    ResourceRecord rr = new ResourceRecord();
                    rr.setValue(record.value);
                    resourceRecords.add(rr);
                }
                rrs.setResourceRecords(resourceRecords);

                ret.add(rrs);
View Full Code Here


        answer.add(new ComparableResourceRecord("3.3.3.3"));
        answer.add(new ComparableResourceRecord("2.2.2.2"));
        answer.add(new ComparableResourceRecord("1.1.1.1"));

        assertEquals(1, answer.toResourceRecordSets("Z123", "www.example.com", "A", 60L).size());
        ResourceRecordSet rrset = answer.toResourceRecordSets("Z123", "www.example.com", "A", 60L).get(0);
        assertEquals(new Long(60L), rrset.getTTL());
        assertEquals("A", rrset.getType());
        assertEquals("www.example.com", rrset.getName());
        assertEquals("1.1.1.1", rrset.getResourceRecords().get(0).getValue());
        assertEquals("2.2.2.2", rrset.getResourceRecords().get(1).getValue());
        assertEquals("3.3.3.3", rrset.getResourceRecords().get(2).getValue());
    }
View Full Code Here

                    String subTreeName = subTreePrefix + "." + secondaryName;
                    AliasTarget target = new AliasTarget();
                    target.setDNSName(subTreeName);
                    target.setEvaluateTargetHealth(true);
                    target.setHostedZoneId(hostedZoneId);
                    ResourceRecordSet rr = new ResourceRecordSet();
                    rr.setName(secondaryName);
                    rr.setWeight(0L);
                    rr.setType(type);
                    rr.setAliasTarget(target);
                    rr.setSetIdentifier(subTreePrefix);

                    vulcanized.addAll(vulcanize(hostedZoneId, subTreeName, type, ttl,
                            lattice.simulateFailure(dimension, value).getAllEndpoints(), recordsPerRecordSet));
                    vulcanized.add(rr);
                }
            }

            /* Add an alias to the secondary level */
            AliasTarget target = new AliasTarget();
            target.setDNSName(secondaryName);
            target.setEvaluateTargetHealth(true);
            target.setHostedZoneId(hostedZoneId);
            ResourceRecordSet rr = new ResourceRecordSet();
            rr.setName(name);
            rr.setWeight(0L);
            rr.setType(type);
            rr.setAliasTarget(target);
            rr.setSetIdentifier("secondary for " + name);

            vulcanized.add(rr);
        }

        return vulcanized;
View Full Code Here

            /* Convert to the baseclass */
            rrs.add(crr);
        }

        ResourceRecordSet leafNode = new ResourceRecordSet();

        leafNode.setType(type);
        leafNode.setTTL(ttl);
        leafNode.setResourceRecords(rrs);

        /* Set a nominal weight so that we can set an identifier */
        leafNode.setWeight(1L);
        leafNode.setSetIdentifier("leafnode");
        leafNode.setName(name);

        List<String> healthchecksRemaining = new ArrayList<String>(healthcheckIds);
        if (healthchecksRemaining.size() > 0) {
            leafNode.setHealthCheckId(healthchecksRemaining.remove(0));
        }

        rrsList.add(leafNode);

        if (healthchecksRemaining.isEmpty()) {
            return rrsList;
        }

        /*
         * If more than one health-check is associated with the answer set, we
         * can use a chain of ALIAS records, each dependent on a different
         * health-check to form a logical AND of the health-checks.
         */
        ResourceRecordSet entryNode = leafNode;
        while (!healthchecksRemaining.isEmpty()) {
            ResourceRecordSet alias = new ResourceRecordSet();
            AliasTarget aliasTarget = new AliasTarget();

            String checksum = checksumResourceRecordSetData(entryNode);

            /* The alias will be the new entry node, inherit its properties */
            alias.setName(entryNode.getName());
            alias.setType(entryNode.getType());
            alias.setWeight(entryNode.getWeight());

            /* Consume a health-check */
            alias.setHealthCheckId(healthchecksRemaining.remove(0));

            /* Rename the previous entry node */
            String targetName = checksum + "." + entryNode.getName();
            entryNode.setName(targetName);
            aliasTarget.setDNSName(targetName);
            aliasTarget.setEvaluateTargetHealth(true);
            aliasTarget.setHostedZoneId(hostedZoneId);

            /* Associate the alias and the alias target */
            alias.setSetIdentifier("Alias to " + checksum);
            alias.setAliasTarget(aliasTarget);

            /* Add the alias and make it the new entry node */
            rrsList.add(alias);
            entryNode = alias;
        }
View Full Code Here

                        log.info("Ignoring SOA record not at root of AWS hosted zone: {}", name);
                        continue;
                    }
                }

                ResourceRecordSet rrs = new ResourceRecordSet();
                rrs.setName(name);
                rrs.setWeight(r.weight);

                Long ttl = r.ttl;
                if (ttl == null) {
                    ttl = 600L;
                }
                rrs.setTTL(ttl);

                rrs.setType(r.type);

                // rrs.setSetIdentifier("openstack:" + r.zone_id + ":" + r.id);

                List<ResourceRecord> resourceRecords = Lists.newArrayList();
                Set<String> values = Sets.newHashSet();

                for (Record record : r.records) {
                    String value = record.value;
                    // These get encoded into a string for route 53
                    if (record.port != null) {
                        throw new IllegalStateException();
                    }
                    if (record.priority != null) {
                        throw new IllegalStateException();
                    }
                    if (record.weight != null) {
                        throw new IllegalStateException();
                    }

                    if (values.contains(value)) {
                        log.debug("Skipping duplicate value: {}", value);
                        continue;
                    }
                    values.add(value);

                    ResourceRecord rr = new ResourceRecord();
                    rr.setValue(record.value);
                    resourceRecords.add(rr);
                }
                rrs.setResourceRecords(resourceRecords);

                ret.add(rrs);
            }
            return ret;
        }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("ThrottlingException"))
            return null;

        ThrottlingException e = (ThrottlingException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("TooManyHealthChecks"))
            return null;

        TooManyHealthChecksException e = (TooManyHealthChecksException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("TooManyHealthChecks"))
            return null;

        TooManyHealthChecksException e = (TooManyHealthChecksException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("TooManyHostedZones"))
            return null;

        TooManyHostedZonesException e = (TooManyHostedZonesException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

        // marshaller understands.
        String errorCode = parseErrorCode(node);
        if (errorCode == null || !errorCode.equals("TooManyHostedZones"))
            return null;

        TooManyHostedZonesException e = (TooManyHostedZonesException)super.unmarshall(node);
       
        return e;
    }
View Full Code Here

TOP

Related Classes of com.amazonaws.services.route53.model.CreateHealthCheckRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.