blob: 5ad97af07668075f3afe8c509c41127c7d7abf14 [file] [log] [blame]
Samuel A. Falvo II10decf92014-02-13 17:05:35 -08001package flavors
2
3import (
4 "github.com/rackspace/gophercloud/openstack/identity"
5)
6
7type Client struct {
8 endpoint string
9 authority identity.AuthResults
10 options identity.AuthOptions
11}
12
13func NewClient(e string, a identity.AuthResults, ao identity.AuthOptions) *Client {
14 return &Client{
15 endpoint: e,
16 authority: a,
17 options: ao,
18 }
19}
20
21func (c *Client) getListUrl() string {
22 return c.endpoint + "/flavors/detail"
23}
24
25func (c *Client) getListHeaders() (map[string]string, error) {
26 t, err := identity.GetToken(c.authority)
27 if err != nil {
28 return map[string]string{}, err
29 }
30
31 return map[string]string{
32 "X-Auth-Token": t.Id,
33 }, nil
34}
35