Recent Changes - Search:



My journals will take the place of a blog. They have moved to

Sites I take responsibility for






Places I frequent



Items for sale:


edit SideBar

Linode ticket 161973

Include our styles below Infobox - invoke as >>infobox<< ... >><<

Codebox: - invoke as >>codebox<< ... >><<

warnbox: - invoke as >>codebox<< ... >><<

editingbox: - invoke as >>codebox<< ... >><<

noticebox: - invoke as >>codebox<< ... >><<

Page bread crumbs:

Pages by tags: (:listtags:)
Subscribe to this wiki: RSS Feed RSS or subscribe to this page for changes: RSS Feed RSS
496 articles have been published so far. Recent changes
(:addThis btn="custom":)

This article maintenance has now been moved to WebService::Linode and this temporary article will be purged in 30 days.

 [161973] Can't locate object method "getDomainIDbyName" v
 Status 	OPEN
 Opened On 	2010-03-28 08:01:10 AM by kinsce2
 Last Updated On 	2010-03-28 02:56:50 PM by mgreb

shell script:

 setenv linode_api `/bin/cat /usr/local/admin/etc/linode`
 setenv public_ip `some routine to pull the public address from the NAT`

CPAN module:

 Additional Helper Methods
          o getDomainIDbyName( domain => '' )
          o getDomainResourceIDbyName( domainid => 242, name => 'www') 

Perl script:

#!/usr/bin/perl -w

use WebService::Linode;

my $apikey = $ENV{'linode_api'};
die "error: environment variable linode_api is not set correctly." unless $apikey;
my $pubip = $ENV{'public_ip'};
die "error: environment variable public_ip is not set correctly." unless $pubip;

print "Public ip is $pubip\n";

if ( $pubip eq "" || $apikey eq "" ) {
        die "error: environment variables are not set correctly.";

my @domains = ('', '');
my @Site1Names;
my $domain='';
my $record='';
my $domainid=0;
my $api;

foreach (@domains) {

        $domain = $_;
        print "Entering domain=$domain\n";

        if ( $domain eq "" ) {
                @Site1Names = ('site1', 'home.site1', 'proxy', 'svn', 'icecast', 'private', 'pub', 'lab.site1');
        } elsif ( $domain eq "" ) {
                @Site1Names = ('lab');
        } else {
                print "Unknown domain name $domain\n"; 
                @Site1Names = ('unknown');

# Get the domainid needed by the API
        $api = new WebService::Linode(apikey => $apikey);
        $domainid = $api->getDomainIDbyName( domain => $domain );
#       die "Couldn't get domain id for $domain" unless $domainid;
#       print "DomainID for $domain is $domainid\n";

        foreach (@Site1Names) {

                $record = $_;
                print "Setting FQDN=$record.$domain\n";
                print "Domain=$domain, Record=$record\n";

                my $resourceid = $api->getResourceIDbyName(domain => $domain, name => $record);
#               die "Couldn't find RR id for $domain" unless $resourceid;

                $api->domainResourceUpdate(domainid => $domainid, resourceid => $resourceid, target => $pubip);

Error produced:

 Public ip is n.n.n.n
 Setting, Record=site1
 Undefined subroutine &WebService::Linode::getResourceIDbyName called at /root/ line 52

Kevin's Public Wiki maintained and created by Kevin P. Inscoe is licensed under a
Creative Commons Attribution 3.0 United States License.

Back to my web site -

Edit - History - Print - Recent Changes - Search
Page last modified on April 03, 2010, at 11:59 AM EST