2015-06-10 09:46:54 -04:00
|
|
|
// generated code - DO NOT EDIT
|
|
|
|
|
2015-05-19 16:05:25 -04:00
|
|
|
package volumedrivers
|
|
|
|
|
2016-04-11 11:17:52 -04:00
|
|
|
import (
|
|
|
|
"errors"
|
2016-11-22 14:21:34 -05:00
|
|
|
|
2016-04-11 11:17:52 -04:00
|
|
|
"github.com/docker/docker/volume"
|
|
|
|
)
|
2015-05-22 13:37:00 -04:00
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type client interface {
|
|
|
|
Call(string, interface{}, interface{}) error
|
|
|
|
}
|
2015-05-19 16:05:25 -04:00
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxy struct {
|
|
|
|
client
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyCreateRequest struct {
|
|
|
|
Name string
|
2016-04-09 17:42:24 -04:00
|
|
|
Opts map[string]string
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyCreateResponse struct {
|
|
|
|
Err string
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2016-04-09 17:42:24 -04:00
|
|
|
func (pp *volumeDriverProxy) Create(name string, opts map[string]string) (err error) {
|
2015-06-10 09:46:54 -04:00
|
|
|
var (
|
|
|
|
req volumeDriverProxyCreateRequest
|
|
|
|
ret volumeDriverProxyCreateResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
2015-06-12 09:25:32 -04:00
|
|
|
req.Opts = opts
|
2015-06-10 09:46:54 -04:00
|
|
|
if err = pp.Call("VolumeDriver.Create", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyRemoveRequest struct {
|
|
|
|
Name string
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyRemoveResponse struct {
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pp *volumeDriverProxy) Remove(name string) (err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyRemoveRequest
|
|
|
|
ret volumeDriverProxyRemoveResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
|
|
|
if err = pp.Call("VolumeDriver.Remove", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyPathRequest struct {
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyPathResponse struct {
|
|
|
|
Mountpoint string
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pp *volumeDriverProxy) Path(name string) (mountpoint string, err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyPathRequest
|
|
|
|
ret volumeDriverProxyPathResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
|
|
|
if err = pp.Call("VolumeDriver.Path", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
mountpoint = ret.Mountpoint
|
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyMountRequest struct {
|
|
|
|
Name string
|
2016-03-07 21:41:44 -05:00
|
|
|
ID string
|
2015-06-10 09:46:54 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyMountResponse struct {
|
|
|
|
Mountpoint string
|
|
|
|
Err string
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
|
|
|
|
2016-03-07 21:41:44 -05:00
|
|
|
func (pp *volumeDriverProxy) Mount(name string, id string) (mountpoint string, err error) {
|
2015-06-10 09:46:54 -04:00
|
|
|
var (
|
|
|
|
req volumeDriverProxyMountRequest
|
|
|
|
ret volumeDriverProxyMountResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
2016-03-07 21:41:44 -05:00
|
|
|
req.ID = id
|
2015-06-10 09:46:54 -04:00
|
|
|
if err = pp.Call("VolumeDriver.Mount", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-22 13:37:00 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
mountpoint = ret.Mountpoint
|
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyUnmountRequest struct {
|
|
|
|
Name string
|
2016-03-07 21:41:44 -05:00
|
|
|
ID string
|
2015-05-22 13:37:00 -04:00
|
|
|
}
|
|
|
|
|
2015-06-10 09:46:54 -04:00
|
|
|
type volumeDriverProxyUnmountResponse struct {
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
2016-03-07 21:41:44 -05:00
|
|
|
func (pp *volumeDriverProxy) Unmount(name string, id string) (err error) {
|
2015-06-10 09:46:54 -04:00
|
|
|
var (
|
|
|
|
req volumeDriverProxyUnmountRequest
|
|
|
|
ret volumeDriverProxyUnmountResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
2016-03-07 21:41:44 -05:00
|
|
|
req.ID = id
|
2015-06-10 09:46:54 -04:00
|
|
|
if err = pp.Call("VolumeDriver.Unmount", req, &ret); err != nil {
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-06-10 09:46:54 -04:00
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
2015-05-19 16:05:25 -04:00
|
|
|
}
|
2015-09-23 16:29:14 -04:00
|
|
|
|
|
|
|
type volumeDriverProxyListRequest struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyListResponse struct {
|
2016-04-09 17:42:24 -04:00
|
|
|
Volumes []*proxyVolume
|
2015-09-23 16:29:14 -04:00
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
2016-04-09 17:42:24 -04:00
|
|
|
func (pp *volumeDriverProxy) List() (volumes []*proxyVolume, err error) {
|
2015-09-23 16:29:14 -04:00
|
|
|
var (
|
|
|
|
req volumeDriverProxyListRequest
|
|
|
|
ret volumeDriverProxyListResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
if err = pp.Call("VolumeDriver.List", req, &ret); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
volumes = ret.Volumes
|
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyGetRequest struct {
|
|
|
|
Name string
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyGetResponse struct {
|
|
|
|
Volume *proxyVolume
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pp *volumeDriverProxy) Get(name string) (volume *proxyVolume, err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyGetRequest
|
|
|
|
ret volumeDriverProxyGetResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
req.Name = name
|
|
|
|
if err = pp.Call("VolumeDriver.Get", req, &ret); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
volume = ret.Volume
|
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|
2016-04-11 11:17:52 -04:00
|
|
|
|
|
|
|
type volumeDriverProxyCapabilitiesRequest struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
type volumeDriverProxyCapabilitiesResponse struct {
|
|
|
|
Capabilities volume.Capability
|
|
|
|
Err string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pp *volumeDriverProxy) Capabilities() (capabilities volume.Capability, err error) {
|
|
|
|
var (
|
|
|
|
req volumeDriverProxyCapabilitiesRequest
|
|
|
|
ret volumeDriverProxyCapabilitiesResponse
|
|
|
|
)
|
|
|
|
|
|
|
|
if err = pp.Call("VolumeDriver.Capabilities", req, &ret); err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
capabilities = ret.Capabilities
|
|
|
|
|
|
|
|
if ret.Err != "" {
|
|
|
|
err = errors.New(ret.Err)
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
}
|