ecl

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2019 License: Apache-2.0 Imports: 6 Imported by: 4

Documentation

Overview

Package ecl contains resources for the individual Enterprise Cloud projects supported in eclcloud. It also includes functions to authenticate to an Enterprise cloud and for provisioning various service-level clients.

Example of Creating a Service Client

ao, err := ecl.AuthOptionsFromEnv()
provider, err := ecl.AuthenticatedClient(ao)
client, err := ecl.NewNetworkV2(client, eclcloud.EndpointOpts{
	Region: os.Getenv("OS_REGION_NAME"),
})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthOptionsFromEnv

func AuthOptionsFromEnv() (eclcloud.AuthOptions, error)

AuthOptionsFromEnv fills out an identity.AuthOptions structure with the settings found on the various Enterprise Cloud OS_* environment variables.

The following variables provide sources of truth: OS_AUTH_URL, OS_USERNAME, OS_PASSWORD, OS_TENANT_ID, and OS_TENANT_NAME.

Of these, OS_USERNAME, OS_PASSWORD, and OS_AUTH_URL must have settings, or an error will result. OS_TENANT_ID, OS_TENANT_NAME, OS_PROJECT_ID, and OS_PROJECT_NAME are optional.

OS_TENANT_ID and OS_TENANT_NAME are mutually exclusive to OS_PROJECT_ID and OS_PROJECT_NAME. If OS_PROJECT_ID and OS_PROJECT_NAME are set, they will still be referred as "tenant" in eclcloud.

To use this function, first set the OS_* environment variables (for example, by sourcing an `openrc` file), then:

opts, err := ecl.AuthOptionsFromEnv()
provider, err := ecl.AuthenticatedClient(opts)

func Authenticate

func Authenticate(client *eclcloud.ProviderClient, options eclcloud.AuthOptions) error

Authenticate or re-authenticate against the most recent identity service supported at the provided endpoint.

func AuthenticateV3

func AuthenticateV3(client *eclcloud.ProviderClient, options tokens3.AuthOptionsBuilder, eo eclcloud.EndpointOpts) error

AuthenticateV3 explicitly authenticates against the identity v3 service.

func AuthenticatedClient

func AuthenticatedClient(options eclcloud.AuthOptions) (*eclcloud.ProviderClient, error)

AuthenticatedClient logs in to an Enterprise 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 := ecl.AuthOptionsFromEnv()
provider, err := ecl.AuthenticatedClient(ao)
client, err := ecl.NewNetworkV2(client, eclcloud.EndpointOpts{
	Region: os.Getenv("OS_REGION_NAME"),
})

func NewClient

