Path: | README.rdoc |
Last Update: | Fri Apr 13 16:09:17 +0000 2012 |
Interact with the Dynect REST API.
Since this is 90% of what you‘ll be doing, we make it easy.
require 'dynect_rest' dyn = DynectRest.new("CUSTOMER", "USERNAME", "PASSWORD", "ZONE") dyn.a.fqdn("sunshine.example.com").ttl(3600).address("192.168.1.1").save dyn.cname.fqdn("something.example.com").cname("ec2-10-10-10-10.amazonaws.com").save dyn.publish
Will add an A record and a CNAME. You can use the chained method syntax for every resource record - we map unknown methods to the resource data you make in the call. See "example.rb" for an executable example using environment variables.
We wrap up the lower-level functionality of the API, so you can focus on just making the calls. For example, to get a list of contacts:
dyn = DynectRest.new("CUSTOMER", "USERNAME", "PASSWORD", "ZONE") dyn.get('Contact')
To create a new contact:
dyn = DynectRest.new("CUSTOMER", "USERNAME", "PASSWORD", "ZONE") dyn.post('Contact', { "first_name" => "Bobo", "last_name" => "Clown", "organization" => 'The Circus', "email" => "bobo@example.com" })
For more - you should be able to find the latest at:
https://manage.dynect.net/help/docs/api2/rest/resources/
If you are a Dynect customer.
Copyright (c) 2010 Opscode, Inc. See LICENSE for details.