NAME

Webservice::OVH::Domain::Zone::Record

SYNOPSIS

use Webservice::OVH;

my $ovh = Webservice::OVH->new_from_json("credentials.json");

my $zone = $ovh->domain->zone("myzone.de");

my $a_record = $zone->new_record(field_type => 'A', target => '0.0.0.0', ttl => 1000 ); my $mx_record = $zone->new_record(field_type => 'MX', target => '1 my.mail.server.de.');

my $records = $zone->records(filed_type => 'A', sub_domain => 'www');

foreach my $record (@$records) {

    $record->change( target => '0.0.0.0' );
    $record->zone->refresh;
    $record->change( sub_domain => 'www', refresh => 'true' );
}

$record->delete('true');

print "Not Valid anymore" unless $record->is_valid;

DESCRIPTION

Provides all api Record Methods available in the api. Delete deletes the record object in the api and makes the object invalid. No actions be done with it, when it is invalid.

METHODS

_new_existing

Internal Method to create a Record object. This method should never be called directly.

_new

Internal Method to create the zone object. This method should never be called directly.

is_valid

When this record is deleted on the api side, this method returns 0.

_is_valid

Intern method to check validity. Difference is that this method carps an error.

id

Returns the api id of this record

zone

Returns the zone this record is attached to.

properties

Returns the raw properties as a hash. This is the original return value of the web-api.

field_type

Exposed property value.

sub_domain

Exposed property value.

target

Exposed property value.

ttl

Exposed property value.

delete

Deletes the record api sided and sets this object invalid. After deleting, the zone must be refreshed, if the refresh parameter is not set.

change

Changes the record After changing the zone must be refreshed, if the refresh parameter is not set.