mirror of
https://github.com/docker/cli.git
synced 2026-09-25 17:02:07 -04:00
Generate VolumesCreateRequest from the swagger spec.
Signed-off-by: Daniel Nephin <dnephin@docker.com> Upstream-commit: 5c2498fd3c41f4badb1788665886d30772537f73 Component: engine
This commit is contained in:
@@ -43,7 +43,7 @@ func (v *volumeRouter) postVolumesCreate(ctx context.Context, w http.ResponseWri
|
||||
return err
|
||||
}
|
||||
|
||||
var req types.VolumeCreateRequest
|
||||
var req volumetypes.VolumesCreateBody
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package volume
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// DO NOT EDIT THIS FILE
|
||||
// This file was generated by `swagger generate operation`
|
||||
//
|
||||
// See hack/swagger-gen.sh
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
/*VolumesCreateBody volumes create body
|
||||
|
||||
swagger:model VolumesCreateBody
|
||||
*/
|
||||
type VolumesCreateBody struct {
|
||||
|
||||
/* Name of the volume driver to use.
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Driver string `json:"Driver"`
|
||||
|
||||
/* A mapping of driver options and values. These options are passed directly to the driver and are driver specific.
|
||||
|
||||
Required: true
|
||||
*/
|
||||
DriverOpts map[string]string `json:"DriverOpts"`
|
||||
|
||||
/* A mapping of arbitrary key/value data to set on the volume.
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Labels map[string]string `json:"Labels"`
|
||||
|
||||
/* The new volume's name. If not specified, Docker generates a name.
|
||||
|
||||
Required: true
|
||||
*/
|
||||
Name string `json:"Name"`
|
||||
}
|
||||
@@ -5480,10 +5480,12 @@ paths:
|
||||
Name:
|
||||
description: "The new volume's name. If not specified, Docker generates a name."
|
||||
type: "string"
|
||||
x-nullable: false
|
||||
Driver:
|
||||
description: "Name of the volume driver to use."
|
||||
type: "string"
|
||||
default: "local"
|
||||
x-nullable: false
|
||||
DriverOpts:
|
||||
description: "A mapping of driver options and values. These options are passed directly to the driver and are driver specific."
|
||||
type: "object"
|
||||
|
||||
@@ -410,15 +410,6 @@ type MountPoint struct {
|
||||
Propagation mount.Propagation
|
||||
}
|
||||
|
||||
// VolumeCreateRequest contains the request for the remote API:
|
||||
// POST "/volumes/create"
|
||||
type VolumeCreateRequest struct {
|
||||
Name string // Name is the requested name of the volume
|
||||
Driver string // Driver is the name of the driver that should be used to create the volume
|
||||
DriverOpts map[string]string // DriverOpts holds the driver specific options to use for when creating the volume.
|
||||
Labels map[string]string // Labels holds metadata specific to the volume being created.
|
||||
}
|
||||
|
||||
// NetworkResource is the body of the "get network" http response message
|
||||
type NetworkResource struct {
|
||||
Name string // Name is the requested name of the network
|
||||
|
||||
Reference in New Issue
Block a user