Adam Hopkins > DigitalOcean-0.16.2 > DigitalOcean::Domain

Download:
DigitalOcean-0.16.2.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

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.

    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.

syntax highlighting: