Search in sources :

Example 1 with GetChangeResult

use of com.amazonaws.services.route53.model.GetChangeResult in project Synapse-Stack-Builder by Sage-Bionetworks.

the class Route53Setup method setupResources.

public void setupResources() throws InterruptedException {
    List<Change> changes = buildChangesList(Constants.ROUTE53_PREFIXES);
    if (changes.size() > 0) {
        ChangeBatch changeBatch = new ChangeBatch().withChanges(changes);
        ChangeResourceRecordSetsRequest cReq = new ChangeResourceRecordSetsRequest().withHostedZoneId(hostedZone.getId()).withChangeBatch(changeBatch);
        ChangeResourceRecordSetsResult cRes = route53Client.changeResourceRecordSets(cReq);
        GetChangeRequest gcReq = new GetChangeRequest(cRes.getChangeInfo().getId());
        GetChangeResult gcRes = route53Client.getChange(gcReq);
        // TODO: No real need to wait here, could just exit
        while (!"INSYNC".equals(gcRes.getChangeInfo().getStatus())) {
            Thread.sleep(1000L);
            gcRes = route53Client.getChange(gcReq);
            String s = gcRes.getChangeInfo().getStatus();
        }
    }
}
Also used : ChangeBatch(com.amazonaws.services.route53.model.ChangeBatch) Change(com.amazonaws.services.route53.model.Change) ChangeResourceRecordSetsRequest(com.amazonaws.services.route53.model.ChangeResourceRecordSetsRequest) ChangeResourceRecordSetsResult(com.amazonaws.services.route53.model.ChangeResourceRecordSetsResult) GetChangeRequest(com.amazonaws.services.route53.model.GetChangeRequest) GetChangeResult(com.amazonaws.services.route53.model.GetChangeResult)

Aggregations

Change (com.amazonaws.services.route53.model.Change)1 ChangeBatch (com.amazonaws.services.route53.model.ChangeBatch)1 ChangeResourceRecordSetsRequest (com.amazonaws.services.route53.model.ChangeResourceRecordSetsRequest)1 ChangeResourceRecordSetsResult (com.amazonaws.services.route53.model.ChangeResourceRecordSetsResult)1 GetChangeRequest (com.amazonaws.services.route53.model.GetChangeRequest)1 GetChangeResult (com.amazonaws.services.route53.model.GetChangeResult)1