slicehost - add a new zone via api with python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyactiveresource.activeresource import ActiveResource | |
api_password = 'API_KEY_HERE' | |
api_site = 'https://%s@api.slicehost.com/' % api_password | |
class Slice(ActiveResource): | |
_site = api_site | |
class Zone(ActiveResource): | |
_site = api_site | |
class Record(ActiveResource): | |
_site = api_site | |
class Address(ActiveResource): | |
_site = api_site | |
# Address class is required for Slice class | |
#class Address < String; end | |
# Creating a new Zone | |
myzone = Zone({'origin':'myexampledomain12345.com', 'ttl':'3600'}) | |
myzone.save() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment