@@ -8,14 +8,15 @@ use WebService::Linode::Base;
=head1 NAME
-WebService::Linode::DNS - Perl Interface to the Linode.com API DNS methods.
+WebService::Linode::DNS - Deprecated Perl Interface to the Linode.com API DNS methods.
=cut
-our $VERSION = '0.16';
+our $VERSION = '0.20';
our @ISA = ("WebService::Linode::Base");
sub getDomainIDbyName {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my $self = shift;
my $name = shift;
$self->_debug(10, 'getDomainIDbyName called for: ' . $name);
@@ -36,6 +37,7 @@ sub getDomainIDbyName {
}
sub domainList {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my $self = shift;
$self->_debug(10, 'domainList called');
@@ -56,6 +58,7 @@ sub domainList {
}
sub domainGet {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainGet called');
my $domainid;
@@ -82,6 +85,7 @@ sub domainGet {
}
sub domainCreate {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainCreate called');
@@ -92,12 +96,14 @@ sub domainCreate {
}
sub domainSave {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
carp "Deprecated use of domainSave, use domainCreate";
return $self->domainCreate(%args);
}
sub domainUpdate {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainUpdate called');
@@ -116,6 +122,7 @@ sub domainUpdate {
}
sub domainDelete {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainDelete called');
@@ -131,6 +138,7 @@ sub domainDelete {
}
sub domainResourceList {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainResourceList called');
my $domainid;
@@ -163,6 +171,7 @@ sub domainResourceList {
}
sub domainResourceGet {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainResourceGet called');
@@ -194,6 +203,7 @@ sub domainResourceGet {
}
sub getResourceIDbyName {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'getResourceIDbyName called');
@@ -214,6 +224,7 @@ sub getResourceIDbyName {
}
sub domainResourceCreate {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainResourceCreate called');
@@ -224,6 +235,7 @@ sub domainResourceCreate {
}
sub domainResourceSave {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainResourceCreate called');
@@ -233,6 +245,7 @@ sub domainResourceSave {
}
sub domainResourceUpdate {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainResourceUpdate called');
@@ -245,6 +258,7 @@ sub domainResourceUpdate {
}
sub domainResourceDelete {
+ carp "WebService::Linode::DNS is deprecated, use WebService::Linode instead!";
my ($self, %args) = @_;
$self->_debug(10, 'domainResourceDelete called');
@@ -261,106 +275,12 @@ sub domainResourceDelete {
=head1 SYNOPSIS
-THIS MODULE IS DEPRECATED, DON'T USE IT, USE WebService::Linode
-
-This module provides a simple OOish interface to the Linode.com API.
-
-Example usage:
-
- use WebService::Linode::DNS;
-
- my $api = WebService::Linode::DNS->new(apikey => 'mmmcake');
- for my $domain (@{$api->domainList}) {
- print $domain->{domainid}, "\n";
- }
+THIS MODULE IS DEPRECATED, DON'T USE IT, USE L<WebService::Linode>
=head1 METHODS
-=head2 new
-
-All methods take the same parameters as the Linode API itself does. Field
-names should be lower cased. All caps fields from the Linode API will be
-lower cased before returning the data.
-
-Accepts a hash as an argument. apikey is the only required parameter
-specifying your Linode API key.
-
-Errors mirror the perl DBI error handling method.
-$WebService::Linode::DNS::err and ::errstr will be populated with the last error
-number and string that occurred. All errors generated within the module
-are currently error code -1. By default, will warn on errors as well, pass
-a true value for fatal to die instead or nowarn to prevent the warnings.
-
-verbose is 0-10 with 10 being the most and 0 being none
-
-nocache disables some cacheing of domainname -> domainid
-
-=head2 domainList
-
-Returns a reference to an array. The array contains one entry per domain
-containing a reference to a hash with the data for that domain. Keys in the
-hash use the same names returned by the Linode API though the names have been
-converted to lower-case.
-
-=head2 domainSave
-
-=head2 domainGet
-
-Requires domainid or domain passed in as args. 'domain' is the name of the
-zone and will be mapped to domainid before executing the API method.
-Returns a reference to a hash. The hash contains the data for the domain
-returned by the Linode API with the keys lower cased.
-
-=head2 getDomainIDbyName
-
-Returns the ID for a domain given the name.
-
-=head2 domainCreate
-
-Requires domainid, use 0 to create a domain.
-
-=head2 domainUpdate
-
-Requires domainid, grabs current data, overwrites passed values then calls
-domainSave for you.
-
-=head2 domainDelete
-
-Requires domainid, deletes the domain
-
-=head2 domainResourceCreate
-
-=head2 domainResourceList
-
-Requires domainid or domain passed in as args. 'domain' is the name of the
-zone and will be mapped to domainid before executing the API method.
-Returns a reference to an array. The array contains one entry per domain
-containing a reference to a hash with the data for that domain. Keys in the
-hash use the same names returned by the Linode API though the names have been
-converted to lower-case.
-
-=head2 domainResourceGet
-
-Requires domainid and resourceid.
-Returns a reference to a hash. The hash contains the data for the resource
-record returned by the Linode API with the keys lower cased.
-
-=head2 getResourceIDbyName
-
-Takes a record name and domainid or domain and returns the resourceid
-
-=head2 domainResourceSave
-
-Requires domainid and resourceid. Use 0 for resourceid to create.
-
-=head2 domainResourceUpdate
-
-Requires resourceid, grabs current data, overwrites passed values then calls
-domainResourceSave for you.
-
-=head2 domainResourceDelete
+If you are still reading, you are doing it wrong! Go here L<WebService::Linode>
-Requires resourceid, deletes the resource record.
=head1 AUTHOR
@@ -9,149 +9,107 @@ use Carp;
use List::Util qw(first);
use WebService::Linode::Base;
-our $VERSION = '0.16';
+our $VERSION = '0.20';
our @ISA = ("WebService::Linode::Base");
our $AUTOLOAD;
my %validation = (
account => {
- estimateinvoice => [ ['mode'], [qw( linodeid paymentterm planid )] ],
- info => [ [], [] ],
- paybalance => [ [], [] ],
+ estimateinvoice => [ [ 'mode' ], [qw( linodeid paymentterm planid )] ],
+ info => [ [], [] ],
+ paybalance => [ [], [] ],
updatecard => [ [qw( ccexpmonth ccexpyear ccnumber )], [] ],
},
- api => { spec => [ [], [] ], },
+ api => {
+ spec => [ [], [] ],
+ },
avail => {
- datacenters => [ [], [] ],
- distributions => [ [], ['distributionid'] ],
- kernels => [ [], [ 'isxen', 'kernelid' ] ],
- linodeplans => [ [], ['planid'] ],
- stackscripts =>
- [ [], [qw( distributionid distributionvendor keywords )] ],
+ datacenters => [ [], [] ],
+ distributions => [ [], [ 'distributionid' ] ],
+ kernels => [ [], [ 'isxen', 'kernelid' ] ],
+ linodeplans => [ [], [ 'planid' ] ],
+ stackscripts => [ [], [qw( distributionid distributionvendor keywords )] ],
},
domain => {
- create => [
- [ 'domain', 'type' ],
- [ qw( axfr_ips description expire_sec lpm_displaygroup master_ips refresh_sec retry_sec soa_email status ttl_sec )
- ]
- ],
- delete => [ ['domainid'], [] ],
- list => [ [], ['domainid'] ],
- update => [
- ['domainid'],
- [ qw( axfr_ips description domain expire_sec lpm_displaygroup master_ips refresh_sec retry_sec soa_email status ttl_sec type )
- ]
- ],
+ create => [ [ 'domain', 'type' ], [qw( axfr_ips description expire_sec lpm_displaygroup master_ips refresh_sec retry_sec soa_email status ttl_sec )] ],
+ delete => [ [ 'domainid' ], [] ],
+ list => [ [], [ 'domainid' ] ],
+ update => [ [ 'domainid' ], [qw( axfr_ips description domain expire_sec lpm_displaygroup master_ips refresh_sec retry_sec soa_email status ttl_sec type )] ],
},
domain_resource => {
- create => [
- [qw( domainid type )],
- [qw( name port priority protocol target ttl_sec weight )]
- ],
+ create => [ [ 'domainid', 'type' ], [qw( name port priority protocol target ttl_sec weight )] ],
delete => [ [ 'domainid', 'resourceid' ], [] ],
- list => [ ['domainid'], ['resourceid'] ],
- update => [
- ['resourceid'],
- [qw( domainid name port priority protocol target ttl_sec weight )]
- ],
+ list => [ [ 'domainid' ], [ 'resourceid' ] ],
+ update => [ [ 'resourceid' ], [qw( domainid name port priority protocol target ttl_sec weight )] ],
},
linode => {
- boot => [ ['linodeid'], ['configid'] ],
- clone => [ [qw( datacenterid linodeid paymentterm planid )], [] ],
- create => [ [qw( datacenterid paymentterm planid )], [] ],
- delete => [ ['linodeid'], ['skipchecks'] ],
- list => [ [], ['linodeid'] ],
- mutate => [ ['linodeid'], [] ],
- reboot => [ ['linodeid'], ['configid'] ],
+ boot => [ [ 'linodeid' ], [ 'configid' ] ],
+ clone => [ [qw( datacenterid linodeid planid )], [ 'paymentterm' ] ],
+ create => [ [ 'datacenterid', 'planid' ], [ 'paymentterm' ] ],
+ delete => [ [ 'linodeid' ], [ 'skipchecks' ] ],
+ list => [ [], [ 'linodeid' ] ],
+ mutate => [ [ 'linodeid' ], [] ],
+ reboot => [ [ 'linodeid' ], [ 'configid' ] ],
resize => [ [ 'linodeid', 'planid' ], [] ],
- shutdown => [ ['linodeid'], [] ],
- update => [
- ['linodeid'],
- [ qw( alert_bwin_enabled alert_bwin_threshold alert_bwout_enabled alert_bwout_threshold alert_bwquota_enabled alert_bwquota_threshold alert_cpu_enabled alert_cpu_threshold alert_diskio_enabled alert_diskio_threshold backupweeklyday backupwindow label lpm_displaygroup ms_ssh_disabled ms_ssh_ip ms_ssh_port ms_ssh_user watchdog )
- ]
- ],
- webconsoletoken => [ ['linodeid'], [] ],
+ shutdown => [ [ 'linodeid' ], [] ],
+ update => [ [ 'linodeid' ], [qw( alert_bwin_enabled alert_bwin_threshold alert_bwout_enabled alert_bwout_threshold alert_bwquota_enabled alert_bwquota_threshold alert_cpu_enabled alert_cpu_threshold alert_diskio_enabled alert_diskio_threshold backupweeklyday backupwindow label lpm_displaygroup ms_ssh_disabled ms_ssh_ip ms_ssh_port ms_ssh_user watchdog )] ],
+ webconsoletoken => [ [ 'linodeid' ], [] ],
},
linode_config => {
- create => [
- [qw( kernelid label linodeid )],
- [ qw( comments devtmpfs_automount disklist helper_depmod helper_disableupdatedb helper_xen ramlimit rootdevicecustom rootdevicenum rootdevicero runlevel )
- ]
- ],
+ create => [ [qw( kernelid label linodeid )], [qw( comments devtmpfs_automount disklist helper_depmod helper_disableupdatedb helper_xen ramlimit rootdevicecustom rootdevicenum rootdevicero runlevel )] ],
delete => [ [ 'configid', 'linodeid' ], [] ],
- list => [ ['linodeid'], ['configid'] ],
- update => [
- ['configid'],
- [ qw( comments devtmpfs_automount disklist helper_depmod helper_disableupdatedb helper_xen kernelid label linodeid ramlimit rootdevicecustom rootdevicenum rootdevicero runlevel )
- ]
- ],
+ list => [ [ 'linodeid' ], [ 'configid' ] ],
+ update => [ [ 'configid' ], [qw( comments devtmpfs_automount disklist helper_depmod helper_disableupdatedb helper_xen kernelid label linodeid ramlimit rootdevicecustom rootdevicenum rootdevicero runlevel )] ],
},
linode_disk => {
create => [ [qw( label linodeid size type )], [] ],
- createfromdistribution => [
- [qw( distributionid label linodeid rootpass size )],
- ['rootsshkey']
- ],
- createfromstackscript => [
- [ qw( distributionid label linodeid rootpass size stackscriptid stackscriptudfresponses )
- ],
- []
- ],
- delete => [ [ 'diskid', 'linodeid' ], [] ],
+ createfromdistribution => [ [qw( distributionid label linodeid rootpass size )], [ 'rootsshkey' ] ],
+ createfromstackscript => [ [qw( distributionid label linodeid rootpass size stackscriptid stackscriptudfresponses )], [] ],
+ delete => [ [ 'diskid', 'linodeid' ], [] ],
duplicate => [ [ 'diskid', 'linodeid' ], [] ],
- list => [ ['linodeid'], ['diskid'] ],
+ list => [ [ 'linodeid' ], [ 'diskid' ] ],
resize => [ [qw( diskid linodeid size )], [] ],
- update => [ ['diskid'], [qw( isreadonly label linodeid )] ],
+ update => [ [ 'diskid' ], [qw( isreadonly label linodeid )] ],
},
linode_ip => {
- addprivate => [ ['linodeid'], [] ],
- list => [ ['linodeid'], ['ipaddressid'] ],
+ addprivate => [ [ 'linodeid' ], [] ],
+ addpublic => [ [ 'linodeid' ], [] ],
+ list => [ [ 'linodeid' ], [ 'ipaddressid' ] ],
+ swap => [ [ 'ipaddressid' ], [ 'tolinodeid', 'withipaddressid' ] ],
+ },
+ linode_job => {
+ list => [ [ 'linodeid' ], [ 'jobid', 'pendingonly' ] ],
},
- linode_job => { list => [ ['linodeid'], [ 'jobid', 'pendingonly' ] ], },
nodebalancer => {
- create => [
- [ 'datacenterid', 'paymentterm' ],
- [ 'clientconnthrottle', 'label' ]
- ],
- delete => [ ['nodebalancerid'], [] ],
- list => [ [], ['nodebalancerid'] ],
- update => [ ['nodebalancerid'], [ 'clientconnthrottle', 'label' ] ],
+ create => [ [ 'datacenterid', 'paymentterm' ], [ 'clientconnthrottle', 'label' ] ],
+ delete => [ [ 'nodebalancerid' ], [] ],
+ list => [ [], [ 'nodebalancerid' ] ],
+ update => [ [ 'nodebalancerid' ], [ 'clientconnthrottle', 'label' ] ],
},
nodebalancer_config => {
- create => [
- ['nodebalancerid'],
- [ qw( algorithm check check_attempts check_body check_interval check_path check_timeout port protocol ssl_cert ssl_key stickiness )
- ]
- ],
- delete => [ ['configid'], [] ],
- list => [ ['nodebalancerid'], ['configid'] ],
- update => [
- ['configid'],
- [ qw( algorithm check check_attempts check_body check_interval check_path check_timeout port protocol ssl_cert ssl_key stickiness )
- ]
- ],
+ create => [ [ 'nodebalancerid' ], [qw( algorithm check check_attempts check_body check_interval check_path check_timeout port protocol ssl_cert ssl_key stickiness )] ],
+ delete => [ [ 'configid', 'nodebalancerid' ], [] ],
+ list => [ [ 'nodebalancerid' ], [ 'configid' ] ],
+ update => [ [ 'configid' ], [qw( algorithm check check_attempts check_body check_interval check_path check_timeout port protocol ssl_cert ssl_key stickiness )] ],
},
nodebalancer_node => {
create => [ [qw( address configid label )], [ 'mode', 'weight' ] ],
- delete => [ ['nodeid'], [] ],
- list => [ ['configid'], ['nodeid'] ],
- update => [ ['nodeid'], [qw( address label mode weight )] ],
+ delete => [ [ 'nodeid' ], [] ],
+ list => [ [ 'configid' ], [ 'nodeid' ] ],
+ update => [ [ 'nodeid' ], [qw( address label mode weight )] ],
},
stackscript => {
- create => [
- [qw( distributionidlist label script )],
- [qw( description ispublic rev_note )]
- ],
- delete => [ ['stackscriptid'], [] ],
- list => [ [], ['stackscriptid'] ],
- update => [
- ['stackscriptid'],
- [ qw( description distributionidlist ispublic label rev_note script )
- ]
- ],
+ create => [ [qw( distributionidlist label script )], [qw( description ispublic rev_note )] ],
+ delete => [ [ 'stackscriptid' ], [] ],
+ list => [ [], [ 'stackscriptid' ] ],
+ update => [ [ 'stackscriptid' ], [qw( description distributionidlist ispublic label rev_note script )] ],
+ },
+ test => {
+ echo => [ [], [] ],
+ },
+ user => {
+ getapikey => [ [ 'password', 'username' ], [qw( expires label token )] ],
},
- test => { echo => [ [], [] ], },
- user => { getapikey => [ [ 'password', 'username' ], [] ], },
);
sub AUTOLOAD {
@@ -196,37 +154,6 @@ sub AUTOLOAD {
croak "Undefined subroutine \&$AUTOLOAD called";
}
-sub getDomainIDbyName {
- carp "WebService::Linode::getDomainIDbyName() is deprecated and going away.";
- my ( $self, $name ) = @_;
- foreach my $domain ( @{ $self->domain_list() } ) {
- return $domain->{domainid} if $domain->{domain} eq $name;
- }
- return;
-}
-
-sub getDomainResourceIDbyName {
- carp "WebService::Linode::getDomainResourceIDbyName() is deprecated and going away.";
- my ( $self, %args ) = @_;
- $self->_debug( 10, 'getResourceIDbyName called' );
-
- my $domainid = $args{domainid};
- if ( !exists( $args{domainid} ) && exists( $args{domain} ) ) {
- $domainid = $self->getDomainIDbyName( $args{domain} );
- }
-
- if ( !( defined($domainid) && exists( $args{name} ) ) ) {
- $self->_error( -1,
- 'Must pass domain or domainid and (resource) name to getResourceIDbyName'
- );
- return;
- }
-
- for my $rr ( @{ $self->domain_resource_list( domainid => $domainid ) } ) {
- return $rr->{resourceid} if $rr->{name} eq $args{name};
- }
-}
-
'mmm, cake';
__END__
@@ -245,6 +172,11 @@ dots replaced with underscores to generate the perl method name. All keys
and parameters have been lower cased but returned data remains otherwise the
same. For additional information see L<http://www.linode.com/api/>
+=head1 Constructor
+
+For documentation of possible arguments to the constructor, see
+L<WebService::Linode::Base>.
+
=head1 Methods from the Linode API
=head3 avail_stackscripts
@@ -505,12 +437,18 @@ Required Parameters:
=item * datacenterid
-=item * paymentterm
-
=item * planid
=back
+Optional Parameters:
+
+=over 4
+
+=item * paymentterm
+
+=back
+
=head3 linode_reboot
Required Parameters:
@@ -579,12 +517,18 @@ Required Parameters:
=item * linodeid
-=item * paymentterm
-
=item * planid
=back
+Optional Parameters:
+
+=over 4
+
+=item * paymentterm
+
+=back
+
=head3 linode_shutdown
Required Parameters:
@@ -935,6 +879,26 @@ Optional Parameters:
=back
+=head3 linode_ip_swap
+
+Required Parameters:
+
+=over 4
+
+=item * ipaddressid
+
+=back
+
+Optional Parameters:
+
+=over 4
+
+=item * tolinodeid
+
+=item * withipaddressid
+
+=back
+
=head3 linode_ip_addprivate
Required Parameters:
@@ -945,6 +909,16 @@ Required Parameters:
=back
+=head3 linode_ip_addpublic
+
+Required Parameters:
+
+=over 4
+
+=item * linodeid
+
+=back
+
=head3 linode_ip_list
Required Parameters:
@@ -1105,6 +1079,8 @@ Required Parameters:
=item * configid
+=item * nodebalancerid
+
=back
=head3 nodebalancer_config_update
@@ -1253,17 +1229,17 @@ Required Parameters:
=back
-=head1 Additional Helper Methods
+Optional Parameters:
-These methods are deprecated and will be going away.
+=over 4
-=head3 getDomainIDbyName( domain => 'example.com' )
+=item * expires
-Returns the ID for a domain given the name.
+=item * label
-=head3 getDomainResourceIDbyName( domainid => 242, name => 'www')
+=item * token
-Takes a record name and domainid or domain and returns the resourceid.
+=back
=head1 AUTHORS