1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

api: rename volume.VolumeListOKBody to volume.ListResponse

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-03-05 21:04:55 +01:00
parent 4caf68f4f6
commit 18281c92fa
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C
7 changed files with 15 additions and 9 deletions

View file

@ -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 {

View file

@ -2073,7 +2073,7 @@ definitions:
VolumeListResponse:
type: "object"
title: "VolumeListResponse"
x-go-name: "VolumeListOKBody"
x-go-name: "ListResponse"
description: "Volume list response"
properties:
Volumes:

View file

@ -0,0 +1,6 @@
package volume // import "github.com/docker/docker/api/types/volume"
// VolumeListOKBody Volume list response
//
// Deprecated: use ListResponse
type VolumeListOKBody = ListResponse

View file

@ -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"`

View file

@ -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)
}

View file

@ -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 {

View file

@ -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",