vendor: Updating Gophercloud for OpenStack provider

This commit is contained in:
Joe Topjian
2016-05-28 21:48:14 +00:00
parent e0d343906d
commit fd91df2ca2
5 changed files with 89 additions and 84 deletions

View File

@@ -74,6 +74,9 @@ type CreateOpts struct {
// current specification supports LBMethodRoundRobin and
// LBMethodLeastConnections as valid values for this attribute.
LBMethod string
// The provider of the pool
Provider string
}
// Create accepts a CreateOpts struct and uses the values to create a new
@@ -85,6 +88,7 @@ func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult {
Protocol string `json:"protocol"`
SubnetID string `json:"subnet_id"`
LBMethod string `json:"lb_method"`
Provider string `json:"provider,omitempty"`
}
type request struct {
Pool pool `json:"pool"`
@@ -96,6 +100,7 @@ func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult {
Protocol: opts.Protocol,
SubnetID: opts.SubnetID,
LBMethod: opts.LBMethod,
Provider: opts.Provider,
}}
var res CreateResult

View File

@@ -25,7 +25,7 @@ func (opts GetOpts) ToAccountGetMap() (map[string]string, error) {
// ExtractHeader method on the GetResult.
func Get(c *gophercloud.ServiceClient, opts GetOptsBuilder) GetResult {
var res GetResult
h := c.AuthenticatedHeaders()
h := make(map[string]string)
if opts != nil {
headers, err := opts.ToAccountGetMap()

View File

@@ -96,7 +96,7 @@ func (opts CreateOpts) ToContainerCreateMap() (map[string]string, error) {
// Create is a function that creates a new container.
func Create(c *gophercloud.ServiceClient, containerName string, opts CreateOptsBuilder) CreateResult {
var res CreateResult
h := c.AuthenticatedHeaders()
h := make(map[string]string)
if opts != nil {
headers, err := opts.ToContainerCreateMap()
@@ -164,7 +164,7 @@ func (opts UpdateOpts) ToContainerUpdateMap() (map[string]string, error) {
// metadata.
func Update(c *gophercloud.ServiceClient, containerName string, opts UpdateOptsBuilder) UpdateResult {
var res UpdateResult
h := c.AuthenticatedHeaders()
h := make(map[string]string)
if opts != nil {
headers, err := opts.ToContainerUpdateMap()

View File

@@ -117,7 +117,7 @@ func Download(c *gophercloud.ServiceClient, containerName, objectName string, op
var res DownloadResult
url := downloadURL(c, containerName, objectName)
h := c.AuthenticatedHeaders()
h := make(map[string]string)
if opts != nil {
headers, query, err := opts.ToObjectDownloadParams()
@@ -282,7 +282,7 @@ func (opts CopyOpts) ToObjectCopyMap() (map[string]string, error) {
// Copy is a function that copies one object to another.
func Copy(c *gophercloud.ServiceClient, containerName, objectName string, opts CopyOptsBuilder) CopyResult {
var res CopyResult
h := c.AuthenticatedHeaders()
h := make(map[string]string)
headers, err := opts.ToObjectCopyMap()
if err != nil {
@@ -427,7 +427,7 @@ func (opts UpdateOpts) ToObjectUpdateMap() (map[string]string, error) {
// Update is a function that creates, updates, or deletes an object's metadata.
func Update(c *gophercloud.ServiceClient, containerName, objectName string, opts UpdateOptsBuilder) UpdateResult {
var res UpdateResult
h := c.AuthenticatedHeaders()
h := make(map[string]string)
if opts != nil {
headers, err := opts.ToObjectUpdateMap()