vsphere

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const KeepAliveIntervalInMinute = 10

Variables

This section is empty.

Functions

func ClearCache

func ClearCache(sessionKey string)

func GetVmwareUserPrivileges

func GetVmwareUserPrivileges(userPrincipal string, groupPrincipals []string, authManager *object.AuthorizationManager) (map[string]bool, error)

Types

type HostDateInfo

type HostDateInfo struct {
	HostName   string
	NtpServers []string
	types.HostDateTimeInfo
	Service       *types.HostService
	Current       *time.Time
	ClientStatus  string
	ServiceStatus string
}

type Session

type Session struct {
	GovmomiClient *govmomi.Client
	RestClient    *rest.Client
}

func GetOrCreateSession

func GetOrCreateSession(
	ctx context.Context,
	server, username, password string, refreshRestClient bool) (Session, error)

type VSphereCloudDriver

type VSphereCloudDriver struct {
	VCenterServer   string
	VCenterUsername string
	VCenterPassword string
	Datacenter      string
	Client          *govmomi.Client
	RestClient      *rest.Client
}

func NewVSphereDriver

func NewVSphereDriver(VCenterServer, VCenterUsername, VCenterPassword, datacenter string) (*VSphereCloudDriver, error)

func (*VSphereCloudDriver) CreateVSphereVMFolder

func (v *VSphereCloudDriver) CreateVSphereVMFolder(ctx context.Context, datacenter string, folders []string) error

func (*VSphereCloudDriver) FolderExists

func (v *VSphereCloudDriver) FolderExists(ctx context.Context, finder *find.Finder, datacenter, folderName string) (bool, error)

func (*VSphereCloudDriver) GetClusterIfExists

func (v *VSphereCloudDriver) GetClusterIfExists(ctx context.Context, finder *find.Finder, datacenter, clusterName string) (bool, *object.ClusterComputeResource, error)

func (*VSphereCloudDriver) GetCurrentVmwareUser

func (v *VSphereCloudDriver) GetCurrentVmwareUser(ctx context.Context) (string, error)

func (*VSphereCloudDriver) GetDatacenterIfExists

func (v *VSphereCloudDriver) GetDatacenterIfExists(ctx context.Context, finder *find.Finder, datacenter string) (bool, *object.Datacenter, error)

func (*VSphereCloudDriver) GetFinderWithDatacenter

func (v *VSphereCloudDriver) GetFinderWithDatacenter(ctx context.Context, datacenter string) (*find.Finder, string, error)

func (*VSphereCloudDriver) GetFolderIfExists

func (v *VSphereCloudDriver) GetFolderIfExists(ctx context.Context, finder *find.Finder, datacenter, folderName string) (bool, *object.Folder, error)

func (*VSphereCloudDriver) GetFolderNameByID

func (v *VSphereCloudDriver) GetFolderNameByID(ctx context.Context, datacenter, id string) (string, error)

func (*VSphereCloudDriver) GetHostIfExists

func (v *VSphereCloudDriver) GetHostIfExists(ctx context.Context, finder *find.Finder, datacenter, clusterName, hostName string) (bool, *object.HostSystem, error)

func (*VSphereCloudDriver) GetResourcePoolIfExists

func (v *VSphereCloudDriver) GetResourcePoolIfExists(ctx context.Context, finder *find.Finder, datacenter, cluster, resourcePoolName string) (bool, *object.ResourcePool, error)

func (*VSphereCloudDriver) GetVAppIfExists

func (v *VSphereCloudDriver) GetVAppIfExists(ctx context.Context, finder *find.Finder, datacenter, vAppName string) (bool, *object.VirtualApp, error)

func (*VSphereCloudDriver) GetVMIfExists

func (v *VSphereCloudDriver) GetVMIfExists(ctx context.Context, finder *find.Finder, datacenter, cluster, vmName string) (bool, *object.VirtualMachine, error)

func (*VSphereCloudDriver) GetVSphereResourcePools

func (v *VSphereCloudDriver) GetVSphereResourcePools(ctx context.Context, datacenter string, cluster string) (resourcePools []string, err error)

func (*VSphereCloudDriver) ValidateHostNTPSettings

func (v *VSphereCloudDriver) ValidateHostNTPSettings(ctx context.Context, finder *find.Finder, datacenter, clusterName string, hosts []string) (bool, []string, error)

func (*VSphereCloudDriver) ValidateUserPrivilegeOnEntities

func (v *VSphereCloudDriver) ValidateUserPrivilegeOnEntities(ctx context.Context, authManager *object.AuthorizationManager, datacenter string, finder *find.Finder, entityName, entityType string, privileges []string, userName, clusterName string) (isValid bool, failures []string, err error)

type VsphereCloudAccount

type VsphereCloudAccount struct {
	// Insecure is a flag that controls whether to validate the vSphere server's certificate.
	Insecure bool `json:"insecure"`

	// password
	// Required: true
	Password string `json:"password"`

	// username
	// Required: true
	Username string `json:"username"`

	// VcenterServer is the address of the vSphere endpoint
	// Required: true
	VcenterServer string `json:"vcenterServer"`
}

Jump to

Keyboard shortcuts

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