NAME
Net::Amazon::R53::AtomicChange - Representation of an atomic change
VERSION
This document describes version 0.001 of Net::Amazon::R53::AtomicChange - released December 26, 2012 as part of Net-Amazon-R53.
SYNOPSIS
# we have 2 sets of Stubs; a before (alpha) and after (omega)
my $r53 = Net::Amazon::R53->new(...);
my $hz = $r53->hosted_zone_by_id('XXX');
my @to_rrs = [ ... ];
my $ac = $r53->atomic_change_class->new(
alpha => [ $hz->resource_record_sets ],
omega => [ @to_rrs ],
);
# apply our change to the zone in question; dies on failure
my $change = $r53
->hosted_zone_by_id($id)
->apply_atomic_change($ac)
;
# alternatively, just allow alpha to coerce the hosted zone instance
my $ac = $r53->atomic_change_class->new(
alpha => $hz,
omega => [ @to_rrs ],
);
DESCRIPTION
This class takes two sets of Net::Amazon::ResourceRecordSet::Stubs and calculates the CREATE and DELETE commands that would be needed to transform the first set (alpha) into the second (omega).
Both sets can be specified as references to arrays of Stubs or as HostedZone instances. If specified as HostedZone instances, they will be coerced to an array reference of Stubs (remember that Net::Amazon::ResourceRecordSet is actually a descendent of Net::Amazon::ResourceRecordSet::Stub, so they can be legally used here).
Note that we do not actually perform any changes; we merely calculate and validate. To actually apply this change to a hosted zone, see "apply_atomic_change" in Net::Amazon::R53::HostedZone.
REQUIRED ATTRIBUTES
These attributes are required, and must have their values supplied during object construction.
alpha
This is the set of the "from" resource records.
Legal values:
* An ArrayRef of Stubs.
* HostedZone (coerced via "resource_record_sets" in Net::Amazon::R53::HostedZone).
omega
This is the set of the "to" resource records.
Legal values:
* An ArrayRef of Stubs.
* HostedZone (coerced via "resource_record_sets" in Net::Amazon::R53::HostedZone).
LAZY ATTRIBUTES
These attributes are lazily constructed from another source (e.g. required attributes, external source, a BUILD() method, or some combo thereof). You can set these values at construction time, though this is generally neither required nor recommended.
to_delete
The list of DELETE changes.
This attribute cannot be populated via the constructor.
to_create
The list of CREATE changes.
This attribute cannot be populated via the constructor.
changes
This is the set of Net::Amazon::Route53::ResourceRecordSet::Change representing what needs to be done to get from our alpha to our omega.
That is, this attribute contains all the DELETE
and CREATE
requests needed to transform set alpha into set omega.
This attribute cannot be populated via the constructor.
METHODS
has_changes()
True if we have any changes to make.
has_no_changes(), null_changeset()
True if we have no changes to make (that is, alpha and omega are equivalent).
number_of_changes()
Our count of all changes.
all_changes()
All of our changes, but as a list, not an ArrayRef.
SEE ALSO
Please see those modules/websites for more information related to this module.
AUTHOR
Chris Weyl <cweyl@alumni.drew.edu>
COPYRIGHT AND LICENSE
This software is Copyright (c) 2012 by Campus Explorer, Inc.
This is free software, licensed under:
The GNU Lesser General Public License, Version 2.1, February 1999