gcore

package
v0.6.28 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MPL-2.0 Imports: 7 Imported by: 0

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 APITokenClientServiceWithDebug

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

func APITokenClientWithDebug

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

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
ai
apitoken
apptemplate
baremetal
ddos
v1/ddos/testing
ddos unit tests
ddos unit tests
faas
file_share
v1/file_shares/testing
file shares unit tests
file shares unit tests
flavor
v1/flavors
Package flavors contains functionality for working GCLoud flavors API resources
Package flavors contains functionality for working GCLoud 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 GCLoud keypairs API resources
Package keypair contains functionality for working GCLoud 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 GCLoud loadbalancers API resources
Package loadbalancer contains functionality for working GCLoud loadbalancers API resources
v1/loadbalancers/testing
loadbalancers unit tests
loadbalancers unit tests
network
v1/availablenetworks
Package network contains functionality for working GCLoud networks API resources
Package network contains functionality for working GCLoud 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 GCLoud networks API resources
Package network contains functionality for working GCLoud 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
users
volume
v1/volumes
Package volume contains functionality for working GCLoud volumes API resources
Package volume contains functionality for working GCLoud 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