func volumesList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	contexts := permission.ContextsForPermission(t, permission.PermVolumeRead)
	if len(contexts) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	volumes, err := volume.ListByFilter(volumeFilterByContext(contexts))
	if err != nil {
		return err
	}
	if len(volumes) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(volumes)
}
func volumesList(w http.ResponseWriter, r *http.Request, t auth.Token) error {
	contexts := permission.ContextsForPermission(t, permission.PermVolumeRead)
	if len(contexts) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	volumes, err := volume.ListByFilter(volumeFilterByContext(contexts))
	if err != nil {
		return err
	}
	if len(volumes) == 0 {
		w.WriteHeader(http.StatusNoContent)
		return nil
	}
	w.Header().Set("Content-Type", "application/json")
	return json.NewEncoder(w).Encode(volumes)
}
func volumesList ( w http . ResponseWriter , r * http . Request , t auth . Token ) error { contexts := permission . ContextsForPermission ( t , permission . PermVolumeRead ) if len ( contexts ) == 0 { w . WriteHeader ( http . StatusNoContent ) return nil } volumes , err := volume . ListByFilter ( volumeFilterByContext ( contexts ) ) if err != nil { return err } if len ( volumes ) == 0 { w . WriteHeader ( http . StatusNoContent ) return nil } w . Header ( ) . Set ( " " , " " ) return json . NewEncoder ( w ) . Encode ( volumes ) }
// title: volume list
// path: /volumes
// method: GET
// produce: application/json
// responses:
//   200: List volumes
//   204: No content
//   401: Unauthorized
title : volume list path : / volumes method : GET produce : application / json responses : 200 : List volumes 204 : No content 401 : Unauthorized