Merge pull request #37 from rackspace/list-servers--rename-compute-api
Rename ComputeApi to ServerApi
diff --git a/acceptance/02-list-servers.go b/acceptance/02-list-servers.go
index b33a15c..bd1da3c 100644
--- a/acceptance/02-list-servers.go
+++ b/acceptance/02-list-servers.go
@@ -30,7 +30,7 @@
panic(err)
}
- api, err := gophercloud.ComputeApi(acc, gophercloud.ApiCriteria{
+ api, err := gophercloud.ServersApi(acc, gophercloud.ApiCriteria{
Name: "cloudServersOpenStack",
Region: "DFW",
VersionId: "2",
diff --git a/context.go b/context.go
index 1b5d390..a946468 100644
--- a/context.go
+++ b/context.go
@@ -77,14 +77,14 @@
return Provider{}, ErrProvider
}
-// Instantiates a Cloud Servers object for the provider given.
-func (c *Context) ComputeApi(acc AccessProvider, criteria ApiCriteria) (ComputeProvider, error) {
+// Instantiates a Cloud Servers API for the provider given.
+func (c *Context) ServersApi(acc AccessProvider, criteria ApiCriteria) (CloudServersProvider, error) {
url := acc.FirstEndpointUrlByCriteria(criteria)
if url == "" {
return nil, ErrEndpoint
}
- gcp := &genericCloudProvider{
+ gcp := &genericServersProvider{
endpoint: url,
context: c,
access: acc,
diff --git a/global_context.go b/global_context.go
index b071c09..c89ac17 100644
--- a/global_context.go
+++ b/global_context.go
@@ -43,6 +43,6 @@
}
// Instantiates a Cloud Servers object for the provider given.
-func ComputeApi(acc AccessProvider, criteria ApiCriteria) (ComputeProvider, error) {
- return globalContext.ComputeApi(acc, criteria)
+func ServersApi(acc AccessProvider, criteria ApiCriteria) (CloudServersProvider, error) {
+ return globalContext.ServersApi(acc, criteria)
}
diff --git a/interfaces.go b/interfaces.go
index 63439c5..de2c35b 100644
--- a/interfaces.go
+++ b/interfaces.go
@@ -15,8 +15,8 @@
AuthToken() string
}
-// ComputeProvider instances encapsulate a Cloud Servers API, should one exist in the service catalog
+// CloudServersProvider instances encapsulate a Cloud Servers API, should one exist in the service catalog
// for your provider.
-type ComputeProvider interface {
+type CloudServersProvider interface {
ListServers() ([]Server, error)
}
diff --git a/servers.go b/servers.go
index e3bc547..586df8d 100644
--- a/servers.go
+++ b/servers.go
@@ -7,9 +7,9 @@
"github.com/racker/perigee"
)
-// genericCloudProvider structures provide the implementation for generic OpenStack-compatible
-// ComputeProvider interfaces.
-type genericCloudProvider struct {
+// genericServersProvider structures provide the implementation for generic OpenStack-compatible
+// CloudServersProvider interfaces.
+type genericServersProvider struct {
// endpoint refers to the provider's API endpoint base URL. This will be used to construct
// and issue queries.
endpoint string
@@ -22,8 +22,8 @@
access AccessProvider
}
-// See the ComputeProvider interface for details.
-func (gcp *genericCloudProvider) ListServers() ([]Server, error) {
+// See the CloudServersProvider interface for details.
+func (gcp *genericServersProvider) ListServers() ([]Server, error) {
var ss []Server
url := gcp.endpoint + "/servers"
diff --git a/servers_test.go b/servers_test.go
index e296801..46ba6db 100644
--- a/servers_test.go
+++ b/servers_test.go
@@ -28,7 +28,7 @@
internal: "http://localhost:8086",
}
- _, err := c.ComputeApi(acc, ApiCriteria{
+ _, err := c.ServersApi(acc, ApiCriteria{
Name: "cloudComputeOpenStack",
Region: "dfw",
VersionId: "2",