++ed by:
SZABGAB ADAMJS

2 PAUSE users
4 non-PAUSE users.

Adam Hopkins

NAME

DigitalOcean::Domain - Represents a Domain object in the DigitalOcean API

VERSION

version 0.16

SYNOPSIS

    FILL ME IN   

DESCRIPTION

FILL ME IN

METHODS

name

The name of the domain itself. This should follow the standard domain format of domain.TLD. For instance, example.com is a valid domain name.

ttl

This value is the time to live for the records on this domain, in seconds. This defines the time frame that clients can cache queried information before a refresh should be requested.

zone_file

This attribute contains the complete contents of the zone file for the selected domain. Individual domain record resources should be used to get more granular control over records. However, this attribute can also be used to get information about the SOA record, which is created automatically and is not accessible as an individual record resource.

path

Returns the api path for this domain

records

This will return a DigitalOcean::Collection that can be used to iterate through the DigitalOcean::Domain::Record objects of the records collection that is associated with this domain.

    my $records_collection = $domain->records;
    my $obj;

    while($obj = $records_collection->next) { 
        print $obj->id . "\n";
    }

If you would like a different per_page value to be used for this collection instead of "DigitalOcean::/"per_page"" in per_page, it can be passed in as a parameter:

    #set default for all collections to be 30
    $do->per_page(30);

    #set this collection to have 2 objects returned per page
    my $records_collection = $domain->records(2);
    my $obj;

    while($obj = $records_collection->next) { 
        print $obj->id . "\n";
    }

create_record

This will create a new record associated with this domain. Returns a DigitalOcean::Domain::Record object.

  • type Required (All Records), String, The record type (A, MX, CNAME, etc).

  • name Required (A, AAAA, CNAME, TXT, SRV), String, The host name, alias, or service being defined by the record.

  • data Required (A, AAAA, CNAME, MX, TXT, SRV, NS), String, Variable data depending on record type. See the [Domain Records]() section for more detail on each record type.

  • priority Optional, Number, The priority of the host (for SRV and MX records. null otherwise).

  • port Optional, Number, The port that the service is accessible on (for SRV records only. null otherwise).

  • weight Optional, Number, The weight of records with the same priority (for SRV records only. null otherwise).

    my $record = $domain->create_record(
        type => 'A',
        name => 'test',
        data => '196.87.89.45',
    );

record

This will retrieve a record by id and return a DigitalOcean::Domain::Record object.

    my $record = $domain->record(56789);

delete

This deletes the domain from your account. This will return 1 on success and undef on failure.

id

AUTHOR

Adam Hopkins <srchulo@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2016 by Adam Hopkins.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.