Documentation
¶
Index ¶
- Constants
- Variables
- func ClearCache(sessionKey string)
- func ConfigureSSOClient(ctx context.Context, driver *VSphereCloudDriver) (*ssoadmin.Client, error)
- func GetVmwareUserPrivileges(ctx context.Context, userPrincipal string, groupPrincipals []string, ...) (map[string]bool, error)
- type AdditionalDisk
- type Datastore
- type HostDateInfo
- type LibvirtVmInfo
- type Metrics
- type MockVsphereDriver
- func (d MockVsphereDriver) GetHostClusterMapping(ctx context.Context) (map[string]string, error)
- func (d MockVsphereDriver) GetResourcePools(ctx context.Context, datacenter string, cluster string) ([]*object.ResourcePool, error)
- func (d MockVsphereDriver) GetResourceTags(ctx context.Context, resourceType string) (map[string]tags.AttachedTags, error)
- func (d MockVsphereDriver) GetVSphereClusters(ctx context.Context, datacenter string) ([]string, error)
- func (d MockVsphereDriver) GetVSphereDatacenters(ctx context.Context) ([]string, error)
- func (d MockVsphereDriver) GetVSphereHostSystems(ctx context.Context, datacenter, cluster string) ([]VSphereHostSystem, error)
- func (d MockVsphereDriver) GetVSphereVMFolders(ctx context.Context, datacenter string) ([]string, error)
- func (d MockVsphereDriver) GetVSphereVms(ctx context.Context, dcName string) ([]VSphereVM, error)
- func (d MockVsphereDriver) GetVapps(ctx context.Context) ([]mo.VirtualApp, error)
- func (d MockVsphereDriver) IsAdminAccount(ctx context.Context) (bool, error)
- func (d MockVsphereDriver) IsValidVSphereCredentials(ctx context.Context) (bool, error)
- func (d MockVsphereDriver) ValidateVsphereVersion(constraint string) error
- type Session
- type SshInfo
- type VSphereCloudDriver
- func (v *VSphereCloudDriver) CreateVSphereVMFolder(ctx context.Context, datacenter string, folders []string) error
- func (v *VSphereCloudDriver) FolderExists(ctx context.Context, finder *find.Finder, datacenter, folderName string) (bool, error)
- func (v *VSphereCloudDriver) GetClusterIfExists(ctx context.Context, finder *find.Finder, datacenter, clusterName string) (bool, *object.ClusterComputeResource, error)
- func (v *VSphereCloudDriver) GetCurrentVmwareUser(ctx context.Context) (string, error)
- func (v *VSphereCloudDriver) GetDatacenterIfExists(ctx context.Context, finder *find.Finder, datacenter string) (bool, *object.Datacenter, error)
- func (v *VSphereCloudDriver) GetFinderWithDatacenter(ctx context.Context, datacenter string) (*find.Finder, string, error)
- func (v *VSphereCloudDriver) GetFolderIfExists(ctx context.Context, finder *find.Finder, datacenter, folderName string) (bool, *object.Folder, error)
- func (v *VSphereCloudDriver) GetFolderNameByID(ctx context.Context, datacenter, id string) (string, error)
- func (v *VSphereCloudDriver) GetHostClusterMapping(ctx context.Context) (map[string]string, error)
- func (v *VSphereCloudDriver) GetHostIfExists(ctx context.Context, finder *find.Finder, ...) (bool, *object.HostSystem, error)
- func (v *VSphereCloudDriver) GetMetrics(ctx context.Context, c *vim25.Client, vms []mo.VirtualMachine) ([]performance.EntityMetric, error)
- func (v *VSphereCloudDriver) GetResourcePoolIfExists(ctx context.Context, finder *find.Finder, ...) (bool, *object.ResourcePool, error)
- func (v *VSphereCloudDriver) GetResourcePools(ctx context.Context, datacenter string, cluster string) ([]*object.ResourcePool, error)
- func (v *VSphereCloudDriver) GetResourceTags(ctx context.Context, resourceType string) (map[string]tags.AttachedTags, error)
- func (v *VSphereCloudDriver) GetVAppIfExists(ctx context.Context, finder *find.Finder, datacenter, vAppName string) (bool, *object.VirtualApp, error)
- func (v *VSphereCloudDriver) GetVMIfExists(ctx context.Context, finder *find.Finder, datacenter, cluster, vmName string) (bool, *object.VirtualMachine, error)
- func (v *VSphereCloudDriver) GetVSphereClusters(ctx context.Context, datacenter string) ([]string, error)
- func (v *VSphereCloudDriver) GetVSphereDatacenters(ctx context.Context) ([]string, error)
- func (v *VSphereCloudDriver) GetVSphereHostSystems(ctx context.Context, datacenter, cluster string) ([]VSphereHostSystem, error)
- func (v *VSphereCloudDriver) GetVSphereResourcePools(ctx context.Context, datacenter string, cluster string) (resourcePools []string, err error)
- func (v *VSphereCloudDriver) GetVSphereVMFolders(ctx context.Context, datacenter string) ([]string, error)
- func (v *VSphereCloudDriver) GetVSphereVms(ctx context.Context, dcName string) ([]VSphereVM, error)
- func (v *VSphereCloudDriver) GetVapps(ctx context.Context) ([]mo.VirtualApp, error)
- func (v *VSphereCloudDriver) IsAdminAccount(ctx context.Context) (bool, error)
- func (v *VSphereCloudDriver) IsValidVSphereCredentials(ctx context.Context) (bool, error)
- func (v *VSphereCloudDriver) ValidateHostNTPSettings(ctx context.Context, finder *find.Finder, datacenter, clusterName string, ...) (bool, []string, error)
- func (v *VSphereCloudDriver) ValidateUserPrivilegeOnEntities(ctx context.Context, authManager *object.AuthorizationManager, ...) (isValid bool, failures []string, err error)
- func (v *VSphereCloudDriver) ValidateVsphereVersion(constraint string) error
- type VSphereHostSystem
- type VSphereNetwork
- type VSphereVM
- type VSphereVmInfo
- type VsphereCloudAccount
- type VsphereDriver
Constants ¶
View Source
const ( KeepAliveIntervalInMinute = 10 DatacenterTagCategory = "k8s-region" ComputeClusterTagCategory = "k8s-zone" )
Variables ¶
View Source
var IsAdminAccount = isAdminAccount
Functions ¶
func ClearCache ¶
func ClearCache(sessionKey string)
func ConfigureSSOClient ¶ added in v0.0.25
Types ¶
type AdditionalDisk ¶ added in v0.0.23
type HostDateInfo ¶
type HostDateInfo struct {
HostName string
NtpServers []string
types.HostDateTimeInfo
Service *types.HostService
Current *time.Time
ClientStatus string
ServiceStatus string
}
type LibvirtVmInfo ¶ added in v0.0.23
type Metrics ¶ added in v0.0.23
type Metrics struct {
CpuCores string
CpuUsage string
MemoryBytes string
MemoryUsage string
DiskUsage string
DiskProvisioned string
}
func ToVmMetrics ¶ added in v0.0.23
func ToVmMetrics(name string, metrics []performance.EntityMetric) Metrics
func ToVsphereMetrics ¶ added in v0.0.23
func ToVsphereMetrics(metric performance.EntityMetric) Metrics
type MockVsphereDriver ¶ added in v0.0.23
type MockVsphereDriver struct {
Datacenters []string
Clusters []string
VMs []VSphereVM
VMFolders []string
HostSystems map[string][]VSphereHostSystem
VApps []mo.VirtualApp
ResourcePools []*object.ResourcePool
HostClusterMapping map[string]string
ResourceTags map[string]tags.AttachedTags
}
func (MockVsphereDriver) GetHostClusterMapping ¶ added in v0.0.23
func (MockVsphereDriver) GetResourcePools ¶ added in v0.0.23
func (d MockVsphereDriver) GetResourcePools(ctx context.Context, datacenter string, cluster string) ([]*object.ResourcePool, error)
func (MockVsphereDriver) GetResourceTags ¶ added in v0.0.23
func (d MockVsphereDriver) GetResourceTags(ctx context.Context, resourceType string) (map[string]tags.AttachedTags, error)
func (MockVsphereDriver) GetVSphereClusters ¶ added in v0.0.23
func (MockVsphereDriver) GetVSphereDatacenters ¶ added in v0.0.23
func (d MockVsphereDriver) GetVSphereDatacenters(ctx context.Context) ([]string, error)
func (MockVsphereDriver) GetVSphereHostSystems ¶ added in v0.0.23
func (d MockVsphereDriver) GetVSphereHostSystems(ctx context.Context, datacenter, cluster string) ([]VSphereHostSystem, error)
func (MockVsphereDriver) GetVSphereVMFolders ¶ added in v0.0.23
func (MockVsphereDriver) GetVSphereVms ¶ added in v0.0.23
func (MockVsphereDriver) GetVapps ¶ added in v0.0.23
func (d MockVsphereDriver) GetVapps(ctx context.Context) ([]mo.VirtualApp, error)
func (MockVsphereDriver) IsAdminAccount ¶ added in v0.0.26
func (d MockVsphereDriver) IsAdminAccount(ctx context.Context) (bool, error)
func (MockVsphereDriver) IsValidVSphereCredentials ¶ added in v0.0.23
func (d MockVsphereDriver) IsValidVSphereCredentials(ctx context.Context) (bool, error)
func (MockVsphereDriver) ValidateVsphereVersion ¶ added in v0.0.23
func (d MockVsphereDriver) ValidateVsphereVersion(constraint string) 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 (*VSphereCloudDriver) FolderExists ¶
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 (*VSphereCloudDriver) GetFolderIfExists ¶
func (*VSphereCloudDriver) GetFolderNameByID ¶
func (*VSphereCloudDriver) GetHostClusterMapping ¶ added in v0.0.23
func (*VSphereCloudDriver) GetHostIfExists ¶
func (v *VSphereCloudDriver) GetHostIfExists(ctx context.Context, finder *find.Finder, datacenter, clusterName, hostName string) (bool, *object.HostSystem, error)
func (*VSphereCloudDriver) GetMetrics ¶ added in v0.0.23
func (v *VSphereCloudDriver) GetMetrics(ctx context.Context, c *vim25.Client, vms []mo.VirtualMachine) ([]performance.EntityMetric, error)
func (*VSphereCloudDriver) GetResourcePoolIfExists ¶
func (v *VSphereCloudDriver) GetResourcePoolIfExists(ctx context.Context, finder *find.Finder, datacenter, cluster, resourcePoolName string) (bool, *object.ResourcePool, error)
func (*VSphereCloudDriver) GetResourcePools ¶ added in v0.0.23
func (v *VSphereCloudDriver) GetResourcePools(ctx context.Context, datacenter string, cluster string) ([]*object.ResourcePool, error)
func (*VSphereCloudDriver) GetResourceTags ¶ added in v0.0.23
func (v *VSphereCloudDriver) GetResourceTags(ctx context.Context, resourceType string) (map[string]tags.AttachedTags, 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) GetVSphereClusters ¶ added in v0.0.23
func (*VSphereCloudDriver) GetVSphereDatacenters ¶ added in v0.0.23
func (v *VSphereCloudDriver) GetVSphereDatacenters(ctx context.Context) ([]string, error)
func (*VSphereCloudDriver) GetVSphereHostSystems ¶ added in v0.0.23
func (v *VSphereCloudDriver) GetVSphereHostSystems(ctx context.Context, datacenter, cluster string) ([]VSphereHostSystem, error)
func (*VSphereCloudDriver) GetVSphereResourcePools ¶
func (*VSphereCloudDriver) GetVSphereVMFolders ¶ added in v0.0.23
func (*VSphereCloudDriver) GetVSphereVms ¶ added in v0.0.23
func (*VSphereCloudDriver) GetVapps ¶ added in v0.0.23
func (v *VSphereCloudDriver) GetVapps(ctx context.Context) ([]mo.VirtualApp, error)
func (*VSphereCloudDriver) IsAdminAccount ¶ added in v0.0.26
func (v *VSphereCloudDriver) IsAdminAccount(ctx context.Context) (bool, error)
func (*VSphereCloudDriver) IsValidVSphereCredentials ¶ added in v0.0.23
func (v *VSphereCloudDriver) IsValidVSphereCredentials(ctx context.Context) (bool, error)
func (*VSphereCloudDriver) ValidateHostNTPSettings ¶
func (*VSphereCloudDriver) ValidateUserPrivilegeOnEntities ¶
func (*VSphereCloudDriver) ValidateVsphereVersion ¶ added in v0.0.23
func (v *VSphereCloudDriver) ValidateVsphereVersion(constraint string) error
type VSphereHostSystem ¶ added in v0.0.23
type VSphereNetwork ¶ added in v0.0.23
type VSphereVM ¶ added in v0.0.23
type VSphereVM struct {
Name string
Type string
Status string
IpAddress string
Host string
Cpu int32
Memory int32
RootDiskSize int32
Network []VSphereNetwork
LibvirtVmInfo LibvirtVmInfo
VSphereVmInfo VSphereVmInfo
SshInfo SshInfo
AdditionalDisk []AdditionalDisk
Metrics Metrics
Storage []Datastore
}
func ToVSphereVM ¶ added in v0.0.23
func ToVSphereVM(param mo.VirtualMachine, metrics []performance.EntityMetric, networks []object.NetworkReference, dsNames []*object.Datastore, folders []*object.Folder, hostSystems []mo.HostSystem, ccrs []*object.ClusterComputeResource, parentsRef []mo.VirtualMachine) VSphereVM
func ToVSphereVMs ¶ added in v0.0.23
func ToVSphereVMs(params []mo.VirtualMachine, metrics []performance.EntityMetric, networks []object.NetworkReference, dsNames []*object.Datastore, folders []*object.Folder, hostSystems []mo.HostSystem, ccrs []*object.ClusterComputeResource, parentsRef []mo.VirtualMachine) []VSphereVM
type VSphereVmInfo ¶ added in v0.0.23
type VsphereCloudAccount ¶
type VsphereCloudAccount struct {
// Insecure is a flag that controls whether to validate the vSphere server's certificate.
Insecure bool `json:"insecure" yaml:"insecure"`
// password
// Required: true
Password string `json:"password" yaml:"password"`
// username
// Required: true
Username string `json:"username" yaml:"username"`
// VcenterServer is the address of the vSphere endpoint
// Required: true
VcenterServer string `json:"vcenterServer" yaml:"vcenterServer"`
}
type VsphereDriver ¶ added in v0.0.23
type VsphereDriver interface {
GetVSphereVMFolders(ctx context.Context, datacenter string) ([]string, error)
GetVSphereDatacenters(ctx context.Context) ([]string, error)
GetVSphereClusters(ctx context.Context, datacenter string) ([]string, error)
GetVSphereHostSystems(ctx context.Context, datacenter, cluster string) ([]VSphereHostSystem, error)
IsValidVSphereCredentials(ctx context.Context) (bool, error)
ValidateVsphereVersion(constraint string) error
GetHostClusterMapping(ctx context.Context) (map[string]string, error)
GetVSphereVms(ctx context.Context, dcName string) ([]VSphereVM, error)
GetResourcePools(ctx context.Context, datacenter string, cluster string) ([]*object.ResourcePool, error)
GetVapps(ctx context.Context) ([]mo.VirtualApp, error)
GetResourceTags(ctx context.Context, resourceType string) (map[string]tags.AttachedTags, error)
IsAdminAccount(ctx context.Context) (bool, error)
}
Click to show internal directories.
Click to hide internal directories.