Check Domain Availability using Boto Route53

753 views Asked by At

I love using Boto API for Amazon Web Services but now I'm not capable of finding where is the error. I'm using AWS for check domain availability and I have created a script in Python that includes the class at this link:

https://www.codatlas.com/github.com/boto/boto/develop/boto/route53/domains/layer1.py?line=67

I call the method check_domain_availability() on passing domain name:

Route53DomainsConnection.check_domain_availability('example.com',None)

but the method returns this error:

AttributeError: 'str' object has no attribute 'make_request'

I can try to pass parameters in many modes but no result.

Where am I wrong? Thanks in advance.

P.S: I use Debian wheezy and Python3.2

More on status of subdomains

I have found a method to get the status of a record just create with route53.

this is the code:

changes = ResourceRecordSets(conn, "ZONEID")
change = changes.add_change("STRING FOR ADD NEW SUBDOMAIN")
change.add_value(MY_IP)
status = changes.commit()

If print the status variable is contained the response of commit and the status:

{u'ChangeResourceRecordSetsResponse':{u'ChangeInfo': {u'Status: u'PENDING etc.....

Now i would like to be able to swhitch to another operation only if the status of subdomamin is "SYNC" but i doesn't able to access dinamically to string for check status.

I can use a while ? Can i use sleep command ? Can anyone help me over to resolve my problem ? Thanks

1

There are 1 answers

1
garnaat On BEST ANSWER

You don't show your code which makes it harder to debug but this line:

Route53DomainsConnection.check_domain_availability('example.com',None)

looks suspicious. It looks like you are trying to access the check_domain_availability method from the class rather than an instance of the class. I just did the following and it worked for me:

In [1]: import boto.route53.domains
In [2]: c = boto.route53.domains.connect_to_region('us-east-1')
In [3]: c.check_domain_availability('foobar.com')
Out[3]: {u'Availability': u'UNAVAILABLE'}