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:
Daniel Nephin
2016-10-04 11:40:17 -04:00
parent d375460d63
commit 31c5c30bb3
10 changed files with 76 additions and 17 deletions

View File

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

View 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"`
}