blob: b1f45cdedffb21b403be8bc59958f40a23c18d75 [file] [log] [blame]
package volumes
import (
"github.com/racker/perigee"
blockstorage "github.com/rackspace/gophercloud/openstack/blockstorage/v1"
)
func Create(c *blockstorage.Client, opts CreateOpts) (Volume, error) {
var v Volume
h, err := c.GetHeaders()
if err != nil {
return v, err
}
url := c.GetVolumeURL()
_, err = perigee.Request("POST", url, perigee.Options{
Results: &v,
ReqBody: map[string]interface{}{
"volume": opts,
},
MoreHeaders: h,
})
return v, err
}