Webservice::OVH::Domain::Zone::Record
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;
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.
Internal Method to create a Record object. This method should never be called directly.
Parameter: $api_wrapper - ovh api wrapper object, $module - root object, $zone - parent zone Objekt, $record_id => api intern id
Return: Webservice::OVH::Domain::Zone::Record
Synopsis: Webservice::OVH::Domain::Zone::Record->_new_existing($ovh_api_wrapper, $module, $zone, $record_id);
Internal Method to create the zone object. This method should never be called directly.
Parameter: $api_wrapper - ovh api wrapper object, $module - root object, $zone - parent zone, %params - key => value
Synopsis: Webservice::OVH::Domain::Zone::Record->_new($ovh_api_wrapper, $module, $zone_name, target => '0.0.0.0', field_type => 'A', sub_domain => 'www');
When this record is deleted on the api side, this method returns 0.
Return: VALUE
Synopsis: print "Valid" if $record->is_valid;
Intern method to check validity. Difference is that this method carps an error.
Synopsis: $record->_is_valid;
Returns the api id of this record
Synopsis: my $id = $record->id;
Returns the zone this record is attached to.
Return: Webservice::Domain::Zone
Synopsis: my $zone = $record->zone;
Returns the raw properties as a hash. This is the original return value of the web-api.
Return: HASH
Synopsis: my $properties = $record->properties;
Exposed property value.
Synopsis: my $field_type = $record->field_type;
Synopsis: my $sub_domain = $record->sub_domain;
Synopsis: my $target = $record->target;
Synopsis: my $ttl = $record->ttl;
Deletes the record api sided and sets this object invalid. After deleting, the zone must be refreshed, if the refresh parameter is not set.
Parameter: $refresh 'true' 'false' undef - imidiate refreshing of the domain zone
Synopsis: $record->delete('true');
Changes the record After changing the zone must be refreshed, if the refresh parameter is not set.
Parameter: %params - key => value sub_domain target ttl refresh
Synopsis: $record->change(sub_domain => 'www', refresh => 'true');
To install Webservice::OVH, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Webservice::OVH
CPAN shell
perl -MCPAN -e shell install Webservice::OVH
For more information on module installation, please visit the detailed CPAN module installation guide.