diff --git a/api/server/router/volume/volume_routes.go b/api/server/router/volume/volume_routes.go index 5705b08699..6b179d0b42 100644 --- a/api/server/router/volume/volume_routes.go +++ b/api/server/router/volume/volume_routes.go @@ -24,7 +24,7 @@ func (v *volumeRouter) getVolumesList(ctx context.Context, w http.ResponseWriter if err != nil { return err } - return httputils.WriteJSON(w, http.StatusOK, &volume.VolumeListOKBody{Volumes: volumes, Warnings: warnings}) + return httputils.WriteJSON(w, http.StatusOK, &volume.ListResponse{Volumes: volumes, Warnings: warnings}) } func (v *volumeRouter) getVolumeByName(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error { diff --git a/api/swagger.yaml b/api/swagger.yaml index 39d18e2e99..82a2159f9e 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -2073,7 +2073,7 @@ definitions: VolumeListResponse: type: "object" title: "VolumeListResponse" - x-go-name: "VolumeListOKBody" + x-go-name: "ListResponse" description: "Volume list response" properties: Volumes: diff --git a/api/types/volume/deprecated.go b/api/types/volume/deprecated.go new file mode 100644 index 0000000000..933f559291 --- /dev/null +++ b/api/types/volume/deprecated.go @@ -0,0 +1,6 @@ +package volume // import "github.com/docker/docker/api/types/volume" + +// VolumeListOKBody Volume list response +// +// Deprecated: use ListResponse +type VolumeListOKBody = ListResponse diff --git a/api/types/volume/volume_list_o_k_body.go b/api/types/volume/list_response.go similarity index 76% rename from api/types/volume/volume_list_o_k_body.go rename to api/types/volume/list_response.go index 66dd12ec28..ca5192a2a9 100644 --- a/api/types/volume/volume_list_o_k_body.go +++ b/api/types/volume/list_response.go @@ -3,11 +3,11 @@ package volume // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command -// VolumeListOKBody VolumeListResponse +// ListResponse VolumeListResponse // // Volume list response -// swagger:model VolumeListOKBody -type VolumeListOKBody struct { +// swagger:model ListResponse +type ListResponse struct { // List of volumes Volumes []*Volume `json:"Volumes"` diff --git a/client/interface.go b/client/interface.go index 513a5bdeed..3502c43474 100644 --- a/client/interface.go +++ b/client/interface.go @@ -176,7 +176,7 @@ type VolumeAPIClient interface { VolumeCreate(ctx context.Context, options volume.VolumeCreateBody) (volume.Volume, error) VolumeInspect(ctx context.Context, volumeID string) (volume.Volume, error) VolumeInspectWithRaw(ctx context.Context, volumeID string) (volume.Volume, []byte, error) - VolumeList(ctx context.Context, filter filters.Args) (volume.VolumeListOKBody, error) + VolumeList(ctx context.Context, filter filters.Args) (volume.ListResponse, error) VolumeRemove(ctx context.Context, volumeID string, force bool) error VolumesPrune(ctx context.Context, pruneFilter filters.Args) (types.VolumesPruneReport, error) } diff --git a/client/volume_list.go b/client/volume_list.go index 3ad8bf22a9..d8204f8db5 100644 --- a/client/volume_list.go +++ b/client/volume_list.go @@ -10,8 +10,8 @@ import ( ) // VolumeList returns the volumes configured in the docker host. -func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volume.VolumeListOKBody, error) { - var volumes volume.VolumeListOKBody +func (cli *Client) VolumeList(ctx context.Context, filter filters.Args) (volume.ListResponse, error) { + var volumes volume.ListResponse query := url.Values{} if filter.Len() > 0 { diff --git a/client/volume_list_test.go b/client/volume_list_test.go index 0d54f4a597..19a843be80 100644 --- a/client/volume_list_test.go +++ b/client/volume_list_test.go @@ -69,7 +69,7 @@ func TestVolumeList(t *testing.T) { if actualFilters != listCase.expectedFilters { return nil, fmt.Errorf("filters not set in URL query properly. Expected '%s', got %s", listCase.expectedFilters, actualFilters) } - content, err := json.Marshal(volume.VolumeListOKBody{ + content, err := json.Marshal(volume.ListResponse{ Volumes: []*volume.Volume{ { Name: "volume",