Mtgsy
This Gem helps you update, add and delete DNS records at CloudFloor DNS
Installation
Add this line to your application's Gemfile:
gem 'mtgsy'
And then execute:
$ bundle
Or install it yourself as:
$ gem install mtgsy
Usage
## Start things off...
require 'mtgsy'
client = Mtgsy::ApiClient.new(username: "my_username", password: "my_password", domainname: "mydomain.com")
## Add records
client.add_record(name: "www1", type: "A", data: "127.0.0.1")
client.add_record(name: "www2", type: "A", data: "127.0.0.2", ttl: "3600")
client.add_record(name: "www3", type: "A", data: "127.0.0.3", ttl: "3600", aux: "5")
## Update records
client.update_record(name: "www1", type: "A", data: "127.0.0.11")
## Delete records:
client.delete_record(name: "www1")
client.delete_record(name: "www2")
client.delete_record(name: "www3")
## List all records in a zone:
client.records("ALL") # Returns an array of _all_ records in the zone
client.records("A") # Returns an array of all A records in the zone
client.records("CNAME") # Returns an array of all CNAME records in the zone
client.records("AAAA") # Returns an array of all AAAA records in the zone
## Search records by name, data, type, aux, ttl. You can search using one or many:
client.search(name: "myrecord") # Returns all records whose name matches __exactly__.
client.search(data: "123.123.123.123") # Returns all records whose data matches __exactly__.
client.search(type: "A") # Returns all A records.
client.search(type: "A", data: "123.123.123.123") # Returns all A records whose data also matches __exactly__.
client.search(ttl: 900) # Returns all records whose ttl is 900.
## List all possible records types:
client.record_types?
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request