mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api: rename volume.VolumeListOKBody to volume.ListResponse
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -2073,7 +2073,7 @@ definitions:
|
||||
VolumeListResponse:
|
||||
type: "object"
|
||||
title: "VolumeListResponse"
|
||||
x-go-name: "VolumeListOKBody"
|
||||
x-go-name: "ListResponse"
|
||||
description: "Volume list response"
|
||||
properties:
|
||||
Volumes:
|
||||
|
||||
6
api/types/volume/deprecated.go
Normal file
6
api/types/volume/deprecated.go
Normal 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
|
||||
@@ -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"`
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user