func volumePlansList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	contexts := permission.ContextsForPermission(t, permission.PermVolumeCreate)
	if len(contexts) == 0 {
		return permission.ErrUnauthorized
	}
	plansProvisioners, err := volume.ListPlans()
	if err != nil {
		return err
	}
	if len(plansProvisioners) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(plansProvisioners)
}
func volumePlansList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	contexts := permission.ContextsForPermission(t, permission.PermVolumeCreate)
	if len(contexts) == 0 {
		return permission.ErrUnauthorized
	}
	plansProvisioners, err := volume.ListPlans()
	if err != nil {
		return err
	}
	if len(plansProvisioners) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(plansProvisioners)
}
func volumePlansList ( w http . ResponseWriter , r * http . Request , t auth . Token ) error { contexts := permission . ContextsForPermission ( t , permission . PermVolumeCreate ) if len ( contexts ) == 0 { return permission . ErrUnauthorized } plansProvisioners , err := volume . ListPlans ( ) if err != nil { return err } if len ( plansProvisioners ) == 0 { w . WriteHeader ( http . StatusNoContent ) return nil } w . Header ( ) . Set ( " " , " " ) return json . NewEncoder ( w ) . Encode ( plansProvisioners ) }
// title: volume plan list
// path: /volumeplans
// method: GET
// produce: application/json
// responses:
//   200: List volume plans
//   401: Unauthorized
title : volume plan list path : / volumeplans method : GET produce : application / json responses : 200 : List volume plans 401 : Unauthorized