cri-o/vendor/github.com/docker/engine-api/client/volume_inspect.go
Antonio Murdaca 4bc8701fc0
*: switch from godep to glide
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-09-17 17:06:30 +02:00

24 lines
625 B
Go

package client
import (
"encoding/json"
"net/http"
"github.com/docker/engine-api/types"
"golang.org/x/net/context"
)
// VolumeInspect returns the information about a specific volume in the docker host.
func (cli *Client) VolumeInspect(ctx context.Context, volumeID string) (types.Volume, error) {
var volume types.Volume
resp, err := cli.get(ctx, "/volumes/"+volumeID, nil, nil)
if err != nil {
if resp.statusCode == http.StatusNotFound {
return volume, volumeNotFoundError{volumeID}
}
return volume, err
}
err = json.NewDecoder(resp.body).Decode(&volume)
ensureReaderClosed(resp)
return volume, err
}