gcore

package
v0.5.35 Latest Latest
Warning

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

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

Documentation

Overview

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

Example of Creating a Gcore Magnum Cluster Client

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APITokenClient added in v0.4.32

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

func APITokenClientServiceWithDebug added in v0.4.32

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

func APITokenClientWithDebug added in v0.4.32

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

func AuthClientServiceWithDebug

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

func AuthOptionsFromEnv

func AuthOptionsFromEnv() (gcorecloud.AuthOptions, error)

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

The following variables provide sources of truth: GCLOUD_USERNAME, GCLOUD_PASSWORD, GCLOUD_AUTH_URL

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

func Authenticate

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

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

func AuthenticatedClient

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

AuthenticatedClient logs in to an GCore 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 := gcore.AuthOptionsFromEnv()
provider, err := gcore.AuthenticatedClient(ao)
client, err := gcore.NewMagnumV1(provider, gcorecloud.EndpointOpts{})

func AuthenticatedClientWithDebug

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

func EndpointOptionsFromEnv

func EndpointOptionsFromEnv() (gcorecloud.EndpointOpts, error)

func NewGCloudAPITokenAPISettingsFromEnv added in v0.4.32

func NewGCloudAPITokenAPISettingsFromEnv() (*gcorecloud.APITokenAPISettings, error)

func NewGCloudPlatformAPISettingsFromEnv

func NewGCloudPlatformAPISettingsFromEnv() (*gcorecloud.PasswordAPISettings, error)

func NewGCloudTokenAPISettingsFromEnv

func NewGCloudTokenAPISettingsFromEnv() (*gcorecloud.TokenAPISettings, error)

func NewGCoreClient

func NewGCoreClient(endpoint string) (*gcorecloud.ProviderClient, error)

NewGCoreClient 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 NewIdentity

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

func NewK8sV1

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

func TokenClient

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

func TokenClientServiceWithDebug

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

func TokenClientWithDebug

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

func TokenOptionsFromEnv

func TokenOptionsFromEnv() (gcorecloud.TokenOptions, error)

Types

type ErrEndpointNotFound

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

ErrInvalidAvailabilityProvided is the error when an invalid endpoint availability is provided

func (ErrInvalidAvailabilityProvided) Error

type ErrNoAuthURL

type ErrNoAuthURL struct{ gcorecloud.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{ gcorecloud.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{ gcorecloud.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
apitoken
apptemplate
baremetal
ddos
faas
flavor
floatingip
heat
identity
image
instance
k8s
keypair
keystone
laas
lifecyclepolicy
limit
loadbalancer
network
port
project
quota
region
regionaccess
reservedfixedip
router
schedule
secret
securitygroup
servergroup
snapshot
subnet
task
users
volume

Jump to

Keyboard shortcuts

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