| 1 | package cloudapi |
| 2 | |
| 3 | import ( |
| 4 | "github.com/joyent/gocommon/client" |
| 5 | "github.com/joyent/gocommon/errors" |
| 6 | ) |
| 7 | |
| 8 | // list available services |
| 9 | func (c *Client) ListServices() (map[string]string, error) { |
| 10 | var resp map[string]string |
| 11 | req := request{ |
| 12 | method: client.GET, |
| 13 | url: apiServices, |
| 14 | resp: &resp, |
| 15 | } |
| 16 | if _, err := c.sendRequest(req); err != nil { |
| 17 | return nil, errors.Newf(err, "failed to get list of services") |
| 18 | } |
| 19 | return resp, nil |
| 20 | } |