Skip to content

Instantly share code, notes, and snippets.

@nicholaskuechler
Created August 14, 2012 22:27
Show Gist options
  • Save nicholaskuechler/3353553 to your computer and use it in GitHub Desktop.
Save nicholaskuechler/3353553 to your computer and use it in GitHub Desktop.
slicehost - add a new zone via api with python
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