Generate VolumeList response from the swagger spec
Signed-off-by: Daniel Nephin <dnephin@docker.com> Upstream-commit: d459e83b1c993d63d5f94b85a7f8ddf3ac01beae Component: engine
This commit is contained in:
@ -5,6 +5,7 @@ import (
|
||||
"net/http"
|
||||
|
||||
"github.com/docker/docker/api/server/httputils"
|
||||
volumetypes "github.com/docker/docker/api/server/types/volume"
|
||||
"github.com/docker/docker/api/types"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
@ -18,7 +19,7 @@ func (v *volumeRouter) getVolumesList(ctx context.Context, w http.ResponseWriter
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return httputils.WriteJSON(w, http.StatusOK, &types.VolumesListResponse{Volumes: volumes, Warnings: warnings})
|
||||
return httputils.WriteJSON(w, http.StatusOK, &volumetypes.VolumesListOKBody{Volumes: volumes, Warnings: warnings})
|
||||
}
|
||||
|
||||
func (v *volumeRouter) getVolumeByName(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
||||
|
||||
29
components/engine/api/server/types/volume/volumes_list.go
Normal file
29
components/engine/api/server/types/volume/volumes_list.go
Normal file
@ -0,0 +1,29 @@
|
||||
package volume
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DO NOT EDIT THIS FILE
|
||||
// This file was generated by `swagger generate operation`
|
||||
//
|
||||
// See hack/swagger-gen.sh
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
import "github.com/docker/docker/api/types"
|
||||
|
||||
/*VolumesListOKBody volumes list o k body
|
||||
|
||||
swagger:model VolumesListOKBody
|
||||
*/
|
||||
type VolumesListOKBody struct {
|
||||
|
||||
/* List of volumes
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Volumes []*types.Volume `json:"Volumes"`
|
||||
|
||||
/* Warnings that occurred when fetching the list of volumes
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Warnings []string `json:"Warnings"`
|
||||
}
|
||||
Reference in New Issue
Block a user