File: services.go

package info (click to toggle)
golang-github-joyent-gosdc 0.0~git20161202.ec8b350-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 472 kB
  • sloc: makefile: 3
file content (20 lines) | stat: -rw-r--r-- 437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package cloudapi

import (
	"github.com/joyent/gocommon/client"
	"github.com/joyent/gocommon/errors"
)

// list available services
func (c *Client) ListServices() (map[string]string, error) {
	var resp map[string]string
	req := request{
		method: client.GET,
		url:    apiServices,
		resp:   &resp,
	}
	if _, err := c.sendRequest(req); err != nil {
		return nil, errors.Newf(err, "failed to get list of services")
	}
	return resp, nil
}