The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Webservice::OVH::Domain::Zone

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' );
    }
    
    $zone->refresh;
    $zone->reset;
    
    $zone->change_contact(contact_billing => 'account-ovh', contact_tech => 'account-ovh', contact_admin => 'account-ovh');

DESCRIPTION

Provieds basic functionality for Zones. Records can be created and fetched. Records can be fetched through a filter. A zone contact_change can be initialized.

METHODS

_new

Internal Method to create the zone object. This method is not ment to be called external.

  • Parameter: $api_wrapper - ovh api wrapper object, $module - root object

  • Return: Webservice::OVH::Domain::Zone

  • Synopsis: Webservice::OVH::Domain::Zone->_new($ovh_api_wrapper, $zone_name, $module);

service_infos

Retrieves additional infos about the zone. Infos that are not part of the properties

  • Return: HASH

  • Synopsis: my $info = $zone->service_info;

properties

Retrieves properties of the zone. This method updates the intern property variable.

  • Return: HASH

  • Synopsis: my $properties = $zone->properties;

dnssec_supported

Exposed Property Value. Readonly.

  • Return: VALUE

  • Synopsis: my $value = $zone->dnssec_supported;

has_dns_anycast

Exposed Property Value. Readonly.

  • Return: VALUE

  • Synopsis: my $value = $zone->has_dns_anycast;

last_update

Exposed Property Value. Readonly.

  • Return: DateTime

  • Synopsis: my $value = $zone->last_update;

name_servers

Exposed Property Value. Readonly.

  • Return: ARRAY

  • Synopsis: my $value = $zone->name_servers;

records

Produces an Array of record Objects. Can be filtered by field_type and sub_domain.

  • Parameter: %filter - (optional) - field_type => record type sub_domain => subdomain string

  • Return: ARRAY

  • Synopsis: my $records = $zone->records(field_type => 'A', sub_domain => 'www');

record

Returns a single record by id

new_record

Creates a new record.

  • Parameter: %params - refresh => 'true', 'false' - directly refreshes the zone target (required) => '0.0.0.0' ttl (optional) => 3000 sub_domain (optional) => 'www' field_type (required) => 'A'

  • Return: Webservice::OVH::Domain::Zone::Record

  • Synopsis: my $record = $zone->new_record(field_type => 'MX', target => '1 my.mailserver.de.');

name

Name is the unique identifier.

  • Return: VALUE

  • Synopsis: my $name = $zone->name;

change_contact

Changes contact information for this zone. Contact must be another ovh account name.

  • Parameter: %params - contactBilling (optional) => 'account-ovh' contact_admin (optional) => 'account-ovh' contact_tech (optional) => 'account-ovh'

  • Return: Webservice::OVH::Me::Task

  • Synopsis: my $task = $zone->change_contact(contact_billing => 'another-ovh');

refresh

Refreshes the domain zone and applies changes.

  • Synopsis:$zone->refresh;

reset

Deletes all custom records and resetzt to default.

  • Parameter: $minimal - only creates nesseccary dns records

  • Synopsis: $zone->reset;