//FindStats returns the statistics of the supplied resource type if it exists. Use when the resource to be returned is an array
FindStats returns the statistics of the supplied resource type if it exists. Use when the resource to be returned is an array
// FindStats returns the statistics of the supplied resource type if it exists . Use when the resource to be returned is an array
func (c *NitroClient) FindAllStats(resourceType string) ([]map[string]interface{}, error) {
	var data map[string]interface{}
	result, err := c.listStat(resourceType, "")
	if err != nil {
		log.Printf("[WARN] go-nitro: FindStats: No %s found", resourceType)
		return nil, fmt.Errorf("[INFO] go-nitro: FindStats: No type %s found", resourceType)
	}
	if err = json.Unmarshal(result, &data); err != nil {
		log.Printf("[ERROR] go-nitro: FindStats: Failed to unmarshal Netscaler Response!")
		return nil, fmt.Errorf("[ERROR] go-nitro: FindStats: Failed to unmarshal Netscaler Response: type %s", resourceType)
	}
	rsrcs, ok := data[resourceType]
	if !ok || rsrcs == nil {
		log.Printf("[WARN] go-nitro: FindStats No %s type found", resourceType)
		return nil, fmt.Errorf("[INFO] go-nitro: FindStats: No type of %s found", resourceType)
	}
	resources := data[resourceType].([]interface{})
	ret := make([]map[string]interface{}, len(resources), len(resources))
	for i, v := range resources {
		ret[i] = v.(map[string]interface{})
	}
	return ret, nil
}
func ( c * NitroClient ) FindAllStats ( resourceType string ) ( [ ] map [ string ] interface { } , error ) { var data map [ string ] interface { } result , err := c . listStat ( resourceType , " " ) if err != nil { log . Printf ( " " , resourceType ) return nil , fmt . Errorf ( " " , resourceType ) } if err = json . Unmarshal ( result , & data ) ; err != nil { log . Printf ( " " ) return nil , fmt . Errorf ( " " , resourceType ) } rsrcs , ok := data [ resourceType ] if ! ok || rsrcs == nil { log . Printf ( " " , resourceType ) return nil , fmt . Errorf ( " " , resourceType ) } resources := data [ resourceType ] . ( [ ] interface { } ) ret := make ( [ ] map [ string ] interface { } , len ( resources ) , len ( resources ) ) for i , v := range resources { ret [ i ] = v . ( map [ string ] interface { } ) } return ret , nil }
FindStats returns the statistics of the supplied resource type if it exists.
FindStats returns the statistics of the supplied resource type if it exists .