Help us shape the future of Go! Take the 2026 Go Developer Survey

types

package
v1.58.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudConfigToString

func CloudConfigToString(c *CloudConfig) (string, error)

CloudConfigToString converts CloudConfig into its formatted string representation. Deprecated: use struct receiver function String() instead.

Types

type CloudConfig

type CloudConfig struct {
	Global    GlobalOpts
	Disk      DiskOpts
	Workspace WorkspaceOpts

	VirtualCenter map[string]*VirtualCenterConfig
}

CloudConfig is used to read and store information from the cloud configuration file.

func (*CloudConfig) String added in v1.56.0

func (c *CloudConfig) String() (string, error)

String converts CloudConfig into its formatted string representation.

type DiskOpts

type DiskOpts struct {
	SCSIControllerType string `dcfg:"scsicontrollertype"`
}

type GlobalOpts

type GlobalOpts struct {
	User             string `gcfg:"user"`
	Password         string `gcfg:"password"`
	InsecureFlag     bool   `gcfg:"insecure-flag"`
	VCenterPort      string `gcfg:"port"`
	WorkingDir       string `gcfg:"working-dir"`
	Datacenter       string `gcfg:"datacenter"`
	DefaultDatastore string `gcfg:"datastore"`
	VCenterIP        string `gcfg:"server"`
	ClusterID        string `gcfg:"cluster-id"`
	IPFamily         string `gcfg:"ip-family"` // NOTE: supported only in case of out-of-tree CCM
}

type RawConfig

type RawConfig struct {
	TemplateVMName providerconfigtypes.ConfigVarString `json:"templateVMName"`
	// Deprecated: use networks instead.
	VMNetName  providerconfigtypes.ConfigVarString   `json:"vmNetName"`
	Networks   []providerconfigtypes.ConfigVarString `json:"networks"`
	Username   providerconfigtypes.ConfigVarString   `json:"username"`
	Password   providerconfigtypes.ConfigVarString   `json:"password"`
	VSphereURL providerconfigtypes.ConfigVarString   `json:"vsphereURL"`
	Datacenter providerconfigtypes.ConfigVarString   `json:"datacenter"`

	// Cluster defines the cluster to use in vcenter.
	// Only needed for vm anti affinity.
	Cluster providerconfigtypes.ConfigVarString `json:"cluster"`

	Folder       providerconfigtypes.ConfigVarString `json:"folder"`
	ResourcePool providerconfigtypes.ConfigVarString `json:"resourcePool"`

	// Either Datastore or DatastoreCluster have to be provided.
	DatastoreCluster providerconfigtypes.ConfigVarString `json:"datastoreCluster"`
	Datastore        providerconfigtypes.ConfigVarString `json:"datastore"`

	CPUs           int32                             `json:"cpus"`
	MemoryMB       int64                             `json:"memoryMB"`
	DiskSizeGB     *int64                            `json:"diskSizeGB,omitempty"`
	Tags           []Tag                             `json:"tags,omitempty"`
	AllowInsecure  providerconfigtypes.ConfigVarBool `json:"allowInsecure"`
	VMAntiAffinity providerconfigtypes.ConfigVarBool `json:"vmAntiAffinity"`
}

RawConfig represents vsphere specific configuration.

func GetConfig added in v1.44.0

func GetConfig(pconfig providerconfigtypes.Config) (*RawConfig, error)

type Tag added in v1.46.0

type Tag struct {
	Description string `json:"description,omitempty"`
	ID          string `json:"id,omitempty"`
	Name        string `json:"name,omitempty"`
	CategoryID  string `json:"categoryID"`
}

Tag represents vsphere tag.

type VirtualCenterConfig

type VirtualCenterConfig struct {
	User        string `gcfg:"user"`
	Password    string `gcfg:"password"`
	VCenterPort string `gcfg:"port"`
	Datacenters string `gcfg:"datacenters"`
	IPFamily    string `gcfg:"ip-family"` // NOTE: supported only in case of out-of-tree CCM
}

type WorkspaceOpts

type WorkspaceOpts struct {
	VCenterIP        string `gcfg:"server"`
	Datacenter       string `gcfg:"datacenter"`
	Folder           string `gcfg:"folder"`
	DefaultDatastore string `gcfg:"default-datastore"`
	ResourcePoolPath string `gcfg:"resourcepool-path"`
}

Jump to

Keyboard shortcuts

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