NAME

WWW::LogicBoxes::Role::Command::Domain - Domain Related Operations

SYNOPSIS

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Contact;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );

    # Retrieval
    my $domain = $logic_boxes->get_domain_by_id( 42 );
    my $domain = $logic_boxes->get_domain_by_domain( 'test-domain.com' );

    # Update Contacts
    my $contacts = {
        registrant_contact => WWW::LogicBoxes::Contact->new( ... ),
        admin_contact      => WWW::LogicBoxes::Contact->new( ... ),
        technical_contact  => WWW::LogicBoxes::Contact->new( ... ),
        billing_contact    => WWW::LogicBoxes::Contact->new( ... ),
    };

    $logic_boxes->update_domain_contacts(
        id                    => $domain->id,
        registrant_contact_id => $contacts->{registrant_contact}->id,
        admin_contact_id      => $contacts->{admin_contact}->id,
        technical_contact_id  => $contacts->{technical_contact}->id,
        billing_contact_id    => $contacts->{billing_contact}->id,
    );

    # Domain Locking
    $logic_boxes->enable_domain_lock_by_id( $domain->id );
    $logic_boxes->disable_domain_lock_by_id( $domain->id );

    # Domain Privacy
    $logic_boxes->enable_domain_privacy(
        id     => $domain->id,
        reason => 'Enabling Domain Privacy',
    );

    $logic_boxes->disable_domain_privacy(
        id     => $domain->id,
        reason => 'Disabling Domain Privacy',
    );

    # Nameservers
    $logic_boxes->update_domain_nameservers(
        id          => $domain->id,
        nameservers => [ 'ns1.logicboxes.com', 'ns1.logicboxes.com' ],
    );

    # Renewals
    $logic_boxes->renew_domain(
        id             => $domain->id,
        years          => 1,
        is_private     => 1,
        invoice_option => 'NoInvoice',
    );

REQUIRES

submit

DESCRIPTION

Implements domain related operations with the LogicBoxes's API.

See Also

For Domain Registration please see WWW::LogicBoxes::Role::Command::Domain::Registration
For Domain Availability please see WWW::LogicBoxes::Role::Command::Domain::Availability
For Private Nameservers please see WWW::LogicBoxes::Role::Command::Domain::PrivateNameServer

METHODS

get_domain_by_id

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    my $domain      = $logic_boxes->get_domain_by_id( 42 );

Given a Integer domain id, returns a matching WWW::LogicBoxes::Domain from LogicBoxes. In the event of no matching domain, returns undef.

NOTE For domain transfers that are in progress a domain_transfer record will be returned.

FURTHER NOTE LogicBoxes is a bit "hand wavey" with "Action Types" which is how this library knows if the domain you are retrieving is an in progress domain transfer or a domain. Because of this, and the fact that they can be modified at any time, construction of domains defaults to an instance of WWW::LogicBoxes::Domain unless LogicBoxes highlights this as a "AddTransferDomain." This should just work, but be mindful if you see any unusual or unexpected errors.

get_domain_by_name

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    my $domain      = $logic_boxes->get_domain_by_domain( 'test-domain.com' );

Given a full domain name, returns a matching WWW::LogicBoxes::Domain from LogicBoxes. In the event of no matching domain, returns undef,

NOTE For domain transfers that are in progress a domain_transfer record will be returned.

FURTHER NOTE See the note above about Action Types

update_domain_contacts

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Contact;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );

    # Update Contacts
    my $contacts = {
        registrant_contact => WWW::LogicBoxes::Contact->new( ... ),
        admin_contact      => WWW::LogicBoxes::Contact->new( ... ),
        technical_contact  => WWW::LogicBoxes::Contact->new( ... ),
        billing_contact    => WWW::LogicBoxes::Contact->new( ... ),
    };

    $logic_boxes->update_domain_contacts(
        id                    => $domain->id,
        is_transfer_locked    => 1,            # Optional, defaults to true and only relevant for registrant changes
        registrant_contact_id => $contacts->{registrant_contact}->id,
        admin_contact_id      => $contacts->{admin_contact}->id,
        technical_contact_id  => $contacts->{technical_contact}->id,
        billing_contact_id    => $contacts->{billing_contact}->id,
    );

Given a domain id and optionally a contact id for registrant_contact_id, admin_contact_id, technical_contact_id, and/or billing_contact_id, updates the domain contacts. Also accepted is an optional is_transfer_locked that indicates if a 60 day lock should be applied to the domain after a change of registrant contact. This value defaults to true if it's not provided and is only relevant for changes of the registrant contact that trigger the IRTP process.

This method is smart enough to not request a change if the contact hasn't been updated and consumers need only specify the elements that are changing.

enable_domain_lock_by_id

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    $logic_boxes->enable_domain_lock_by_id( $domain->id );

Given an Integer domain id, locks the domain so that it can not be transfered away.

disable_domain_lock_by_id

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    $logic_boxes->disable_domain_lock_by_id( $domain->id );

Given an Integer domain id, unlocks the domain so that it can be transfered away.

enable_domain_privacy

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    $logic_boxes->enable_domain_privacy(
        id     => $domain->id,
        reason => 'Enabling Domain Privacy',
    );

Given an Integer domain id and an optional reason ( defaults to "Enabling Domain Privacy" ), enables WHOIS Privacy Protect for the domain.

disable_domain_privacy

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    $logic_boxes->disable_domain_privacy(
        id     => $domain->id,
        reason => 'Disabling Domain Privacy',
    );

Given an Integer domain id and an optional reason ( defaults to "Disabling Domain Privacy" ), disabled WHOIS Privacy Protect for the domain.

update_domain_nameservers

    use WWW::LogicBoxes;
    use WWW::LogicBoxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    $logic_boxes->update_domain_nameservers(
        id          => $domain->id,
        nameservers => [ 'ns1.logicboxes.com', 'ns1.logicboxes.com' ],
    );

Given an Integer domain id and an ArrayRef of nameserver hostnames, sets the domain's authoritative nameservers.

renew_domain

    use WWW::LogicBoxes;
    use WWW::LogicBooxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    $logic_boxes->renew_domain(
        id             => $domain->id,
        years          => 1,
        is_private     => 1,
        invoice_option => 'NoInvoice',
    );

Extends the registration term for the specified domain by the specified number of years. Note, there is a limit as to how far into the future the expiration_date can be and it's specific to each TLD, see http://manage.logicboxes.com/kb/servlet/KBServlet/faq1375.html for details.

Arguments:

id

The domain id to renew

years

The number of years

is_private

This is optional, if not specified then the current privacy status of the domain will be used. If there is no charge for domain privacy in your reseller panel then this field doesn't really matter. However, if there is a cost for it and you don't pass is_private => 1 then the domain privacy will be cancelled since it's term will not match the registration term.

invoice_option

See "invoice_option" in WWW::LogicBoxes::DomainRequest for additional details about Invoicing Options. Defaults to NoInvoice.

Returns an instance of the domain object.

resend_verification_email

    use WWW::LogicBoxes;
    use WWW::LogicBooxes::Domain;

    my $logic_boxes = WWW::LogicBoxes->new( ... );
    $logic_boxes->resend_verification_email( id => $domain->id );

Given an Integer domain id, resends Verification email. Returns truthy if executed successfully or falsey if not. Will croak if unable to determine if the resend was successful.