DNS Zones: List / Get (#271)
* Add Zone List / Get Support
* Addressing code review comments
* Adding v2 to DNS client
* List / Get unit tests plus updates to results for unit tests to work.
* DNS v2 List acceptance tests
* add failing unit test for dns v2 allpages
* Changing acceptance test for DNS v2 to use AllPages
* Adding empty zones.go file for package requirements
* Change ttl back to int
* DNS v2 Zones ListOpts
diff --git a/acceptance/openstack/dns/v2/zones.go b/acceptance/openstack/dns/v2/zones.go
new file mode 100644
index 0000000..5ec3cc8
--- /dev/null
+++ b/acceptance/openstack/dns/v2/zones.go
@@ -0,0 +1 @@
+package v2
diff --git a/acceptance/openstack/dns/v2/zones_test.go b/acceptance/openstack/dns/v2/zones_test.go
new file mode 100644
index 0000000..add964d
--- /dev/null
+++ b/acceptance/openstack/dns/v2/zones_test.go
@@ -0,0 +1,33 @@
+// +build acceptance dns zones
+
+package v2
+
+import (
+ "testing"
+
+ "github.com/gophercloud/gophercloud/acceptance/clients"
+ "github.com/gophercloud/gophercloud/acceptance/tools"
+ "github.com/gophercloud/gophercloud/openstack/dns/v2/zones"
+)
+
+func TestZonesList(t *testing.T) {
+ client, err := clients.NewDNSV2Client()
+ if err != nil {
+ t.Fatalf("Unable to create a DNS client: %v", err)
+ }
+
+ var allZones []zones.Zone
+ allPages, err := zones.List(client, nil).AllPages()
+ if err != nil {
+ t.Fatalf("Unable to retrieve zones: %v", err)
+ }
+
+ allZones, err = zones.ExtractZones(allPages)
+ if err != nil {
+ t.Fatalf("Unable to extract zones: %v", err)
+ }
+
+ for _, zone := range allZones {
+ tools.PrintResource(t, &zone)
+ }
+}