Files
docker-cli/components/engine/api/client/lib/container_inspect.go
David Calavera c95eea80e2 Implement docker logs with standalone client lib.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 087674264674eaf946d185691ea92eee16f16a4f
Component: engine
2015-12-09 12:04:55 -05:00

21 lines
503 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 serverResp.body.Close()
var response types.ContainerJSON
json.NewDecoder(serverResp.body).Decode(&response)
return response, err
}