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/clients/clients.go b/acceptance/clients/clients.go
index 8bf4aa3..aa57497 100644
--- a/acceptance/clients/clients.go
+++ b/acceptance/clients/clients.go
@@ -174,6 +174,25 @@
})
}
+// NewDNSV2Client returns a *ServiceClient for making calls
+// to the OpenStack Compute v2 API. An error will be returned
+// if authentication or client creation was not possible.
+func NewDNSV2Client() (*gophercloud.ServiceClient, error) {
+ ao, err := openstack.AuthOptionsFromEnv()
+ if err != nil {
+ return nil, err
+ }
+
+ client, err := openstack.AuthenticatedClient(ao)
+ if err != nil {
+ return nil, err
+ }
+
+ return openstack.NewDNSV2(client, gophercloud.EndpointOpts{
+ Region: os.Getenv("OS_REGION_NAME"),
+ })
+}
+
// NewIdentityV2Client returns a *ServiceClient for making calls
// to the OpenStack Identity v2 API. An error will be returned
// if authentication or client creation was not possible.