build(deps): bump github.com/gophercloud/gophercloud

Bumps [github.com/gophercloud/gophercloud](https://github.com/gophercloud/gophercloud) from 0.11.0 to 0.20.0.
- [Release notes](https://github.com/gophercloud/gophercloud/releases)
- [Changelog](https://github.com/gophercloud/gophercloud/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gophercloud/gophercloud/compare/v0.11.0...v0.20.0)

---
updated-dependencies:
- dependency-name: github.com/gophercloud/gophercloud
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2021-09-02 13:06:05 +00:00 committed by Ondřej Budai
parent 24727bb2e3
commit 839a708755
20 changed files with 593 additions and 194 deletions

View file

@ -29,6 +29,14 @@ type ListOpts struct {
// Flavor is the name of the flavor in URL format.
Flavor string `q:"flavor"`
// IP is a regular expression to match the IPv4 address of the server.
IP string `q:"ip"`
// This requires the client to be set to microversion 2.5 or later, unless
// the user is an admin.
// IP is a regular expression to match the IPv6 address of the server.
IP6 string `q:"ip6"`
// Name of the server as a string; can be queried with regular expressions.
// Realize that ?name=bob returns both bob and bobb. If you need to match bob
// only, you can use a regular expression matching the syntax of the
@ -55,6 +63,11 @@ type ListOpts struct {
// Setting "AllTenants = true" is required.
TenantID string `q:"tenant_id"`
// This requires the client to be set to microversion 2.83 or later, unless
// the user is an admin.
// UserID lists servers for a particular user.
UserID string `q:"user_id"`
// This requires the client to be set to microversion 2.26 or later.
// Tags filters on specific server tags. All tags must be present for the server.
Tags string `q:"tags"`
@ -70,6 +83,9 @@ type ListOpts struct {
// This requires the client to be set to microversion 2.26 or later.
// NotTagsAny filters on specific server tags. At least one of the tags must be absent for the server.
NotTagsAny string `q:"not-tags-any"`
// Display servers based on their availability zone (Admin only until microversion 2.82).
AvailabilityZone string `q:"availability_zone"`
}
// ToServerListQuery formats a ListOpts into a query string.
@ -112,6 +128,13 @@ type Network struct {
// FixedIP specifies a fixed IPv4 address to be used on this network.
FixedIP string
// Tag may contain an optional device role tag for the server's virtual
// network interface. This can be used to identify network interfaces when
// multiple networks are connected to one server.
//
// Requires microversion 2.32 through 2.36 or 2.42 or later.
Tag string
}
// Personality is an array of files that are injected into the server at launch.
@ -199,10 +222,6 @@ type CreateOpts struct {
// Max specifies Maximum number of servers to launch.
Max int `json:"max_count,omitempty"`
// ServiceClient will allow calls to be made to retrieve an image or
// flavor ID by name.
ServiceClient *gophercloud.ServiceClient `json:"-"`
// Tags allows a server to be tagged with single-word metadata.
// Requires microversion 2.52 or later.
Tags []string `json:"tags,omitempty"`
@ -211,7 +230,6 @@ type CreateOpts struct {
// ToServerCreateMap assembles a request body based on the contents of a
// CreateOpts.
func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) {
opts.ServiceClient = nil
b, err := gophercloud.BuildRequestBody(opts, "")
if err != nil {
return nil, err
@ -250,6 +268,9 @@ func (opts CreateOpts) ToServerCreateMap() (map[string]interface{}, error) {
if net.FixedIP != "" {
networks[i]["fixed_ip"] = net.FixedIP
}
if net.Tag != "" {
networks[i]["tag"] = net.Tag
}
}
b["networks"] = networks
}
@ -447,10 +468,6 @@ type RebuildOpts struct {
// Personality [optional] includes files to inject into the server at launch.
// Rebuild will base64-encode file contents for you.
Personality Personality `json:"personality,omitempty"`
// ServiceClient will allow calls to be made to retrieve an image or
// flavor ID by name.
ServiceClient *gophercloud.ServiceClient `json:"-"`
}
// ToServerRebuildMap formats a RebuildOpts struct into a map for use in JSON

View file

@ -8,7 +8,7 @@ for more information.
Example to List Tenants
listOpts := tenants.ListOpts{
listOpts := &tenants.ListOpts{
Limit: 2,
}

View file

@ -96,8 +96,8 @@ type Token struct {
OAuthToken string `q:"oauth_token"`
// OAuthTokenSecret is the secret value associated with the OAuth Token.
OAuthTokenSecret string `q:"oauth_token_secret"`
// OAUthExpiresAt is the date and time when an OAuth token expires.
OAUthExpiresAt *time.Time `q:"-"`
// OAuthExpiresAt is the date and time when an OAuth token expires.
OAuthExpiresAt *time.Time `q:"-"`
}
// TokenResult is a struct to handle
@ -127,7 +127,7 @@ func (r TokenResult) Extract() (*Token, error) {
if t, err := time.Parse(gophercloud.RFC3339Milli, v); err != nil {
return nil, err
} else {
token.OAUthExpiresAt = &t
token.OAuthExpiresAt = &t
}
}

View file

@ -41,6 +41,9 @@ type ListOpts struct {
// Visibility filters on the visibility of the image.
Visibility ImageVisibility `q:"visibility"`
// Hidden filters on the hidden status of the image.
Hidden bool `q:"os_hidden"`
// MemberStatus filters on the member status of the image.
MemberStatus ImageMemberStatus `q:"member_status"`
@ -155,6 +158,9 @@ type CreateOpts struct {
// Visibility defines who can see/use the image.
Visibility *ImageVisibility `json:"visibility,omitempty"`
// Hidden is whether the image is listed in default image list or not.
Hidden *bool `json:"os_hidden,omitempty"`
// Tags is a set of image tags.
Tags []string `json:"tags,omitempty"`
@ -283,6 +289,20 @@ func (r UpdateVisibility) ToImagePatchMap() map[string]interface{} {
}
}
// ReplaceImageHidden represents an updated os_hidden property request.
type ReplaceImageHidden struct {
NewHidden bool
}
// ToImagePatchMap assembles a request body based on ReplaceImageHidden.
func (r ReplaceImageHidden) ToImagePatchMap() map[string]interface{} {
return map[string]interface{}{
"op": "replace",
"path": "/os_hidden",
"value": r.NewHidden,
}
}
// ReplaceImageName represents an updated image_name property request.
type ReplaceImageName struct {
NewName string

View file

@ -8,7 +8,6 @@ import (
"time"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/internal"
"github.com/gophercloud/gophercloud/pagination"
)
@ -54,6 +53,9 @@ type Image struct {
// Visibility defines who can see/use the image.
Visibility ImageVisibility `json:"visibility"`
// Hidden is whether the image is listed in default image list or not.
Hidden bool `json:"os_hidden"`
// Checksum is the checksum of the data that's associated with the image.
Checksum string `json:"checksum"`
@ -132,7 +134,7 @@ func (r *Image) UnmarshalJSON(b []byte) error {
delete(resultMap, "size")
delete(resultMap, "openstack-image-import-methods")
delete(resultMap, "openstack-image-store-ids")
r.Properties = internal.RemainingKeys(Image{}, resultMap)
r.Properties = gophercloud.RemainingKeys(Image{}, resultMap)
}
if v := strings.FieldsFunc(strings.TrimSpace(s.OpenStackImageImportMethods), splitFunc); len(v) > 0 {