package volume

import (
	"encoding/json"
	"floares/config"
	"floares/lib/model"
	"log"
	"net/http"
)

func ListJsons() model.VolumesJson {
	req, _ := http.NewRequest("GET", config.Entrypoint+"/volumes", nil)
	res, err := http.DefaultClient.Do(req)
	if err != nil {
		log.Println("request for volume list error:", err)
		return model.VolumesJson{}
	}
	var result model.VolumesJson
	err = json.NewDecoder(res.Body).Decode(&result)
	return result
}
