Files
docker-cli/components/engine/api/client/lib/container_inspect.go
T
David Calavera 301c9e7693 Lowercase http method functions.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: d9a62c5f2b11131d4b8c3d62af60cd7e6ceaa350
Component: engine
2015-12-09 12:04:59 -05:00

21 lines
510 B
Go

package lib
import (
"encoding/json"
"github.com/docker/docker/api/types"
)
// ContainerInspect returns the all the container information.
func (cli *Client) ContainerInspect(containerID string) (types.ContainerJSON, error) {
serverResp, err := cli.get("/containers/"+containerID+"/json", nil, nil)
if err != nil {
return types.ContainerJSON{}, err
}
defer ensureReaderClosed(serverResp)
var response types.ContainerJSON
json.NewDecoder(serverResp.body).Decode(&response)
return response, err
}