Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthenticatedClient ¶
func AuthenticatedClient(options AuthOptions) (*gophercloud.ProviderClient, error)
Types ¶
type AuthOptions ¶
type AuthOptions struct { tokens2.AuthOptions ApiKey string `json:"apiKey,omitempty"` }
func AuthOptionsFromEnv ¶
func AuthOptionsFromEnv() (AuthOptions, error)
AuthOptionsFromEnv fills out a goraxauth.AuthOptionsRax structure with the settings found on the various OpenStack OS_* environment variables and/or the RAX_API_KEY environment variable.
The following variables provide sources of truth: OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, RAX_API_KEY and OS_PROJECT_ID.
Of these, OS_USERNAME and OS_PASSWORD or RAX_API_KEY must have settings, or an error will result, while OS_PROJECT_ID is optional.
OS_TENANT_ID is the deprecated forms of OS_PROJECT_ID.
If OS_PROJECT_ID, they will still be referred as "tenant".
To use this function, first set the OS_* environment variables (for example, by sourcing an `openrc` file), then:
opts, err := openstack.AuthOptionsFromEnv() provider, err := openstack.AuthenticatedClient(context.TODO(), opts)
func (AuthOptions) CanReauth ¶
func (opts AuthOptions) CanReauth() bool
func (AuthOptions) ToTokenV2CreateMap ¶
func (opts AuthOptions) ToTokenV2CreateMap() (map[string]interface{}, error)