diff --git a/lib/fog/google/examples/dns/project.rb b/lib/fog/google/examples/dns/project.rb new file mode 100644 index 000000000..50befd306 --- /dev/null +++ b/lib/fog/google/examples/dns/project.rb @@ -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 diff --git a/lib/fog/google/examples/dns/zones.rb b/lib/fog/google/examples/dns/zones.rb new file mode 100644 index 000000000..2c5fd75aa --- /dev/null +++ b/lib/fog/google/examples/dns/zones.rb @@ -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