openstack

package
v0.3.61 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrPEMDecode is raised when the PEM decode failed for some reason.
	ErrPEMDecode = errors.New("PEM decode error")

	// ErrPEMType is raised when the encounter the wrong PEM type, e.g. PKCS#1.
	ErrPEMType = errors.New("PEM type unsupported")

	// ErrKeyType is raised when we encounter an unsupported key type.
	ErrKeyType = errors.New("key type unsupported")
)
View Source
var (
	ErrResourceNotFound = goerrors.New("resource not found")
)

Functions

This section is empty.

Types

type Openstack

type Openstack struct {
	// contains filtered or unexported fields
}

Openstack provides an HTTP handler for Openstack resources.

func New

func New(options *Options, authenticator *authorization.Authenticator) (*Openstack, error)

New returns a new initialized Openstack handler.

func (*Openstack) ApplicationCredentialRoles

func (o *Openstack) ApplicationCredentialRoles() []string

func (*Openstack) BlockStorageClient

func (o *Openstack) BlockStorageClient(r *http.Request) (*openstack.BlockStorageClient, error)

func (*Openstack) ComputeClient

func (o *Openstack) ComputeClient(r *http.Request) (*openstack.ComputeClient, error)

func (*Openstack) CreateApplicationCredential

func (o *Openstack) CreateApplicationCredential(r *http.Request, name string, roles []string) (*applicationcredentials.ApplicationCredential, error)

func (*Openstack) CreateServerGroup

func (o *Openstack) CreateServerGroup(r *http.Request, name string) (*servergroups.ServerGroup, error)

func (*Openstack) DeleteApplicationCredential

func (o *Openstack) DeleteApplicationCredential(r *http.Request, name string) error

func (*Openstack) GetApplicationCredential

func (o *Openstack) GetApplicationCredential(r *http.Request, name string) (*applicationcredentials.ApplicationCredential, error)

func (*Openstack) GetFlavor

func (o *Openstack) GetFlavor(r *http.Request, name string) (*generated.OpenstackFlavor, error)

GetFlavor does a list and find, while inefficient, it does do image filtering.

func (*Openstack) GetImage

func (o *Openstack) GetImage(r *http.Request, name string) (*generated.OpenstackImage, error)

GetImage does a list and find, while inefficient, it does do image filtering.

func (*Openstack) GetServerGroup

func (o *Openstack) GetServerGroup(r *http.Request, name string) (*servergroups.ServerGroup, error)

func (*Openstack) IdentityClient

func (o *Openstack) IdentityClient(r *http.Request) (*openstack.IdentityClient, error)

func (*Openstack) ImageClient

func (o *Openstack) ImageClient(r *http.Request) (*openstack.ImageClient, error)

func (*Openstack) ListAvailabilityZonesBlockStorage

func (o *Openstack) ListAvailabilityZonesBlockStorage(r *http.Request) (generated.OpenstackAvailabilityZones, error)

func (*Openstack) ListAvailabilityZonesCompute

func (o *Openstack) ListAvailabilityZonesCompute(r *http.Request) (generated.OpenstackAvailabilityZones, error)

func (*Openstack) ListAvailableProjects

func (o *Openstack) ListAvailableProjects(r *http.Request) (generated.OpenstackProjects, error)

ListAvailableProjects lists projects that the token has roles associated with.

func (*Openstack) ListExternalNetworks

func (o *Openstack) ListExternalNetworks(r *http.Request) (interface{}, error)

func (*Openstack) ListFlavors

func (o *Openstack) ListFlavors(r *http.Request) (generated.OpenstackFlavors, error)

func (*Openstack) ListImages

func (o *Openstack) ListImages(r *http.Request) (generated.OpenstackImages, error)

func (*Openstack) ListKeyPairs

func (o *Openstack) ListKeyPairs(r *http.Request) (generated.OpenstackKeyPairs, error)

func (*Openstack) NetworkClient

func (o *Openstack) NetworkClient(r *http.Request) (*openstack.NetworkClient, error)

type Options

type Options struct {
	ComputeOptions    openstack.ComputeOptions
	Key               PublicKeyVar
	ServerGroupPolicy string
	Properties        []string
	// applicationCredentialRoles sets the roles an application credential
	// is granted on creation.
	ApplicationCredentialRoles []string
}

func (*Options) AddFlags

func (o *Options) AddFlags(f *pflag.FlagSet)

type PublicKeyVar

type PublicKeyVar struct {
	// contains filtered or unexported fields
}

PublicKeyVar contains a public key.

func (*PublicKeyVar) Set

func (v *PublicKeyVar) Set(s string) error

Set accepts a base64 encoded PEM public key and tries to decode it.

func (*PublicKeyVar) String

func (v *PublicKeyVar) String() string

func (*PublicKeyVar) Type

func (v *PublicKeyVar) Type() string

Jump to

Keyboard shortcuts

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