openstack

package
v2.8.0 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountKey

type AccountKey struct {
	AuthURL           string
	Username          string
	Password          string
	ProjectID         string
	ProjectName       string
	UserDomainName    string
	ProjectDomainName string
	RegionName        string
}

AccountKey is a OpenStack account key.

func AccountKeyFromURI

func AccountKeyFromURI(serviceAccountURI string) (AccountKey, error)

AccountKeyFromURI parses ServiceAccountKey from URI.

func (AccountKey) CloudINI

func (k AccountKey) CloudINI() CloudINI

CloudINI converts the AccountKey into a CloudINI.

func (AccountKey) ToCloudServiceAccountURI

func (k AccountKey) ToCloudServiceAccountURI() string

ToCloudServiceAccountURI converts the AccountKey into a cloud service account URI.

type Cloud

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

Cloud is the metadata client for OpenStack.

func New

func New(ctx context.Context) (*Cloud, error)

New creates a new OpenStack metadata client.

func (*Cloud) GetLoadBalancerEndpoint

func (c *Cloud) GetLoadBalancerEndpoint(ctx context.Context) (string, error)

GetLoadBalancerEndpoint returns the endpoint of the load balancer. For OpenStack, the load balancer is a floating ip attached to a control plane node. TODO(malt3): Rewrite to use real load balancer once it is available.

func (*Cloud) GetNetworkIDs added in v2.8.0

func (c *Cloud) GetNetworkIDs(ctx context.Context) ([]string, error)

GetNetworkIDs returns the IDs of the networks the current instance is part of. This method is OpenStack specific.

func (*Cloud) InitSecretHash

func (c *Cloud) InitSecretHash(ctx context.Context) ([]byte, error)

InitSecretHash retrieves the InitSecretHash of the current instance.

func (*Cloud) List

func (c *Cloud) List(ctx context.Context) ([]metadata.InstanceMetadata, error)

List returns the metadata of all instances belonging to the same Constellation cluster.

func (*Cloud) Self

Self returns the metadata of the current instance.

func (*Cloud) UID

func (c *Cloud) UID(ctx context.Context) (string, error)

UID retrieves the UID of the constellation.

type CloudINI

type CloudINI struct {
	AuthURL          string `` /* 141-byte string literal not displayed */
	Username         string `name:"os-userName" value:"optional" dependsOn:"os-password"`
	Password         string `name:"os-password" value:"optional" dependsOn:"os-domainID|os-domainName,os-projectID|os-projectName,os-userID|os-userName"`
	ProjectID        string `gcfg:"project-id" mapstructure:"project-id" name:"os-projectID" value:"optional" dependsOn:"os-password|os-clientCertPath"`
	TenantName       string `` /* 127-byte string literal not displayed */
	UserDomainName   string `gcfg:"user-domain-name" mapstructure:"user-domain-name" name:"os-userDomainName" value:"optional"`
	TenantDomainName string `gcfg:"tenant-domain-name" mapstructure:"project-domain-name" name:"os-projectDomainName" value:"optional"`
	Region           string `name:"os-region"`
}

CloudINI is a struct that represents the cloud.ini file used by OpenStack k8s deployments.

func (CloudINI) CinderCSIConfiguration added in v2.8.0

func (i CloudINI) CinderCSIConfiguration() string

CinderCSIConfiguration returns the string representation of the CloudINI subset cinder expects.

func (CloudINI) FullConfiguration added in v2.8.0

func (i CloudINI) FullConfiguration() string

FullConfiguration returns the string representation of the full CloudINI.

func (CloudINI) YawolConfiguration added in v2.8.0

func (i CloudINI) YawolConfiguration() string

YawolConfiguration returns the string representation of the CloudINI subset yawol expects.

Jump to

Keyboard shortcuts

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