func (c *Client) SSHGetHosts() (*api.SSHGetHostsResponse, error) {
	var retried bool
	u := c.endpoint.ResolveReference(&url.URL{Path: "/ssh/hosts"})
retry:
	resp, err := c.client.Get(u.String())
	if err != nil {
		return nil, errors.Wrapf(err, "client GET %s failed", u)
	}
	if resp.StatusCode >= 400 {
		if !retried && c.retryOnError(resp) {
			retried = true
			goto retry
		}
		return nil, readError(resp.Body)
	}
	var hosts api.SSHGetHostsResponse
	if err := readJSON(resp.Body, &hosts); err != nil {
		return nil, errors.Wrapf(err, "error reading %s", u)
	}
	return &hosts, nil
}
// SSHGetHosts performs the GET /ssh/get-hosts request to the CA.
SSHGetHosts performs the GET /ssh/get-hosts request to the CA.
// SSHGetHosts performs the GET / ssh / get - hosts request to the CA .
func (c *Client) SSHGetHosts() (*api.SSHGetHostsResponse, error) {
	var retried bool
	u := c.endpoint.ResolveReference(&url.URL{Path: "/ssh/hosts"})
retry:
	resp, err := c.client.Get(u.String())
	if err != nil {
		return nil, errors.Wrapf(err, "client GET %s failed", u)
	}
	if resp.StatusCode >= 400 {
		if !retried && c.retryOnError(resp) {
			retried = true
			goto retry
		}
		return nil, readError(resp.Body)
	}
	var hosts api.SSHGetHostsResponse
	if err := readJSON(resp.Body, &hosts); err != nil {
		return nil, errors.Wrapf(err, "error reading %s", u)
	}
	return &hosts, nil
}
func ( c * Client ) SSHGetHosts ( ) ( * api . SSHGetHostsResponse , error ) { var retried bool u := c . endpoint . ResolveReference ( & url . URL { Path : " " } ) retry : resp , err := c . client . Get ( u . String ( ) ) if err != nil { return nil , errors . Wrapf ( err , " " , u ) } if resp . StatusCode >= 400 { if ! retried && c . retryOnError ( resp ) { retried = true goto retry } return nil , readError ( resp . Body ) } var hosts api . SSHGetHostsResponse if err := readJSON ( resp . Body , & hosts ) ; err != nil { return nil , errors . Wrapf ( err , " " , u ) } return & hosts , nil }
SSHGetHosts performs the GET /ssh/get-hosts request to the CA.
SSHGetHosts performs the GET / ssh / get - hosts request to the CA .