From 875d2b1b22ff164ff85e470afea6102ee041277c Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 14 Nov 2016 14:50:16 -0500 Subject: [PATCH] Convert ContainerTopOKResponse from swagger spec. Signed-off-by: Daniel Nephin Upstream-commit: 9eda7f4daf3caced7886be181f28c350584d68e0 Component: cli --- components/cli/container_top.go | 6 +++--- components/cli/container_top_test.go | 4 ++-- components/cli/interface.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/cli/container_top.go b/components/cli/container_top.go index 4e7270ea22..9689123a40 100644 --- a/components/cli/container_top.go +++ b/components/cli/container_top.go @@ -5,13 +5,13 @@ import ( "net/url" "strings" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" "golang.org/x/net/context" ) // ContainerTop shows process information from within a container. -func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (types.ContainerProcessList, error) { - var response types.ContainerProcessList +func (cli *Client) ContainerTop(ctx context.Context, containerID string, arguments []string) (container.ContainerTopOKBody, error) { + var response container.ContainerTopOKBody query := url.Values{} if len(arguments) > 0 { query.Set("ps_args", strings.Join(arguments, " ")) diff --git a/components/cli/container_top_test.go b/components/cli/container_top_test.go index 7802be063e..68ccef505d 100644 --- a/components/cli/container_top_test.go +++ b/components/cli/container_top_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" "golang.org/x/net/context" ) @@ -43,7 +43,7 @@ func TestContainerTop(t *testing.T) { return nil, fmt.Errorf("args not set in URL query properly. Expected 'arg1 arg2', got %v", args) } - b, err := json.Marshal(types.ContainerProcessList{ + b, err := json.Marshal(container.ContainerTopOKBody{ Processes: [][]string{ {"p1", "p2"}, {"p3"}, diff --git a/components/cli/interface.go b/components/cli/interface.go index e3bcb19950..ef9b10bba3 100644 --- a/components/cli/interface.go +++ b/components/cli/interface.go @@ -59,7 +59,7 @@ type ContainerAPIClient interface { ContainerStats(ctx context.Context, container string, stream bool) (types.ContainerStats, error) ContainerStart(ctx context.Context, container string, options types.ContainerStartOptions) error ContainerStop(ctx context.Context, container string, timeout *time.Duration) error - ContainerTop(ctx context.Context, container string, arguments []string) (types.ContainerProcessList, error) + ContainerTop(ctx context.Context, container string, arguments []string) (container.ContainerTopOKBody, error) ContainerUnpause(ctx context.Context, container string) error ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.ContainerUpdateOKBody, error) ContainerWait(ctx context.Context, container string) (int64, error)