private void executeChange(Change change, HostedZone hostedZone) { logger.info("Execute change {} ", change); ChangeResourceRecordSetsRequest changeResourceRecordSetsRequest = new ChangeResourceRecordSetsRequest(); changeResourceRecordSetsRequest.setHostedZoneId(hostedZone.getId()); ChangeBatch changeBatch = new ChangeBatch(); changeBatch.withChanges(change); changeResourceRecordSetsRequest.setChangeBatch(changeBatch); amazonRoute53Client.changeResourceRecordSets(changeResourceRecordSetsRequest); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHostedZoneId() == null) ? 0 : getHostedZoneId().hashCode()); hashCode = prime * hashCode + ((getChangeBatch() == null) ? 0 : getChangeBatch().hashCode()); return hashCode; }
/** * Constructs a new ChangeResourceRecordSetsRequest object. Callers should use the setter or fluent setter (with...) * methods to initialize any additional object members. * * @param hostedZoneId * The ID of the hosted zone that contains the resource record sets that you want to change. * @param changeBatch * A complex type that contains an optional comment and the <code>Changes</code> element. */ public ChangeResourceRecordSetsRequest(String hostedZoneId, ChangeBatch changeBatch) { setHostedZoneId(hostedZoneId); setChangeBatch(changeBatch); }
@TaskAction public void changeResourceRecordSets() { // to enable conventionMappings feature String hostedZoneId = getHostedZoneId(); String rrsName = getRrsName(); String resourceRecord = getResourceRecord(); AmazonRoute53PluginExtension ext = getProject().getExtensions().getByType(AmazonRoute53PluginExtension.class); AmazonRoute53 route53 = ext.getClient(); route53.changeResourceRecordSets(new ChangeResourceRecordSetsRequest() .withHostedZoneId(hostedZoneId) .withChangeBatch(new ChangeBatch() .withChanges(new Change(ChangeAction.CREATE, new ResourceRecordSet(rrsName, RRType.CNAME) .withResourceRecords(new ResourceRecord(resourceRecord)))))); getLogger().info("change {} requested", hostedZoneId); } }
ChangeResourceRecordSetsRequest req = new ChangeResourceRecordSetsRequest(zoneId, changeBatch);
/** * <p> * A complex type that contains an optional comment and the <code>Changes</code> element. * </p> * * @param changeBatch * A complex type that contains an optional comment and the <code>Changes</code> element. * @return Returns a reference to this object so that method calls can be chained together. */ public ChangeResourceRecordSetsRequest withChangeBatch(ChangeBatch changeBatch) { setChangeBatch(changeBatch); return this; }
/** * <p> * The ID of the hosted zone that contains the resource record sets that you want to change. * </p> * * @param hostedZoneId * The ID of the hosted zone that contains the resource record sets that you want to change. * @return Returns a reference to this object so that method calls can be chained together. */ public ChangeResourceRecordSetsRequest withHostedZoneId(String hostedZoneId) { setHostedZoneId(hostedZoneId); return this; }
ChangeResourceRecordSetsResult rresult = r53Clinet_.changeResourceRecordSets(new ChangeResourceRecordSetsRequest() .withHostedZoneId(zoneId) .withChangeBatch(new ChangeBatch() .withChanges(new Change() .withAction(ChangeAction.UPSERT)
private void executeChange(Change change, HostedZone hostedZone) { logger.info("Execute change {} ", change); ChangeResourceRecordSetsRequest changeResourceRecordSetsRequest = new ChangeResourceRecordSetsRequest(); changeResourceRecordSetsRequest.setHostedZoneId(hostedZone.getId()); ChangeBatch changeBatch = new ChangeBatch(); changeBatch.withChanges(change); changeResourceRecordSetsRequest.setChangeBatch(changeBatch); amazonRoute53Client.changeResourceRecordSets(changeResourceRecordSetsRequest); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ChangeResourceRecordSetsRequest == false) return false; ChangeResourceRecordSetsRequest other = (ChangeResourceRecordSetsRequest) obj; if (other.getHostedZoneId() == null ^ this.getHostedZoneId() == null) return false; if (other.getHostedZoneId() != null && other.getHostedZoneId().equals(this.getHostedZoneId()) == false) return false; if (other.getChangeBatch() == null ^ this.getChangeBatch() == null) return false; if (other.getChangeBatch() != null && other.getChangeBatch().equals(this.getChangeBatch()) == false) return false; return true; }
ResourceRecord record = new ResourceRecord(loadBalancer); List<ResourceRecord> records = new ArrayList<ResourceRecord>(); records.add(record); ResourceRecordSet recordsSet = new ResourceRecordSet(); recordsSet.setResourceRecords(records); recordsSet.setType(RRType.CNAME); recordsSet.setTTL(900L); recordsSet.setName(subdomain + "."); Change change = new Change(ChangeAction.CREATE, recordsSet); List<Change> changes = new ArrayList<Change>(); changes.add(change); ChangeBatch batch = new ChangeBatch(changes); ChangeResourceRecordSetsRequest request = new ChangeResourceRecordSetsRequest(); request.setChangeBatch(batch); request.setHostedZoneId(hostedZoneId); ChangeResourceRecordSetsResult result = getRoute53Client().changeResourceRecordSets(request); System.out.println(result);
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getHostedZoneId() != null) sb.append("HostedZoneId: ").append(getHostedZoneId()).append(","); if (getChangeBatch() != null) sb.append("ChangeBatch: ").append(getChangeBatch()); sb.append("}"); return sb.toString(); }
uriResourcePath = com.amazonaws.transform.PathMarshallers.NON_GREEDY.marshall(uriResourcePath, "Id", changeResourceRecordSetsRequest.getHostedZoneId()); request.setResourcePath(uriResourcePath); if (changeResourceRecordSetsRequest != null) { ChangeBatch changeBatch = changeResourceRecordSetsRequest.getChangeBatch(); if (changeBatch != null) { xmlWriter.startElement("ChangeBatch");