helpers

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const TempUserName = "TemporaryUser"

Variables

This section is empty.

Functions

func CreateDomainUnderParent

func CreateDomainUnderParent(csClient *cloudstack.CloudStackClient, parentID string, domainName string) (string, error)

CreateDomainUnderParent creates a domain as a sub-domain of the passed parent.

func DeleteDomain

func DeleteDomain(csClient *cloudstack.CloudStackClient, domainID string) error

DeleteDomain deletes a domain by ID.

func GetDomainByPath

func GetDomainByPath(csClient *cloudstack.CloudStackClient, path string) (string, error, bool)

GetDomainByPath fetches a domain by its path.

func GetOrCreateAccount

func GetOrCreateAccount(csClient *cloudstack.CloudStackClient, account *cloud.Account) error

GetOrCreateAccount creates a domain as specified in the passed account object.

func GetOrCreateDomain

func GetOrCreateDomain(csClient *cloudstack.CloudStackClient, domain *cloud.Domain) error

GetOrCreateDomain gets or creates a domain as specified in the passed domain object.

func GetOrCreateUserWithKey

func GetOrCreateUserWithKey(csClient *cloudstack.CloudStackClient, user *cloud.User) error

GetOrCreateUserWithKey creates a domain as specified in the passed account object. Right now only works with a default TemporaryUser name. This function was only built to get a testing user built.

func NewCSClient

func NewCSClient() (*cloudstack.CloudStackClient, error)

NewCSClient creates a CloudStack-Go client from the cloud-config file.

func UnmarshalAllConfigs

func UnmarshalAllConfigs(in []byte, out *[]Config) error

Types

type CSConf

type CSConf struct {
	APIKey    string `yaml:"api-key"`
	SecretKey string `yaml:"secret-key"`
	APIUrl    string `yaml:"api-url"`
	VerifySSL string `yaml:"verify-ssl"`
}

type Config

type Config struct {
	ApiVersion string            `yaml:"apiVersion"`
	Kind       string            `yaml:"kind"`
	Type       string            `yaml:"type"`
	Metadata   map[string]string `yaml:"metadata"`
	StringData CSConf            `yaml:"stringData"`
}

Jump to

Keyboard shortcuts

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