Documentation
¶
Index ¶
- func BaseEndpoint(endpoint string) (string, error)
- func BaseVersionedEndpoint(endpoint string) (string, error)
- func ParseMicroversion(version string) (major int, minor int, err error)
- func ParseVersion(version string) (major, minor int, err error)
- func RequireMicroversion(ctx context.Context, client gophercloud.ServiceClient, required string) (gophercloud.ServiceClient, error)
- type Status
- type SupportedMicroversions
- type SupportedVersion
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BaseEndpoint ¶
BaseEndpoint will return a URL without the /vX.Y portion of the URL.
func BaseVersionedEndpoint ¶ added in v2.8.0
BaseVersionedEndpoint will return a URL with the /vX.Y portion of the URL, if present, but without a project ID or similar
func ParseMicroversion ¶
ParseMicroversion parses the version major.minor into separate integers major and minor. For example, "2.53" becomes 2 and 53.
func ParseVersion ¶ added in v2.8.0
ParseVersion parsed the version strings v{MAJOR} and v{MAJOR}.{MINOR} into separate integers major and minor. For example, "v2.1" becomes 2 and 1, "v3" becomes 3 and 0, and "1" becomes 1 and 0.
Types ¶
type SupportedMicroversions ¶
type SupportedMicroversions struct { // MaxMajor is the major version number of the maximum supported API microversion MaxMajor int // MaxMinor is the minor version number of the maximum supported API microversion MaxMinor int // MinMajor is the major version number of the minimum supported API microversion MinMajor int // MinMinor is the minor version number of the minimum supported API microversion MinMinor int }
SupportedMicroversions stores a normalized form of the maximum and minimum API microversions supported by a given service.
func GetSupportedMicroversions ¶
func GetSupportedMicroversions(ctx context.Context, client *gophercloud.ServiceClient) (SupportedMicroversions, error)
GetSupportedMicroversions returns the minimum and maximum microversion that is supported by the ServiceClient Endpoint.
func (SupportedMicroversions) IsSupported ¶
func (supported SupportedMicroversions) IsSupported(version string) (bool, error)
IsSupported checks if a microversion falls in the supported interval. It returns true if the version is within the interval and false otherwise.
type SupportedVersion ¶ added in v2.8.0
type SupportedVersion struct { // Major is the major version number of the API Major int // Minor is the minor version number of the API Minor int // Status is the status of the API Status Status SupportedMicroversions }
SupportedVersion stores a normalized form of the API version data. It handles APIs that support microversions as well as those that do not.
func GetServiceVersions ¶ added in v2.8.0
func GetServiceVersions(ctx context.Context, client *gophercloud.ProviderClient, endpointURL string, discoverVersions bool) ([]SupportedVersion, error)
GetServiceVersions returns the versions supported by the ServiceClient Endpoint. If the endpoint resolves to an unversioned discovery API, this should return one or more supported versions. If the endpoint resolves to a versioned discovery API, this should return exactly one supported version.
type Version ¶
Version is a supported API version, corresponding to a vN package within the appropriate service.
func ChooseVersion ¶
func ChooseVersion(ctx context.Context, client *gophercloud.ProviderClient, recognized []*Version) (*Version, string, error)
ChooseVersion queries the base endpoint of an API to choose the identity service version. It will pick a version among the recognized, taking into account the priority and avoiding experimental alternatives from the published versions. However, if the client specifies a full endpoint that is among the recognized versions, it will be used regardless of priority. It returns the highest-Priority Version, OR exact match with client endpoint, among the alternatives that are provided, as well as its corresponding endpoint.