1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

[google|dns] Add examples

This commit is contained in:
Ferran Rodenas 2014-10-11 19:06:05 -07:00
parent 763c7f2e05
commit 56c3744a17
2 changed files with 47 additions and 0 deletions

View file

@ -0,0 +1,8 @@
def test
connection = Fog::DNS::Google.new
puts 'Get the Project limits...'
puts '-------------------------'
connection.projects.get(Fog::DNS[:google].project)
end

View file

@ -0,0 +1,39 @@
def test
connection = Fog::DNS::Google.new
puts 'Create a Zone...'
puts '----------------'
zone = connection.zones.create(name: 'mytestdomain', domain: 'example.org.', description: 'This is my test domain')
puts 'List all Zones...'
puts '-----------------'
connection.zones.all
puts 'Get the Zone...'
puts '---------------'
zone = connection.zones.get(zone.id)
puts 'Create an "A" Record...'
puts '-----------------------'
record = zone.records.create(name: 'test.example.org.', type: 'A', ttl: 3600, rrdatas: ['192.168.1.1'])
puts 'Get the Zone Resource Record Sets...'
puts '------------------------------------'
zone.records
puts 'Modify the "A" Record...'
puts '------------------------'
record.modify(ttl: 2600)
puts 'Delete the "A" Record...'
puts '------------------------'
record.destroy
puts 'Get the Zone Changes...'
puts '-----------------------'
zone.changes
puts 'Delete the Zone...'
puts '------------------'
zone.destroy
end