Search This Blog

Monday, April 22, 2013

Challenge 4 script

The full summary of all posts for API Rackspace challenge can be found here:
Rackspace api-challenge summary

Challenge 4 script

Below is the output and results from script #4 from the api-challenge.
The script first checks if a domain exists. By default it will terminated but if you specify the -d options it will delete the existing domain before proceeding.
Next adds a new A record according to the provided arguments.
Once the A record is added it tries to find the domain again and prints all info about it.
After it finishes it doesn't delete the created domain.
$ python
[18:58:06] missing params

    usage: [-h] [-v] [-d] FQDN ip-add
        -h - usage help
        -v - verbose / debug output
        -d - if a domain exists it will be deleted first

        FQDN - Fully Qualified Domain Name; exaple
        ip-add - ip address

$ python
[18:45:47] Domain created:
[18:45:47] Adding records to our domain ...
[18:45:49] domain name: created at 2013-04-22T18:44:06.000+0000
[18:45:50] record   A ->
[18:45:50] record  NS ->
[18:45:50] record  NS ->


No comments:

Post a Comment