Documentation ¶
Overview ¶
Package vsphere collects vSphere-specific configuration.
Index ¶
- func GetClusterNetworks(ctx context.Context, finder Finder, datacenter, cluster string) ([]types.ManagedObjectReference, error)
- func GetNetworkMo(ctx context.Context, client *vim25.Client, finder Finder, ...) (*types.ManagedObjectReference, error)
- func GetNetworkMoID(ctx context.Context, client *vim25.Client, finder Finder, ...) (string, error)
- func GetNetworkName(ctx context.Context, client *vim25.Client, ref types.ManagedObjectReference) (string, error)
- func Platform() (*vsphere.Platform, error)
- func Validate(ic *types.InstallConfig) error
- func ValidateForProvisioning(ic *types.InstallConfig) error
- type AuthManager
- type ClientLogout
- type Finder
- type Metadata
- type NetworkNameMap
- type PermissionGroupDefinition
- type PrivilegeRelevanceFunc
- type SessionManager
- type TagManager
- type VCenterContext
- type VCenterCredential
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetClusterNetworks ¶
func GetClusterNetworks(ctx context.Context, finder Finder, datacenter, cluster string) ([]types.ManagedObjectReference, error)
GetClusterNetworks returns a slice of Managed Object references for vSphere networks in the given Datacenter and Cluster.
func GetNetworkMo ¶
func GetNetworkMo(ctx context.Context, client *vim25.Client, finder Finder, datacenter, cluster, network string) (*types.ManagedObjectReference, error)
GetNetworkMo returns the unique Managed Object for given network name inside of the given Datacenter and Cluster.
func GetNetworkMoID ¶
func GetNetworkMoID(ctx context.Context, client *vim25.Client, finder Finder, datacenter, cluster, network string) (string, error)
GetNetworkMoID returns the unique Managed Object ID for given network name inside of the given Datacenter and Cluster.
func GetNetworkName ¶
func GetNetworkName(ctx context.Context, client *vim25.Client, ref types.ManagedObjectReference) (string, error)
GetNetworkName returns the name of a vSphere network given its Managed Object reference.
func Validate ¶
func Validate(ic *types.InstallConfig) error
Validate executes platform-specific validation.
func ValidateForProvisioning ¶
func ValidateForProvisioning(ic *types.InstallConfig) error
ValidateForProvisioning performs platform validation specifically for multi-zone installer-provisioned infrastructure. In this case, self-hosted networking is a requirement when the installer creates infrastructure for vSphere clusters.
Types ¶
type AuthManager ¶
type AuthManager interface { FetchUserPrivilegeOnEntities(ctx context.Context, entities []vim25types.ManagedObjectReference, userName string) ([]vim25types.UserPrivilegeResult, error) Properties(ctx context.Context, r vim25types.ManagedObjectReference, ps []string, dst interface{}) error Reference() vim25types.ManagedObjectReference }
AuthManager defines an interface to an implementation of the AuthorizationManager to facilitate mocking
type ClientLogout ¶
type ClientLogout func()
ClientLogout is empty function that logs out of vSphere clients
func CreateVSphereClients ¶
func CreateVSphereClients(ctx context.Context, vcenter, username, password string) (*vim25.Client, *rest.Client, ClientLogout, error)
CreateVSphereClients creates the SOAP and REST client to access different portions of the vSphere API e.g. tags are only available in REST
type Finder ¶
type Finder interface { Datacenter(ctx context.Context, path string) (*object.Datacenter, error) DatacenterList(ctx context.Context, path string) ([]*object.Datacenter, error) DatastoreList(ctx context.Context, path string) ([]*object.Datastore, error) ClusterComputeResource(ctx context.Context, path string) (*object.ClusterComputeResource, error) ClusterComputeResourceList(ctx context.Context, path string) ([]*object.ClusterComputeResource, error) Folder(ctx context.Context, path string) (*object.Folder, error) NetworkList(ctx context.Context, path string) ([]object.NetworkReference, error) Network(ctx context.Context, path string) (object.NetworkReference, error) ResourcePool(ctx context.Context, path string) (*object.ResourcePool, error) VirtualMachine(ctx context.Context, path string) (*object.VirtualMachine, error) VirtualMachineList(ctx context.Context, path string) ([]*object.VirtualMachine, error) HostSystemList(ctx context.Context, path string) ([]*object.HostSystem, error) ObjectReference(ctx context.Context, ref types.ManagedObjectReference) (object.Reference, error) }
Finder interface represents the client that is used to connect to VSphere to get specific information from the resources in the VCenter. This interface just describes all the useful functions used by the installer from the finder function in vmware govmomi package and is mostly used to create a mock client that can be used for testing.
type Metadata ¶ added in v0.90.0
type Metadata struct { VCenterContexts map[string]VCenterContext VCenterCredentials map[string]VCenterCredential // contains filtered or unexported fields }
Metadata holds vcenter stuff.
func NewMetadata ¶ added in v0.90.0
func NewMetadata() *Metadata
NewMetadata initializes a new Metadata object.
func (*Metadata) AddCredentials ¶ added in v0.90.0
AddCredentials creates a session param from the vCenter server, username and password to the Credentials Map.
type NetworkNameMap ¶ added in v0.90.0
type NetworkNameMap struct { Cluster string ResourcePools map[string]*object.ResourcePool NetworkNames map[string]string }
NetworkNameMap contains the vCenter cluster name, resource pools and network names.
type PermissionGroupDefinition ¶
type PermissionGroupDefinition struct { /* Permissions array of privileges which correlate with the privileges listed in docs */ Permissions []string /* Description friendly description of privilege group */ Description string }
PermissionGroupDefinition defines a group of permissions and a related human friendly description
type PrivilegeRelevanceFunc ¶
type PrivilegeRelevanceFunc func(*vspheretypes.Platform) bool
PrivilegeRelevanceFunc returns true if the associated privilege group privileges should be verified
type SessionManager ¶
type SessionManager interface {
UserSession(ctx context.Context) (*vim25types.UserSession, error)
}
SessionManager defines an interface to an implementation of the SessionManager to facilitate mocking.
type TagManager ¶
type TagManager interface { ListCategories(ctx context.Context) ([]string, error) GetCategories(ctx context.Context) ([]vapitags.Category, error) GetCategory(ctx context.Context, id string) (*vapitags.Category, error) GetTagsForCategory(ctx context.Context, id string) ([]vapitags.Tag, error) GetAttachedTags(ctx context.Context, ref mo.Reference) ([]vapitags.Tag, error) GetAttachedTagsOnObjects(ctx context.Context, objectID []mo.Reference) ([]vapitags.AttachedTags, error) }
TagManager defines an interface to an implementation of the AuthorizationManager to facilitate mocking.
type VCenterContext ¶ added in v0.90.0
type VCenterContext struct { VCenter string Datacenters []string ClusterNetworkMap map[string]NetworkNameMap }
VCenterContext maintains context of known vCenters to be used in CAPI manifest reconciliation.
type VCenterCredential ¶ added in v0.90.0
VCenterCredential contains the vCenter username and password.