Project

mtgsy

0.0
No commit activity in last 3 years
No release in over 3 years
This is a ruby library for interacting with mtgsy (CloudFloor DNS).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

~> 2.7
 Project Readme

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request