func autoScaleListRules(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	allowedListRule := permission.Check(t, permission.PermNodeAutoscaleRead)
	if !allowedListRule {
		return permission.ErrUnauthorized
	}
	rules, err := autoscale.ListRules()
	if err != nil {
		return err
	}
	if len(rules) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	return json.NewEncoder(w).Encode(&rules)
}
func autoScaleListRules(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	allowedListRule := permission.Check(t, permission.PermNodeAutoscaleRead)
	if !allowedListRule {
		return permission.ErrUnauthorized
	}
	rules, err := autoscale.ListRules()
	if err != nil {
		return err
	}
	if len(rules) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	return json.NewEncoder(w).Encode(&rules)
}
func autoScaleListRules ( w http . ResponseWriter , r * http . Request , t auth . Token ) error { allowedListRule := permission . Check ( t , permission . PermNodeAutoscaleRead ) if ! allowedListRule { return permission . ErrUnauthorized } rules , err := autoscale . ListRules ( ) if err != nil { return err } if len ( rules ) == 0 { w . WriteHeader ( http . StatusNoContent ) return nil } return json . NewEncoder ( w ) . Encode ( & rules ) }
// title: autoscale rules list
// path: /autoscale/rules
// method: GET
// produce: application/json
// responses:
//   200: Ok
//   204: No content
//   401: Unauthorized
title : autoscale rules list path : / autoscale / rules method : GET produce : application / json responses : 200 : Ok 204 : No content 401 : Unauthorized