blob: 90e2de36e6c93014a33c1b17cb3c22d1f2d16bb5 [file] [log] [blame]
package networks
import (
"github.com/racker/perigee"
"github.com/rackspace/gophercloud"
)
func List(c *gophercloud.ServiceClient) (*APIVersionsList, error) {
var resp APIVersionsList
_, err := perigee.Request("GET", APIVersionsURL(c), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
Results: &resp,
OkCodes: []int{200},
})
if err != nil {
return nil, err
}
return &resp, nil
}
func Get(c *gophercloud.ServiceClient, v string) (*APIInfoList, error) {
var resp APIInfoList
_, err := perigee.Request("GET", APIInfoURL(c, v), perigee.Options{
MoreHeaders: c.Provider.AuthenticatedHeaders(),
Results: &resp,
OkCodes: []int{200},
})
if err != nil {
return nil, err
}
return &resp, nil
}