func NewClient(endpoint string) (*eclcloud.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 := ecl.AuthOptionsFromEnv()
provider, err := ecl.NewClient(ao.IdentityEndpoint)
client, err := ecl.NewIdentityV3(provider, eclcloud.EndpointOpts{})

func NewClusteringV1

func NewClusteringV1(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewClusteringV1 creates a ServiceClient that may be used with the v1 clustering package.

func NewComputeV2

NewComputeV2 creates a ServiceClient that may be used with the v2 compute package.

func NewComputeVolumeV2

func NewComputeVolumeV2(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewComputeVolumeV2 creates a ServiceClient that may be used to access the v2 block storage service.

func NewContainerInfraV1

func NewContainerInfraV1(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewContainerInfraV1 creates a ServiceClient that may be used with the v1 container infra management package.

func NewContainerV1

NewContainerV1 creates a ServiceClient that may be used with v1 container package

func NewDBV1

NewDBV1 creates a ServiceClient that may be used to access the v1 DB service.

func NewDNSV2

NewDNSV2 creates a ServiceClient that may be used to access the v2 DNS service.

func NewIdentityV3

NewIdentityV3 creates a ServiceClient that may be used to access the v3 identity service.

func NewImageServiceV2

func NewImageServiceV2(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewImageServiceV2 creates a ServiceClient that may be used to access the v2 image service.

func NewKeyManagerV1

func NewKeyManagerV1(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewKeyManagerV1 creates a ServiceClient that may be used with the v1 key manager service.

func NewLoadBalancerV2

func NewLoadBalancerV2(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewLoadBalancerV2 creates a ServiceClient that may be used to access the v2 load balancer service.

func NewMessagingV2

func NewMessagingV2(client *eclcloud.ProviderClient, clientID string, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewMessagingV2 creates a ServiceClient that may be used with the v2 messaging service.

func NewNetworkV2

NewNetworkV2 creates a ServiceClient that may be used with the v2 network package.

func NewObjectStorageV1

func NewObjectStorageV1(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewObjectStorageV1 creates a ServiceClient that may be used with the v1 object storage package.

func NewOrchestrationV1

func NewOrchestrationV1(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewOrchestrationV1 creates a ServiceClient that may be used to access the v1 orchestration service.

func NewSSSV1

NewSSSV1 creates ServiceClient that may be used to access the v1 SSS API service.

func NewSSSV1Forced

func NewSSSV1Forced(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts, sssURL string) (*eclcloud.ServiceClient, error)

NewSSSV1 creates ServiceClient that may be used to access the v1 SSS API service with Unscoped Token.

func NewSecurityOrderV1 added in v1.3.0

func NewSecurityOrderV1(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewSecurityOrderV1 creates a ServiceClient that may be used to access the v1 Security Order API service.

func NewSecurityPortalV1 added in v1.3.0

func NewSecurityPortalV1(client *eclcloud.ProviderClient, eo eclcloud.EndpointOpts) (*eclcloud.ServiceClient, error)

NewSecurityPortalV1 creates a ServiceClient that may be used to access the v1 Security Portal API service.

func NewStorageV1

NewStorageV1 creates ServiceClient that may be used to access the v1 storage API service.

func NewVNAV1 added in v1.2.0

NewVNAV1 creates a ServiceClient that may be used with the v1 virtual network appliance management package.

func NewWorkflowV2

NewWorkflowV2 creates a ServiceClient that may be used with the v2 workflow management package.

func V3EndpointURL

func V3EndpointURL(catalog *tokens3.ServiceCatalog, opts eclcloud.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 Enterprise Cloud deployment.

Types

type ErrEndpointNotFound

type ErrEndpointNotFound struct{ eclcloud.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{ eclcloud.ErrInvalidInput }

ErrInvalidAvailabilityProvided is the error when an invalid endpoint availability is provided

func (ErrInvalidAvailabilityProvided) Error

type ErrMultipleMatchingEndpointsV3

type ErrMultipleMatchingEndpointsV3 struct {
	eclcloud.BaseError
	Endpoints []tokens3.Endpoint
}

ErrMultipleMatchingEndpointsV3 is the error when more than one endpoint for the given options is found in the v3 catalog

func (ErrMultipleMatchingEndpointsV3) Error

type ErrNoAuthURL

type ErrNoAuthURL struct{ eclcloud.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{ eclcloud.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{ eclcloud.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
compute
v2/extensions/availabilityzones
Package availabilityzones provides the ability to get lists and detailed availability zone information and to extend a server result with availability zone information.
Package availabilityzones provides the ability to get lists and detailed availability zone information and to extend a server result with availability zone information.
v2/extensions/availabilityzones/testing
availabilityzones unittests
availabilityzones unittests
v2/extensions/bootfromvolume
Package bootfromvolume extends a server create request with the ability to specify block device options.
Package bootfromvolume extends a server create request with the ability to specify block device options.
v2/extensions/bootfromvolume/testing
Package testing contains bootfromvolume unit tests
Package testing contains bootfromvolume unit tests
v2/extensions/keypairs
Package keypairs provides the ability to manage key pairs as well as create servers with a specified key pair.
Package keypairs provides the ability to manage key pairs as well as create servers with a specified key pair.
v2/extensions/keypairs/testing
Package testing contains keypairs unit tests
Package testing contains keypairs unit tests
v2/extensions/startstop
Package startstop provides functionality to start and stop servers that have been provisioned by the Enterprise Cloud Compute service.
Package startstop provides functionality to start and stop servers that have been provisioned by the Enterprise Cloud Compute service.
v2/extensions/startstop/testing
Package testing contains startstop unit tests
Package testing contains startstop unit tests
v2/extensions/volumeattach
Package volumeattach provides the ability to attach and detach volumes from servers.
Package volumeattach provides the ability to attach and detach volumes from servers.
v2/extensions/volumeattach/testing
Package testing contains volumeattach unit tests
Package testing contains volumeattach unit tests
v2/flavors
Package flavors provides information and interaction with the flavor API in the Enterprise Cloud Compute service.
Package flavors provides information and interaction with the flavor API in the Enterprise Cloud Compute service.
v2/images
Package images provides information and interaction with the images through the Enterprise Cloud Compute service.
Package images provides information and interaction with the images through the Enterprise Cloud Compute service.
v2/servers
Package servers provides information and interaction with the server API resource in the Enterprise Cloud Compute service.
Package servers provides information and interaction with the server API resource in the Enterprise Cloud Compute service.
computevolume
extensions/volumeactions
Package volumeactions provides information and interaction with volumes in the Enterprise Cloud Block Storage service.
Package volumeactions provides information and interaction with volumes in the Enterprise Cloud Block Storage service.
extensions/volumeactions/testing
volumeactions unit tests
volumeactions unit tests
v2/volumes
Package volumes provides information and interaction with volumes in the Enterprise Cloud Block Storage service.
Package volumes provides information and interaction with volumes in the Enterprise Cloud Block Storage service.
v2/volumes/testing
volumes_v2 unittest
volumes_v2 unittest
db
v1/configurations
Package configurations provides information and interaction with the configuration API resource in the Rackspace Database service.
Package configurations provides information and interaction with the configuration API resource in the Rackspace Database service.
v1/databases
Package flavors provides information and interaction with the database API resource in the Enterprise Cloud Database service.
Package flavors provides information and interaction with the database API resource in the Enterprise Cloud Database service.
v1/datastores
Package datastores provides information and interaction with the datastore API resource in the Rackspace Database service.
Package datastores provides information and interaction with the datastore API resource in the Rackspace Database service.
v1/instances
Package instances provides information and interaction with the instance API resource in the Enterprise Cloud Database service.
Package instances provides information and interaction with the instance API resource in the Enterprise Cloud Database service.
v1/users
Package users provides information and interaction with the user API resource in the Enterprise Cloud Database service.
Package users provides information and interaction with the user API resource in the Enterprise Cloud Database service.
dns
v2/recordsets
Package recordsets provides information and interaction with the zone API resource for the Enterprise Cloud DNS service.
Package recordsets provides information and interaction with the zone API resource for the Enterprise Cloud DNS service.
v2/recordsets/testing
recordsets unit tests
recordsets unit tests
v2/zones
Package zones provides information and interaction with the zone API resource for the Enterprise Cloud DNS service.
Package zones provides information and interaction with the zone API resource for the Enterprise Cloud DNS service.
v2/zones/testing
zones unit tests
zones unit tests
identity
v3/endpoints
Package endpoints provides information and interaction with the service endpoints API resource in the Enterprise Cloud Identity service.
Package endpoints provides information and interaction with the service endpoints API resource in the Enterprise Cloud Identity service.
v3/groups
Package groups manages and retrieves Groups in the Enterprise Cloud Identity Service.
Package groups manages and retrieves Groups in the Enterprise Cloud Identity Service.
v3/projects
Package projects manages and retrieves Projects in the Enterprise Cloud Identity Service.
Package projects manages and retrieves Projects in the Enterprise Cloud Identity Service.
v3/roles
Package roles provides information and interaction with the roles API resource for the Enterprise Cloud Identity service.
Package roles provides information and interaction with the roles API resource for the Enterprise Cloud Identity service.
v3/services
Package services provides information and interaction with the services API resource for the Enterprise Cloud Identity service.
Package services provides information and interaction with the services API resource for the Enterprise Cloud Identity service.
v3/tokens
Package tokens provides information and interaction with the token API resource for the Enterprise Cloud Identity service.
Package tokens provides information and interaction with the token API resource for the Enterprise Cloud Identity service.
v3/users
Package users manages and retrieves Users in the Enterprise Cloud Identity Service.
Package users manages and retrieves Users in the Enterprise Cloud Identity Service.
imagestorage
v2/imagedata
Package imagedata enables management of image data.
Package imagedata enables management of image data.
v2/imagedata/testing
imagedata unit tests
imagedata unit tests
v2/images
Package images enables management and retrieval of images from the Enterprise Cloud Image Service.
Package images enables management and retrieval of images from the Enterprise Cloud Image Service.
v2/images/testing
Package testing contains images unit tests
Package testing contains images unit tests
v2/members/testing
members unit tests
members unit tests
network
v2/common_function_gateways
Package common_function_gateways contains functionality for working with ECL Commnon Function Gateway resources.
Package common_function_gateways contains functionality for working with ECL Commnon Function Gateway resources.
v2/common_function_gateways/testing
Package testing contains common function gateways unit tests
Package testing contains common function gateways unit tests
v2/gateway_interfaces/testing
gateway_interfaces unit tests
gateway_interfaces unit tests
v2/internet_gateways/testing
internet_gateways unit tests
internet_gateways unit tests
v2/networks
Package networks contains functionality for working with Neutron network resources.
Package networks contains functionality for working with Neutron network resources.
v2/networks/testing
ports unit tests
ports unit tests
v2/ports
Package ports contains functionality for working with Neutron port resources.
Package ports contains functionality for working with Neutron port resources.
v2/ports/testing
ports unit tests
ports unit tests
v2/public_ips/testing
public_ips unit tests
public_ips unit tests
v2/static_routes/testing
public_ips unit tests
public_ips unit tests
v2/subnets
Package subnets contains functionality for working with Neutron subnet resources.
Package subnets contains functionality for working with Neutron subnet resources.
v2/subnets/testing
ports unit tests
ports unit tests
security_order
v1/host_based
Package host_based contains Host Based Security functionality.
Package host_based contains Host Based Security functionality.
v1/host_based/testing
Package testing contains host based security unittests
Package testing contains host based security unittests
v1/network_based_device_ha
Package network_based_device_ha contains HA device functionality on security.
Package network_based_device_ha contains HA device functionality on security.
v1/network_based_device_ha/testing
Package testing contains network based security HA device unittests
Package testing contains network based security HA device unittests
v1/network_based_device_single
Package network_based_device_single contains single device functionality on security.
Package network_based_device_single contains single device functionality on security.
v1/network_based_device_single/testing
Package testing contains network based security single device unittests
Package testing contains network based security single device unittests
v1/service_order_status
Package service_order_status contains order management functionality on security
Package service_order_status contains order management functionality on security
v1/service_order_status/testing
Package testing contains service order status unit tests
Package testing contains service order status unit tests
security_portal
v1/device_interfaces
Package device_interfaces contains device management functionality in security portal API
Package device_interfaces contains device management functionality in security portal API
v1/device_interfaces/testing
Package testing contains device interfaces unit tests
Package testing contains device interfaces unit tests
v1/devices
Package devices contains device management functionality in security portal API
Package devices contains device management functionality in security portal API
v1/devices/testing
Package testing contains devices unit tests
Package testing contains devices unit tests
v1/ha_ports
Package ha_ports contains port management functionality in security portal API
Package ha_ports contains port management functionality in security portal API
v1/ha_ports/testing
Package testing contains ports unit tests
Package testing contains ports unit tests
v1/ports
Package ports contains port management functionality in security portal API
Package ports contains port management functionality in security portal API
v1/ports/testing
Package testing contains ports unit tests
Package testing contains ports unit tests
v1/processes
Package process contains port management functionality on security
Package process contains port management functionality on security
v1/processes/testing
Package testing contains processes unit tests
Package testing contains processes unit tests
sss
v1/tenants
Package projects manages and retrieves Projects in the ECL SSS Service.
Package projects manages and retrieves Projects in the ECL SSS Service.
v1/tenants/testing
sss tenant unit tests
sss tenant unit tests
v1/users
Package users contains user management functionality on SSS
Package users contains user management functionality on SSS
v1/users/testing
sss user unit tests
sss user unit tests
storage
v1/virtualstorages
Package virtualstorages provides information and interaction with virtualstorage in the Enterprise Cloud Block Storage service.
Package virtualstorages provides information and interaction with virtualstorage in the Enterprise Cloud Block Storage service.
v1/virtualstorages/testing
Package testing contains virtual storage unit tests
Package testing contains virtual storage unit tests
v1/volumes
Package volume provides information and interaction with volume in the Storage service.
Package volume provides information and interaction with volume in the Storage service.
v1/volumes/testing
Package testing contains volume unit tests
Package testing contains volume unit tests
v1/volumetypes/testing
Package testing contains volume type unit tests
Package testing contains volume type unit tests
vna
v1/appliances
Package appliances contains functionality for working with ECL Commnon Function Gateway resources.
Package appliances contains functionality for working with ECL Commnon Function Gateway resources.
v1/appliances/testing
Package testing contains virtual network appliance unit tests
Package testing contains virtual network appliance unit tests

Jump to

Keyboard shortcuts

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