edgecenter

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MPL-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package edgecenter contains resources for the individual projects. It also includes functions to authenticate to an EdgeCloud cloud and for provisioning various service-level clients.

Example of Creating a EdgeCenter Magnum Cluster Client

ao, err := edgecenter.AuthOptionsFromEnv()
provider, err := edgecenter.AuthenticatedClient(ao)
client, err := edgecenter.MagnumClusterV1(client, edgecloud.EndpointOpts{
})

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APITokenClient

func APITokenClient(options edgecloud.APITokenOptions) (*edgecloud.ProviderClient, error)

func APITokenClientServiceWithDebug

func APITokenClientServiceWithDebug(options edgecloud.APITokenOptions, eo edgecloud.EndpointOpts, debug bool) (*edgecloud.ServiceClient, error)

func APITokenClientWithDebug

func APITokenClientWithDebug(options edgecloud.APITokenOptions, debug bool) (*edgecloud.ProviderClient, error)

func AuthClientServiceWithDebug

func AuthClientServiceWithDebug(options edgecloud.AuthOptions, eo edgecloud.EndpointOpts, debug bool) (*edgecloud.ServiceClient, error)

func AuthOptionsFromEnv

func AuthOptionsFromEnv() (edgecloud.AuthOptions, error)

AuthOptionsFromEnv fills out an identity.AuthOptions structure with the settings found on environment variables.

The following variables provide sources of truth: EC_CLOUD_USERNAME, EC_CLOUD_PASSWORD, EC_CLOUD_AUTH_URL

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

func Authenticate

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

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

func AuthenticatedClient

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

AuthenticatedClient logs in to an Edgecenter cloud found at the identity endpoint specified by the options, acquires a token, and returns a Provider Client instance that's ready to operate.

Example:

ao, err := edgecenter.AuthOptionsFromEnv()
provider, err := edgecenter.AuthenticatedClient(ao)
client, err := edgecenter.NewMagnumV1(provider, edgecloud.EndpointOpts{})

func AuthenticatedClientWithDebug

func AuthenticatedClientWithDebug(options edgecloud.AuthOptions, debug bool) (*edgecloud.ProviderClient, error)

func EndpointOptionsFromEnv

func EndpointOptionsFromEnv() (edgecloud.EndpointOpts, error)

func NewECClient

func NewECClient(endpoint string) (*edgecloud.ProviderClient, error)

NewECClient 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.

func NewECCloudAPITokenAPISettingsFromEnv

func NewECCloudAPITokenAPISettingsFromEnv() (*edgecloud.APITokenAPISettings, error)

func NewECCloudPlatformAPISettingsFromEnv

func NewECCloudPlatformAPISettingsFromEnv() (*edgecloud.PasswordAPISettings, error)

func NewEdgeCloudTokenAPISettingsFromEnv

func NewEdgeCloudTokenAPISettingsFromEnv() (*edgecloud.TokenAPISettings, error)

func NewIdentity

NewIdentity creates a ServiceClient that may be used to interact with the edgecenter identity auth service.

func NewK8sV1

func NewK8sV1(provider *edgecloud.ProviderClient, region int, project int) (*edgecloud.ServiceClient, error)

func TokenClient

func TokenClient(options edgecloud.TokenOptions) (*edgecloud.ProviderClient, error)

func TokenClientServiceWithDebug

func TokenClientServiceWithDebug(options edgecloud.TokenOptions, eo edgecloud.EndpointOpts, debug bool) (*edgecloud.ServiceClient, error)

func TokenClientWithDebug

func TokenClientWithDebug(options edgecloud.TokenOptions, debug bool) (*edgecloud.ProviderClient, error)

func TokenOptionsFromEnv

func TokenOptionsFromEnv() (edgecloud.TokenOptions, error)

Types

type EndpointNotFoundError added in v0.1.4

type EndpointNotFoundError struct{ edgecloud.BaseError }

EndpointNotFoundError is the error when no suitable endpoint can be found in the user's catalog.

func (EndpointNotFoundError) Error added in v0.1.4

func (e EndpointNotFoundError) Error() string

type InvalidAvailabilityProvidedError added in v0.1.4

type InvalidAvailabilityProvidedError struct{ edgecloud.InvalidInputError }

InvalidAvailabilityProvidedError is the error when an invalid endpoint availability is provided.

func (InvalidAvailabilityProvidedError) Error added in v0.1.4

type NoAuthURLError added in v0.1.4

type NoAuthURLError struct{ edgecloud.InvalidInputError }

NoAuthURLError is the error when the OS_AUTH_URL environment variable is not found.

func (NoAuthURLError) Error added in v0.1.4

func (e NoAuthURLError) Error() string

type NoPasswordError added in v0.1.4

type NoPasswordError struct{ edgecloud.InvalidInputError }

NoPasswordError is the error when the OS_PASSWORD environment variable is not found.

func (NoPasswordError) Error added in v0.1.4

func (e NoPasswordError) Error() string

type NoUsernameError added in v0.1.4

type NoUsernameError struct{ edgecloud.InvalidInputError }

NoUsernameError is the error when the OS_USERNAME environment variable is not found.

func (NoUsernameError) Error added in v0.1.4

func (e NoUsernameError) Error() string

Directories

Path Synopsis
apitoken
apptemplate
baremetal
flavor
v1/flavors
Package flavors contains functionality for working EdgeCloud flavors API resources
Package flavors contains functionality for working EdgeCloud flavors API resources
v1/flavors/testing
flavors unit tests
flavors unit tests
floatingip
heat
v1/stack/resources/testing
resources unit tests
resources unit tests
identity
tokens/testing
tokens unit tests
tokens unit tests
image
instance
v1/instances/testing
instances unit tests
instances unit tests
k8s
keypair
v1/keypairs
Package keypair contains functionality for working EdgeCloud keypairs API resources
Package keypair contains functionality for working EdgeCloud keypairs API resources
v1/keypairs/testing
keypairs unit tests
keypairs unit tests
keystone
laas
lifecyclepolicy
limit
loadbalancer
v1/lbpools/testing
loadbalancers unit tests
loadbalancers unit tests
v1/listeners/testing
listeners unit tests
listeners unit tests
v1/loadbalancers
Package loadbalancer contains functionality for working EdgeCloud loadbalancers API resources
Package loadbalancer contains functionality for working EdgeCloud loadbalancers API resources
v1/loadbalancers/testing
loadbalancers unit tests
loadbalancers unit tests
network
v1/availablenetworks
Package network contains functionality for working EdgeCloud networks API resources
Package network contains functionality for working EdgeCloud networks API resources
v1/availablenetworks/testing
networks unit tests
networks unit tests
v1/extensions/testing
extensions unit tests
extensions unit tests
v1/networks
Package network contains functionality for working EdgeCloud networks API resources
Package network contains functionality for working EdgeCloud networks API resources
v1/networks/testing
networks unit tests
networks unit tests
port
project
quota
region
regionaccess
reservedfixedip
router
v1/routers/testing
routers unit tests
routers unit tests
schedule
secret
securitygroup
servergroup
snapshot
subnet
v1/subnets/testing
subnets unit tests
subnets unit tests
task
v1/tasks/testing
tasks unit tests
tasks unit tests
volume
v1/volumes
Package volume contains functionality for working EdgeCloud volumes API resources
Package volume contains functionality for working EdgeCloud volumes API resources
v1/volumes/testing
volumes unit tests
volumes unit tests

Jump to

Keyboard shortcuts

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