// List enumerates the set of minions instances known by the cloud provider.
List enumerates the set of minions instances known by the cloud provider.
// List enumerates the set of minions instances known by the cloud provider .
func (r *RightScaleCloud) List(filter string) ([]string, error) {
	resp, err := r.sendRequest("/api/servers?filter[]=name%3d%3d" + url.QueryEscape(filter))
	if err != nil {
		return []string{}, err
	}
	defer resp.Body.Close()
	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		return []string{}, err
	}
	var servers []map[string]interface{}
	err = json.Unmarshal(body, &servers)
	if err != nil {
		return []string{}, err
	}
	names := make([]string, len(servers))
	for i, s := range servers {
		names[i] = s["name"].(string)
	}
	return names, nil
}
func ( r * RightScaleCloud ) List ( filter string ) ( [ ] string , error ) { resp , err := r . sendRequest ( " " + url . QueryEscape ( filter ) ) if err != nil { return [ ] string { } , err } defer resp . Body . Close ( ) body , err := ioutil . ReadAll ( resp . Body ) if err != nil { return [ ] string { } , err } var servers [ ] map [ string ] interface { } err = json . Unmarshal ( body , & servers ) if err != nil { return [ ] string { } , err } names := make ( [ ] string , len ( servers ) ) for i , s := range servers { names [ i ] = s [ " " ] . ( string ) } return names , nil }
List enumerates the set of minions instances known by the cloud provider.
List enumerates the set of minions instances known by the cloud provider .