openstack

package
v0.0.0-...-474c82f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(endpoint, user, password, tenant, domain_name, domain_id string) (*gophercloud.ProviderClient, error)

Authenticate is used to authenticate user for given tenant. Request is send to provided Keystone endpoint Returns authenticated provider client, which is used as a base for service clients.

func ChooseVersion

func ChooseVersion(recognized []types.ApiVersion) (string, error)

ChooseVersion returns chosen Cinder API version based on defined priority

func NewImageService

NewImageService creates a ServiceClient that may be used with the v2 object storage package.

Types

type Common

type Common struct{}

Common is a receiver for Commoner interface

func (Common) GetApiVersions

func (c Common) GetApiVersions(provider *gophercloud.ProviderClient) ([]types.ApiVersion, error)

GetApiVersions is used to retrieve list of available Cinder API versions List of api version is then used to dispatch calls to proper API version based on defined priority

func (Common) GetTenants

func (c Common) GetTenants(endpoint, user, password string) ([]types.Tenant, error)

GetTenants is used to retrieve list of available tenant for authenticated user List of tenants can then be used to authenticate user for each given tenant

type Commoner

type Commoner interface {
	GetTenants(endpoint, user, password string) ([]types.Tenant, error)
	GetApiVersions(provider *gophercloud.ProviderClient) ([]types.ApiVersion, error)
}

Commoner provides abstraction for shared functions mainly for mocking

Directories

Path Synopsis
v1
v2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL