Documentation ¶
Overview ¶
Package openstack contains resources for the individual OpenStack projects supported in Gophercloud. It also includes functions to authenticate to an OpenStack cloud and for provisioning various service-level clients.
Example of Creating a Service Client
ao, err := openstack.AuthOptionsFromEnv() provider, err := openstack.AuthenticatedClient(ao) client, err := openstack.NewNetworkV2(client, gophercloud.EndpointOpts{ Region: os.Getenv("OS_REGION_NAME"), })
Index ¶
- func AuthOptionsFromEnv() (gophercloud.AuthOptions, error)
- func Authenticate(client *gophercloud.ProviderClient, options gophercloud.AuthOptions) error
- func AuthenticateV2(client *gophercloud.ProviderClient, options gophercloud.AuthOptions, ...) error
- func AuthenticateV3(client *gophercloud.ProviderClient, options tokens3.AuthOptionsBuilder, ...) error
- func AuthenticatedClient(options gophercloud.AuthOptions) (*gophercloud.ProviderClient, error)
- func NewBareMetalIntrospectionV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewBareMetalV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewBlockStorageV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewBlockStorageV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewBlockStorageV3(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewCDNV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewClient(endpoint string) (*gophercloud.ProviderClient, error)
- func NewClusteringV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewComputeV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewContainerInfraV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewContainerV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewDNSV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewIdentityV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewIdentityV3(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewImageServiceV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewKeyManagerV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewLoadBalancerV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewMessagingV2(client *gophercloud.ProviderClient, clientID string, ...) (*gophercloud.ServiceClient, error)
- func NewNetworkV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewObjectStorageV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewOrchestrationV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewPlacementV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewSharedFileSystemV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func NewWorkflowV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
- func V2EndpointURL(catalog *tokens2.ServiceCatalog, opts gophercloud.EndpointOpts) (string, error)
- func V3EndpointURL(catalog *tokens3.ServiceCatalog, opts gophercloud.EndpointOpts) (string, error)
- type ErrEndpointNotFound
- type ErrInvalidAvailabilityProvided
- type ErrNoAuthURL
- type ErrNoPassword
- type ErrNoUsername
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthOptionsFromEnv ¶
func AuthOptionsFromEnv() (gophercloud.AuthOptions, error)
AuthOptionsFromEnv fills out an identity.AuthOptions structure with the settings found on the various OpenStack OS_* environment variables.
The following variables provide sources of truth: OS_AUTH_URL, OS_USERNAME, OS_PASSWORD and OS_PROJECT_ID.
Of these, OS_USERNAME, OS_PASSWORD, and OS_AUTH_URL must have settings, or an error will result. OS_PROJECT_ID, is optional.
OS_TENANT_ID and OS_TENANT_NAME are deprecated forms of OS_PROJECT_ID and OS_PROJECT_NAME and the latter are expected against a v3 auth api.
If OS_PROJECT_ID and OS_PROJECT_NAME are set, they will still be referred as "tenant" in Gophercloud.
If OS_PROJECT_NAME is set, it requires OS_PROJECT_ID to be set as well to handle projects not on the default domain.
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(opts)
func Authenticate ¶
func Authenticate(client *gophercloud.ProviderClient, options gophercloud.AuthOptions) error
Authenticate or re-authenticate against the most recent identity service supported at the provided endpoint.
func AuthenticateV2 ¶
func AuthenticateV2(client *gophercloud.ProviderClient, options gophercloud.AuthOptions, eo gophercloud.EndpointOpts) error
AuthenticateV2 explicitly authenticates against the identity v2 endpoint.
func AuthenticateV3 ¶
func AuthenticateV3(client *gophercloud.ProviderClient, options tokens3.AuthOptionsBuilder, eo gophercloud.EndpointOpts) error
AuthenticateV3 explicitly authenticates against the identity v3 service.
func AuthenticatedClient ¶
func AuthenticatedClient(options gophercloud.AuthOptions) (*gophercloud.ProviderClient, error)
AuthenticatedClient logs in to an OpenStack cloud found at the identity endpoint specified by the options, acquires a token, and returns a Provider Client instance that's ready to operate.
If the full path to a versioned identity endpoint was specified (example: http://example.com:5000/v3), that path will be used as the endpoint to query.
If a versionless endpoint was specified (example: http://example.com:5000/), the endpoint will be queried to determine which versions of the identity service are available, then chooses the most recent or most supported version.
Example:
ao, err := openstack.AuthOptionsFromEnv() provider, err := openstack.AuthenticatedClient(ao) client, err := openstack.NewNetworkV2(client, gophercloud.EndpointOpts{ Region: os.Getenv("OS_REGION_NAME"), })
func NewBareMetalIntrospectionV1 ¶
func NewBareMetalIntrospectionV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewBareMetalIntrospectionV1 creates a ServiceClient that may be used with the v1 bare metal introspection package.
func NewBareMetalV1 ¶
func NewBareMetalV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewBareMetalV1 creates a ServiceClient that may be used with the v1 bare metal package.
func NewBlockStorageV1 ¶
func NewBlockStorageV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewBlockStorageV1 creates a ServiceClient that may be used to access the v1 block storage service.
func NewBlockStorageV2 ¶
func NewBlockStorageV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewBlockStorageV2 creates a ServiceClient that may be used to access the v2 block storage service.
func NewBlockStorageV3 ¶
func NewBlockStorageV3(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewBlockStorageV3 creates a ServiceClient that may be used to access the v3 block storage service.
func NewCDNV1 ¶
func NewCDNV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewCDNV1 creates a ServiceClient that may be used to access the OpenStack v1 CDN service.
func NewClient ¶
func NewClient(endpoint string) (*gophercloud.ProviderClient, error)
NewClient prepares an unauthenticated ProviderClient instance. Most users will probably prefer using the AuthenticatedClient function instead.
This is useful if you wish to explicitly control the version of the identity service that's used for authentication explicitly, for example.
A basic example of using this would be:
ao, err := openstack.AuthOptionsFromEnv() provider, err := openstack.NewClient(ao.IdentityEndpoint) client, err := openstack.NewIdentityV3(provider, gophercloud.EndpointOpts{})
func NewClusteringV1 ¶
func NewClusteringV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewClusteringV1 creates a ServiceClient that may be used with the v1 clustering package.
func NewComputeV2 ¶
func NewComputeV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewComputeV2 creates a ServiceClient that may be used with the v2 compute package.
func NewContainerInfraV1 ¶
func NewContainerInfraV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewContainerInfraV1 creates a ServiceClient that may be used with the v1 container infra management package.
func NewContainerV1 ¶
func NewContainerV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewContainerV1 creates a ServiceClient that may be used with v1 container package
func NewDBV1 ¶
func NewDBV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewDBV1 creates a ServiceClient that may be used to access the v1 DB service.
func NewDNSV2 ¶
func NewDNSV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewDNSV2 creates a ServiceClient that may be used to access the v2 DNS service.
func NewIdentityV2 ¶
func NewIdentityV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewIdentityV2 creates a ServiceClient that may be used to interact with the v2 identity service.
func NewIdentityV3 ¶
func NewIdentityV3(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewIdentityV3 creates a ServiceClient that may be used to access the v3 identity service.
func NewImageServiceV2 ¶
func NewImageServiceV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewImageServiceV2 creates a ServiceClient that may be used to access the v2 image service.
func NewKeyManagerV1 ¶
func NewKeyManagerV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewKeyManagerV1 creates a ServiceClient that may be used with the v1 key manager service.
func NewLoadBalancerV2 ¶
func NewLoadBalancerV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewLoadBalancerV2 creates a ServiceClient that may be used to access the v2 load balancer service.
func NewMessagingV2 ¶
func NewMessagingV2(client *gophercloud.ProviderClient, clientID string, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewMessagingV2 creates a ServiceClient that may be used with the v2 messaging service.
func NewNetworkV2 ¶
func NewNetworkV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewNetworkV2 creates a ServiceClient that may be used with the v2 network package.
func NewObjectStorageV1 ¶
func NewObjectStorageV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewObjectStorageV1 creates a ServiceClient that may be used with the v1 object storage package.
func NewOrchestrationV1 ¶
func NewOrchestrationV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewOrchestrationV1 creates a ServiceClient that may be used to access the v1 orchestration service.
func NewPlacementV1 ¶
func NewPlacementV1(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewPlacementV1 creates a ServiceClient that may be used with the placement package.
func NewSharedFileSystemV2 ¶
func NewSharedFileSystemV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewSharedFileSystemV2 creates a ServiceClient that may be used to access the v2 shared file system service.
func NewWorkflowV2 ¶
func NewWorkflowV2(client *gophercloud.ProviderClient, eo gophercloud.EndpointOpts) (*gophercloud.ServiceClient, error)
NewWorkflowV2 creates a ServiceClient that may be used with the v2 workflow management package.
func V2EndpointURL ¶
func V2EndpointURL(catalog *tokens2.ServiceCatalog, opts gophercloud.EndpointOpts) (string, error)
V2EndpointURL discovers the endpoint URL for a specific service from a ServiceCatalog acquired during the v2 identity service.
The specified EndpointOpts are used to identify a unique, unambiguous endpoint to return. It's an error both when multiple endpoints match the provided criteria and when none do. The minimum that can be specified is a Type, but you will also often need to specify a Name and/or a Region depending on what's available on your OpenStack deployment.
func V3EndpointURL ¶
func V3EndpointURL(catalog *tokens3.ServiceCatalog, opts gophercloud.EndpointOpts) (string, error)
V3EndpointURL discovers the endpoint URL for a specific service from a Catalog acquired during the v3 identity service.
The specified EndpointOpts are used to identify a unique, unambiguous endpoint to return. It's an error both when multiple endpoints match the provided criteria and when none do. The minimum that can be specified is a Type, but you will also often need to specify a Name and/or a Region depending on what's available on your OpenStack deployment.
Types ¶
type ErrEndpointNotFound ¶
type ErrEndpointNotFound struct{ gophercloud.BaseError }
ErrEndpointNotFound is the error when no suitable endpoint can be found in the user's catalog
func (ErrEndpointNotFound) Error ¶
func (e ErrEndpointNotFound) Error() string
type ErrInvalidAvailabilityProvided ¶
type ErrInvalidAvailabilityProvided struct{ gophercloud.ErrInvalidInput }
ErrInvalidAvailabilityProvided is the error when an invalid endpoint availability is provided
func (ErrInvalidAvailabilityProvided) Error ¶
func (e ErrInvalidAvailabilityProvided) Error() string
type ErrNoAuthURL ¶
type ErrNoAuthURL struct{ gophercloud.ErrInvalidInput }
ErrNoAuthURL is the error when the OS_AUTH_URL environment variable is not found
func (ErrNoAuthURL) Error ¶
func (e ErrNoAuthURL) Error() string
type ErrNoPassword ¶
type ErrNoPassword struct{ gophercloud.ErrInvalidInput }
ErrNoPassword is the error when the OS_PASSWORD environment variable is not found
func (ErrNoPassword) Error ¶
func (e ErrNoPassword) Error() string
type ErrNoUsername ¶
type ErrNoUsername struct{ gophercloud.ErrInvalidInput }
ErrNoUsername is the error when the OS_USERNAME environment variable is not found
func (ErrNoUsername) Error ¶
func (e ErrNoUsername) Error() string
Directories ¶
Path | Synopsis |
---|---|
containerinfra
|
|
apiversions
Package apiversions provides information and interaction with the different API versions for the Container Infra service, code-named Magnum.
|
Package apiversions provides information and interaction with the different API versions for the Container Infra service, code-named Magnum. |
v1/clusters
Package clusters contains functionality for working with Magnum Cluster resources.
|
Package clusters contains functionality for working with Magnum Cluster resources. |
v1/nodegroups
Package nodegroups provides methods for interacting with the Magnum node group API.
|
Package nodegroups provides methods for interacting with the Magnum node group API. |
identity
|
|
v2/tenants
Package tenants provides information and interaction with the tenants API resource for the OpenStack Identity service.
|
Package tenants provides information and interaction with the tenants API resource for the OpenStack Identity service. |
v2/tokens
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service.
|
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service. |
v3/extensions/trusts
Package trusts enables management of OpenStack Identity Trusts.
|
Package trusts enables management of OpenStack Identity Trusts. |
v3/tokens
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service.
|
Package tokens provides information and interaction with the token API resource for the OpenStack Identity service. |
orchestration
|
|
v1/stackresources
Package stackresources provides operations for working with stack resources.
|
Package stackresources provides operations for working with stack resources. |
v1/stacks
Package stacks provides operation for working with Heat stacks.
|
Package stacks provides operation for working with Heat stacks. |