Documentation ¶
Index ¶
- func GetDatastores(sess *session.Session, datacenter *object.Datacenter) ([]*object.Datastore, error)
- type ClusterContext
- type DatacenterContext
- type Metadata
- func (m *Metadata) AddCredentials(server, username, password string) (*session.Params, error)
- func (m *Metadata) FindVCenterVirtualMachine(server string) (*mo.VirtualMachine, error)
- func (m *Metadata) GetClusterByPath(server, path string) (*object.ClusterComputeResource, error)
- func (m *Metadata) GetClusterCapacity(server string, cluster *object.ClusterComputeResource) (int16, int64, error)
- func (m *Metadata) GetClusters(sess *session.Session, datacenter *object.Datacenter) ([]*object.ClusterComputeResource, error)
- func (m *Metadata) GetDatacenterByPath(server, path string) (*object.Datacenter, error)
- func (m *Metadata) GetDatacenters(server string) ([]*object.Datacenter, error)
- func (m *Metadata) GetDistributedPortGroups(server, portGroupSubString string) ([]mo.DistributedVirtualPortgroup, error)
- func (m *Metadata) GetFailureDomainsViaTag(server string) (*[]v1.VSpherePlatformFailureDomainSpec, error)
- func (m *Metadata) GetHostnameUrlVpxd(server string) (*string, error)
- func (m *Metadata) GetPortGroupVlanFromMoRef(networks []types.ManagedObjectReference, server string) ([]int32, error)
- func (m *Metadata) GetPortGroups(server string, datacenter *object.Datacenter) ([]*mo.DistributedVirtualPortgroup, error)
- func (m *Metadata) GetTagCategories(server string) error
- func (m *Metadata) Session(ctx context.Context, server string) (*session.Session, error)
- type PortGroupContext
- type VCenterContext
- type VCenterCredential
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatastores ¶
Types ¶
type ClusterContext ¶
type DatacenterContext ¶
type DatacenterContext struct { ClusterContexts map[string]ClusterContext PortGroupContexts map[string]PortGroupContext }
type Metadata ¶
type Metadata struct { VCenterContexts map[string]VCenterContext VCenterCredentials map[string]VCenterCredential // contains filtered or unexported fields }
Metadata holds vcenter stuff.
func (*Metadata) AddCredentials ¶
AddCredentials creates a session param from the vCenter server, username and password to the Credentials Map.
func (*Metadata) FindVCenterVirtualMachine ¶
func (m *Metadata) FindVCenterVirtualMachine(server string) (*mo.VirtualMachine, error)
func (*Metadata) GetClusterByPath ¶
func (m *Metadata) GetClusterByPath(server, path string) (*object.ClusterComputeResource, error)
func (*Metadata) GetClusterCapacity ¶
func (*Metadata) GetClusters ¶
func (m *Metadata) GetClusters(sess *session.Session, datacenter *object.Datacenter) ([]*object.ClusterComputeResource, error)
func (*Metadata) GetDatacenterByPath ¶
func (m *Metadata) GetDatacenterByPath(server, path string) (*object.Datacenter, error)
func (*Metadata) GetDatacenters ¶
func (m *Metadata) GetDatacenters(server string) ([]*object.Datacenter, error)
func (*Metadata) GetDistributedPortGroups ¶
func (m *Metadata) GetDistributedPortGroups(server, portGroupSubString string) ([]mo.DistributedVirtualPortgroup, error)
func (*Metadata) GetFailureDomainsViaTag ¶
func (m *Metadata) GetFailureDomainsViaTag(server string) (*[]v1.VSpherePlatformFailureDomainSpec, error)
func (*Metadata) GetHostnameUrlVpxd ¶
func (m *Metadata) GetTopologyByTags(server string, objectID []mo.Reference) error { var openshiftZoneTagCatId string var openshiftRegionTagCatId string ctx, cancel := context.WithTimeout(context.TODO(), timeout) defer cancel() sess, err := m.Session(ctx, server) if err != nil { return err } err = m.GetTagCategories(server) if err != nil { return err } attachedTags, err := sess.TagManager.GetAttachedTagsOnObjects(ctx, objectID) if err != nil { return err } for _, tc := range m.VCenterContexts[server].TagCategories { if tc.Name == openshiftZoneTagCatName { openshiftZoneTagCatId = tc.ID } if tc.Name == openshiftRegionTagCatName { openshiftRegionTagCatId = tc.ID } } for _, atag := range attachedTags { for _, tag := range atag.Tags { if tag.CategoryID == openshiftZoneTagCatId { log.Print(tag.Name) log.Print(atag.ObjectID) } if tag.CategoryID == openshiftRegionTagCatId { } } } return nil }
func (*Metadata) GetPortGroupVlanFromMoRef ¶
func (*Metadata) GetPortGroups ¶
func (m *Metadata) GetPortGroups(server string, datacenter *object.Datacenter) ([]*mo.DistributedVirtualPortgroup, error)
func (*Metadata) GetTagCategories ¶
type PortGroupContext ¶
type PortGroupContext struct {
VlanId int16
}
type VCenterContext ¶
type VCenterContext struct { VCenter string DatacenterContexts map[string]DatacenterContext IPAddresses []net.IP TagCategories []tags.Category }
VCenterContext maintains context of known vCenters to be used in CAPI manifest reconciliation.
type VCenterCredential ¶
VCenterCredential contains the vCenter username and password.
Click to show internal directories.
Click to hide internal directories.