vcdsdk

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoRdePrefix = `NO_RDE_`

	MaxRDEUpdateRetries                = 10
	DefaultRollingWindowSize           = 10
	ComponentStatusFieldVCDResourceSet = "vcdResourceSet"
	ComponentStatusFieldErrorSet       = "errorSet"
	ComponentStatusFieldEventSet       = "eventSet"

	ComponentCPI    = "cpi"
	ComponentCSI    = "csi"
	ComponentCAPVCD = "capvcd"

	// VCD resource types in VCDResourceSet
	VcdResourceVirtualService   = "virtual-service"
	VcdResourceLoadBalancerPool = "lb-pool"
	VcdResourceDNATRule         = "dnat-rule"
	VcdResourceAppPortProfile   = "app-port-profile"

	CAPVCDEntityTypeVendor = "vmware"
	CAPVCDEntityTypeNss    = "capvcdCluster"
	CAPVCDEntityTypePrefix = "urn:vcloud:type:vmware:capvcdCluster"

	NativeClusterEntityTypeVendor = "cse"
	NativeClusterEntityTypeNss    = "nativeCluster"
)
View Source
const (
	// VCDVMIDPrefix is a prefix added to VM objects by VCD. This needs
	// to be removed for query operations.
	VCDVMIDPrefix = "urn:vcloud:vm:"
)
View Source
const (
	VCloudApiVersion = "36.0"
)

Variables

This section is empty.

Functions

func AddVCDResourceToStatusMap

func AddVCDResourceToStatusMap(component string, componentName string, componentVersion string, statusMap map[string]interface{}, vcdResource VCDResource) (map[string]interface{}, bool, error)

AddVCDResourceToStatusMap updates the input status map with VCDResource created from the input parameters. This function doesn't make any

calls to VCD.

func GetAppPortProfileName

func GetAppPortProfileName(dnatRuleName string) string

func GetDNATRuleName

func GetDNATRuleName(virtualServiceName string) string

func GetUserAndOrg

func GetUserAndOrg(fullUserName string, clusterOrg string, currentUserOrg string) (userOrg string, userName string, err error)

func GetVirtualIPsFromRDE

func GetVirtualIPsFromRDE(rde *swaggerClient.DefinedEntity) ([]string, error)

func IsCAPVCDEntityType

func IsCAPVCDEntityType(entityTypeID string) bool

func IsNativeClusterEntityType

func IsNativeClusterEntityType(entityTypeID string) bool

func IsValidEntityId

func IsValidEntityId(entityTypeID string) bool

func RemoveVCDResourceSetFromStatusMap

func RemoveVCDResourceSetFromStatusMap(component string, componentName string, componentVersion string,
	statusMap map[string]interface{}, vcdResource VCDResource) (map[string]interface{}, error)

RemoveVCDResourceSetFromStatusMap removes a VCDResource from VCDResourceSet if type and name of the resource matches If the component is absent, an empty component is initialized.

func ReplaceVirtualIPsInRDE

func ReplaceVirtualIPsInRDE(rde *swaggerClient.DefinedEntity, updatedIps []string) (*swaggerClient.DefinedEntity, error)

ReplaceVirtualIPsInRDE replaces the virtual IPs array in the inputted rde. It does not make an API call to update the RDE.

Types

type BackendError

type BackendError struct {
	Name              string                 `json:"name,omitempty"`
	OccurredAt        time.Time              `json:"occurredAt,omitempty"`
	VcdResourceId     string                 `json:"vcdResourceId,omitempty"`
	VcdResourceName   string                 `json:"vcdResourceName,omitempty"`
	AdditionalDetails map[string]interface{} `json:"additionalDetails,omitempty"`
}

TODO: In the future, add subErrorType to AdditionalDetails to handle/match deeper level components removal such as (virtualServiceError, dnatRuleUpdateError, etc) We would need to make AdditionalDetails it's own struct, include a SubErrorType struct/string inside of it During removal, we could match certain subErrorTypes such as delete all LB creation errors that were from subErrorType: virtualServiceFailures AdditionalDetails structure would look something like: additionalDetails : { subErrorType: DNATRuleFailed, additionalInfo: map[string]interface{} }

type BackendEvent

type BackendEvent struct {
	Name              string                 `json:"name,omitempty"`
	OccurredAt        time.Time              `json:"occurredAt,omitempty"`
	VcdResourceId     string                 `json:"vcdResourceId,omitempty"`
	VcdResourceName   string                 `json:"vcdResourceName,omitempty"`
	AdditionalDetails map[string]interface{} `json:"additionalDetails,omitempty"`
}

type CPIStatus

type CPIStatus struct {
	Name           string         `json:"name,omitempty"`
	Version        string         `json:"version,omitempty"`
	VCDResourceSet []VCDResource  `json:"vcdResourceSet,omitempty"`
	Errors         []BackendError `json:"errorSet,omitempty"`
	Events         []BackendEvent `json:"eventSet,omitempty"`
	VirtualIPs     []string       `json:"virtualIPs,omitempty"`
}

type CapvcdRdeFoundError

type CapvcdRdeFoundError struct {
	EntityType string
}

func (CapvcdRdeFoundError) Error

func (e CapvcdRdeFoundError) Error() string

type Client

type Client struct {
	VCDAuthConfig   *VCDAuthConfig // s
	ClusterOrgName  string
	ClusterOVDCName string
	VCDClient       *govcd.VCDClient
	VDC             *govcd.Vdc // TODO: Incrementally remove and test in tests
	APIClient       *swaggerClient.APIClient
	RWLock          sync.RWMutex
}

Client :

func NewVCDClientFromSecrets

func NewVCDClientFromSecrets(host string, orgName string, vdcName string, userOrg string,
	user string, password string, refreshToken string, insecure bool, getVdcClient bool) (*Client, error)

New method from (vdcClient, vdcName) return *govcd.Vdc

func (*Client) RefreshBearerToken

func (client *Client) RefreshBearerToken() error

TODO: Make sure this function still works properly with no issues after refactor

type ComponentStatus

type ComponentStatus struct {
	VCDResourceSet []VCDResource  `json:"vcdResourceSet,omitempty"`
	ErrorSet       []BackendError `json:"errorSet,omitempty"`
	EventSet       []BackendEvent `json:"eventSet,omitempty"`
}

type ComposeVAppWithVMs

type ComposeVAppWithVMs struct {
	XMLName xml.Name `xml:"ComposeVAppParams"`
	Ovf     string   `xml:"xmlns:ovf,attr"`
	Xsi     string   `xml:"xmlns:xsi,attr"`
	Xmlns   string   `xml:"xmlns,attr"`
	// Attributes
	Name        string `xml:"name,attr,omitempty"`        // Typically used to name or identify the subject of the request. For example, the name of the object being created or modified.
	Deploy      bool   `xml:"deploy,attr"`                // True if the vApp should be deployed at instantiation. Defaults to true.
	PowerOn     bool   `xml:"powerOn,attr"`               // True if the vApp should be powered-on at instantiation. Defaults to true.
	LinkedClone bool   `xml:"linkedClone,attr,omitempty"` // Reserved. Unimplemented.
	// Elements
	Description         string                               `xml:"Description,omitempty"`         // Optional description.
	VAppParent          *types.Reference                     `xml:"VAppParent,omitempty"`          // Reserved. Unimplemented.
	InstantiationParams *types.InstantiationParams           `xml:"InstantiationParams,omitempty"` // Instantiation parameters for the composed vApp.
	SourcedItemList     []*types.SourcedCompositionItemParam `xml:"SourcedItem,omitempty"`         // Composition item. One of: vApp vAppTemplate VM.
	AllEULAsAccepted    bool                                 `xml:"AllEULAsAccepted,omitempty"`    // True confirms acceptance of all EULAs in a vApp template. Instantiation fails if this element is missing, empty, or set to false and one or more EulaSection elements are present.
}

type CoresPerSocket

type CoresPerSocket struct {
	OvfRequired string `xml:"required,attr,omitempty"`
	Value       string `xml:",chardata"`
}

type CoresPerSocketMarshal

type CoresPerSocketMarshal struct {
	OvfRequired string `xml:"ovf:required,attr,omitempty"`
	Value       string `xml:",chardata"`
}

type Disk

type Disk struct {
	HREF         string `xml:"href,attr,omitempty"`
	Type         string `xml:"type,attr,omitempty"`
	Id           string `xml:"id,attr,omitempty"`
	OperationKey string `xml:"operationKey,attr,omitempty"`
	Name         string `xml:"name,attr"`
	Status       int    `xml:"status,attr,omitempty"`
	SizeMb       int64  `xml:"sizeMb,attr"`
	Iops         int64  `xml:"iops,attr,omitempty"`
	Encrypted    bool   `xml:"encrypted,attr,omitempty"`
	BusType      string `xml:"busType,attr,omitempty"`
	BusSubType   string `xml:"busSubType,attr,omitempty"`
	Shareable    bool   `xml:"shareable,attr,omitempty"`

	Description     string                 `xml:"Description,omitempty"`
	Files           *types.FilesList       `xml:"Files,omitempty"`
	Link            []*types.Link          `xml:"Link,omitempty"`
	Owner           *types.Owner           `xml:"Owner,omitempty"`
	StorageProfile  *types.Reference       `xml:"StorageProfile,omitempty"`
	Tasks           *types.TasksInProgress `xml:"Tasks,omitempty"`
	VCloudExtension *types.VCloudExtension `xml:"VCloudExtension,omitempty"`
}

Represents an independent disk Reference: vCloud API 35.0 - DiskType https://code.vmware.com/apis/287/vcloud?h=Director#/doc/doc/types/DiskType.html

type DiskCreateParams

type DiskCreateParams struct {
	XMLName         xml.Name               `xml:"DiskCreateParams"`
	Xmlns           string                 `xml:"xmlns,attr,omitempty"`
	Disk            *Disk                  `xml:"Disk"`
	Locality        *types.Reference       `xml:"Locality,omitempty"`
	VCloudExtension *types.VCloudExtension `xml:"VCloudExtension,omitempty"`
}

DiskCreateParams Parameters for creating or updating an independent disk. Reference: vCloud API 35.0 - DiskCreateParamsType https://code.vmware.com/apis/1046/vmware-cloud-director/doc/doc/types/DiskCreateParamsType.html

type DiskRecordType

type DiskRecordType struct {
	HREF               string          `xml:"href,attr,omitempty"`
	Id                 string          `xml:"id,attr,omitempty"`
	Type               string          `xml:"type,attr,omitempty"`
	Name               string          `xml:"name,attr,omitempty"`
	Vdc                string          `xml:"vdc,attr,omitempty"`
	Description        string          `xml:"description,attr,omitempty"`
	SizeMB             int64           `xml:"sizeMb,attr,omitempty"`
	Iops               int64           `xml:"iops,attr,omitempty"`
	Encrypted          bool            `xml:"encrypted,attr,omitempty"`
	DataStore          string          `xml:"dataStore,attr,omitempty"`
	DataStoreName      string          `xml:"datastoreName,attr,omitempty"`
	OwnerName          string          `xml:"ownerName,attr,omitempty"`
	VdcName            string          `xml:"vdcName,attr,omitempty"`
	Task               string          `xml:"task,attr,omitempty"`
	StorageProfile     string          `xml:"storageProfile,attr,omitempty"`
	StorageProfileName string          `xml:"storageProfileName,attr,omitempty"`
	Status             string          `xml:"status,attr,omitempty"`
	BusType            string          `xml:"busType,attr,omitempty"`
	BusTypeDesc        string          `xml:"busTypeDesc,attr,omitempty"`
	BusSubType         string          `xml:"busSubType,attr,omitempty"`
	AttachedVmCount    int32           `xml:"attachedVmCount,attr,omitempty"`
	IsAttached         bool            `xml:"isAttached,attr,omitempty"`
	IsShareable        bool            `xml:"isShareable,attr,omitempty"`
	Link               []*types.Link   `xml:"Link,omitempty"`
	Metadata           *types.Metadata `xml:"Metadata,omitempty"`
}

Type for a single disk query result in records format. Reference: vCloud API 35.0 - QueryResultDiskRecordType https://code.vmware.com/apis/1046/vmware-cloud-director/doc/doc/types/QueryResultDiskRecordType.html

type DiskSection

type DiskSection struct {
	DiskSettings []*DiskSettings `xml:"DiskSettings"`
}

type DiskSettings

type DiskSettings struct {
	DiskId              string           `xml:"DiskId,omitempty"`              // Specifies a unique identifier for this disk in the scope of the corresponding VM. This element is optional when creating a VM, but if it is provided it should be unique. This element is mandatory when updating an existing disk.
	SizeMb              int64            `xml:"SizeMb"`                        // The size of the disk in MB.
	UnitNumber          int              `xml:"UnitNumber"`                    // The device number on the SCSI or IDE controller of the disk.
	BusNumber           int              `xml:"BusNumber"`                     //	The number of the SCSI or IDE controller itself.
	AdapterType         string           `xml:"AdapterType"`                   // The type of disk controller, e.g. IDE vs SCSI and if SCSI bus-logic vs LSI logic.
	ThinProvisioned     *bool            `xml:"ThinProvisioned,omitempty"`     // Specifies whether the disk storage is pre-allocated or allocated on demand.
	Disk                *types.Reference `xml:"Disk,omitempty"`                // Specifies reference to a named disk.
	StorageProfile      *types.Reference `xml:"StorageProfile,omitempty"`      // Specifies reference to a storage profile to be associated with the disk.
	OverrideVmDefault   bool             `xml:"overrideVmDefault"`             // Specifies that the disk storage profile overrides the VM's default storage profile.
	Iops                *int64           `xml:"iops,omitempty"`                // Specifies the IOPS for the disk.
	VirtualQuantity     *int64           `xml:"VirtualQuantity,omitempty"`     // The actual size of the disk.
	VirtualQuantityUnit string           `xml:"VirtualQuantityUnit,omitempty"` // The units in which VirtualQuantity is measured.
	Resizable           bool             `xml:"resizable"`
	Shareable           bool             `xml:"shareable"`
	SharingType         string           `xml:"sharingType"`
}

type EntityType

type EntityType struct {
	ID      string                 `json:"id"`
	Name    string                 `json:"name"`
	Nss     string                 `json:"nss"`
	Version string                 `json:"version"`
	Schema  map[string]interface{} `json:"schema"`
}

EntityType contains only the required properties in get entity type response

type ExtraConfig

type ExtraConfig struct {
	Key      string `xml:"key,attr"`
	Value    string `xml:"value,attr"`
	Required bool   `xml:"required,attr"`
}

type ExtraConfigMarshal

type ExtraConfigMarshal struct {
	Key      string `xml:"vmw:key,attr"`
	Value    string `xml:"vmw:value,attr"`
	Required bool   `xml:"ovf:required,attr"`
}

type ExtraConfigVirtualHardwareSection

type ExtraConfigVirtualHardwareSection struct {
	XMLName xml.Name `xml:"VirtualHardwareSection"`
	Xmlns   string   `xml:"vcloud,attr,omitempty"`
	NS10    string   `xml:"ns10,attr,omitempty"`

	Info string `xml:"Info"`
	HREF string `xml:"href,attr,omitempty"`
	Type string `xml:"type,attr,omitempty"`

	Items        []*VirtualHardwareItem `xml:"Item,omitempty"`
	ExtraConfigs []*ExtraConfig         `xml:"ExtraConfig,omitempty"`
	Links        types.LinkList         `xml:"Link,omitempty"`
}

type ExtraConfigVirtualHardwareSectionMarshal

type ExtraConfigVirtualHardwareSectionMarshal struct {
	NS10 string `xml:"xmlns:ns10,attr,omitempty"`

	Info         string                        `xml:"ovf:Info"`
	Items        []*VirtualHardwareItemMarshal `xml:"ovf:Item,omitempty"`
	ExtraConfigs []*ExtraConfigMarshal         `xml:"vmw:ExtraConfig,omitempty"`
}

type GatewayBusyError

type GatewayBusyError struct {
	GatewayName string
}

func NewGatewayBusyError

func NewGatewayBusyError(gatewayName string) *GatewayBusyError

func (*GatewayBusyError) Error

func (gatewayBusyError *GatewayBusyError) Error() string

type GatewayManager

type GatewayManager struct {
	NetworkName        string
	GatewayRef         *swaggerClient.EntityReference
	NetworkBackingType swaggerClient.BackingNetworkType
	// Client will be refreshed before each call
	Client     *Client
	IPAMSubnet string
}

func NewGatewayManager

func NewGatewayManager(ctx context.Context, client *Client, networkName string, ipamSubnet string, ovdcName string) (*GatewayManager, error)

func (*GatewayManager) CheckIfVirtualServiceIsPending

func (gatewayManager *GatewayManager) CheckIfVirtualServiceIsPending(ctx context.Context, virtualServiceName string) error

func (*GatewayManager) CreateAppPortProfile

func (gatewayManager *GatewayManager) CreateAppPortProfile(appPortProfileName string, externalPort int32) (*govcd.NsxtAppPortProfile, error)

func (*GatewayManager) CreateDNATRule

func (gatewayManager *GatewayManager) CreateDNATRule(ctx context.Context, dnatRuleName string,
	externalIP string, internalIP string, externalPort int32, internalPort int32, appPortProfile *govcd.NsxtAppPortProfile) error

func (*GatewayManager) CreateLoadBalancer

func (gm *GatewayManager) CreateLoadBalancer(ctx context.Context, virtualServiceNamePrefix string, lbPoolNamePrefix string,
	ips []string, portDetailsList []PortDetails, oneArm *OneArm, enableVirtualServiceSharedIP bool,
	portNameToIP map[string]string, providedIP string, resourcesAllocated *util.AllocatedResourcesMap) (string, error)

func (*GatewayManager) CreateLoadBalancerPool

func (gatewayManager *GatewayManager) CreateLoadBalancerPool(ctx context.Context, lbPoolName string, lbPoolIPList []string,
	internalPort int32, protocol string) (*swaggerClient.EntityReference, error)

func (*GatewayManager) CreateVirtualService

func (gatewayManager *GatewayManager) CreateVirtualService(ctx context.Context, virtualServiceName string,
	lbPoolRef *swaggerClient.EntityReference, segRef *swaggerClient.EntityReference,
	freeIP string, vsType string, externalPort int32,
	useSSL bool, certificateAlias string) (*swaggerClient.EntityReference, error)

func (*GatewayManager) DeleteAppPortProfile

func (gatewayManager *GatewayManager) DeleteAppPortProfile(appPortProfileName string, failIfAbsent bool) error

DeleteAppPortProfile deletes app port profile if present. No error is returned if the app port profile with the provided name is not present in VCD

func (*GatewayManager) DeleteDNATRule

func (gatewayManager *GatewayManager) DeleteDNATRule(ctx context.Context, dnatRuleName string,
	failIfAbsent bool) error

Note that this also deletes App Port Profile Config. So we always need to call this even if we don't find a DNAT rule, to ensure that everything is cleaned up.

func (*GatewayManager) DeleteLoadBalancer

func (gm *GatewayManager) DeleteLoadBalancer(ctx context.Context, virtualServiceNamePrefix string,
	lbPoolNamePrefix string, portDetailsList []PortDetails, oneArm *OneArm, resourcesDeallocated *util.AllocatedResourcesMap) (string, error)

func (*GatewayManager) DeleteLoadBalancerPool

func (gatewayManager *GatewayManager) DeleteLoadBalancerPool(ctx context.Context, lbPoolName string,
	failIfAbsent bool) error

func (*GatewayManager) DeleteVirtualService

func (gatewayManager *GatewayManager) DeleteVirtualService(ctx context.Context, virtualServiceName string,
	failIfAbsent bool) error

func (*GatewayManager) GetLoadBalancer

func (gatewayManager *GatewayManager) GetLoadBalancer(ctx context.Context, virtualServiceName string, lbPoolName string, oneArm *OneArm) (string, *util.AllocatedResourcesMap, error)

GetLoadBalancer :

func (*GatewayManager) GetLoadBalancerPool

func (gatewayManager *GatewayManager) GetLoadBalancerPool(ctx context.Context, lbPoolName string) (*swaggerClient.EntityReference, error)

func (*GatewayManager) GetLoadBalancerPoolMemberIPs

func (gatewayManager *GatewayManager) GetLoadBalancerPoolMemberIPs(ctx context.Context, lbPoolRef *swaggerClient.EntityReference) ([]string, error)

func (*GatewayManager) GetLoadBalancerSEG

func (gatewayManager *GatewayManager) GetLoadBalancerSEG(ctx context.Context) (*swaggerClient.EntityReference, error)

TODO: There could be a race here as we don't book a slot. Retry repeatedly to get a LB Segment.

func (*GatewayManager) GetNATRuleRef

func (gatewayManager *GatewayManager) GetNATRuleRef(ctx context.Context, natRuleName string) (*NatRuleRef, error)

GetNATRuleRef: returns nil if the rule is not found;

func (*GatewayManager) GetUnusedExternalIPAddress

func (gm *GatewayManager) GetUnusedExternalIPAddress(ctx context.Context, allowedIPAMSubnetStr string) (string, error)

GetUnusedExternalIPAddress returns the first unused IP address in the gateway from an ipamSubnet There are races here since there is no 'acquisition' of an IP. However, since k8s retries, it will be correct.

func (*GatewayManager) GetUnusedInternalIPAddress

func (gm *GatewayManager) GetUnusedInternalIPAddress(ctx context.Context, oneArm *OneArm) (string, error)

func (*GatewayManager) GetVirtualService

func (gatewayManager *GatewayManager) GetVirtualService(ctx context.Context,
	virtualServiceName string) (*swaggerClient.EdgeLoadBalancerVirtualServiceSummary, error)

func (*GatewayManager) IsNSXTBackedGateway

func (gatewayManager *GatewayManager) IsNSXTBackedGateway() bool

IsNSXTBackedGateway : return true if gateway is backed by NSX-T

func (*GatewayManager) UpdateAppPortProfile

func (gatewayManager *GatewayManager) UpdateAppPortProfile(appPortProfileName string, externalPort int32) (*govcd.NsxtAppPortProfile, error)

func (*GatewayManager) UpdateDNATRule

func (gatewayManager *GatewayManager) UpdateDNATRule(ctx context.Context, dnatRuleName string, externalIP string, internalIP string, externalPort int32) (*NatRuleRef, error)

func (*GatewayManager) UpdateLoadBalancer

func (gm *GatewayManager) UpdateLoadBalancer(ctx context.Context, lbPoolName string, virtualServiceName string,
	ips []string, externalIP string, internalPort int32, externalPort int32, oneArm *OneArm, enableVirtualServiceSharedIP bool, protocol string,
	resourcesAllocated *util.AllocatedResourcesMap) (string, error)

func (*GatewayManager) UpdateLoadBalancerPool

func (gatewayManager *GatewayManager) UpdateLoadBalancerPool(ctx context.Context, lbPoolName string, lbPoolIPList []string,
	internalPort int32, protocol string) (*swaggerClient.EntityReference, error)

func (*GatewayManager) UpdateVirtualService

func (gatewayManager *GatewayManager) UpdateVirtualService(ctx context.Context, virtualServiceName string,
	virtualServiceIP string, externalPort int32, oneArmEnabled bool) (*swaggerClient.EntityReference, error)

type IPRange

type IPRange struct {
	StartIP string
	EndIP   string
}

type LoadBalancerPoolBusyError

type LoadBalancerPoolBusyError struct {
	LBPoolName string
}

func NewLBPoolBusyError

func NewLBPoolBusyError(lbPoolName string) *LoadBalancerPoolBusyError

func (*LoadBalancerPoolBusyError) Error

func (lbPoolError *LoadBalancerPoolBusyError) Error() string

type NatRuleRef

type NatRuleRef struct {
	Name              string
	ID                string
	ExternalIP        string
	InternalIP        string
	ExternalPort      int
	InternalPort      int
	AppPortProfileRef *swaggerClient.EntityReference
}

type NetworkConnection

type NetworkConnection struct {
	Network            string `xml:"network,attr"`            // Name of the network to which this NIC is connected.
	NeedsCustomization bool   `xml:"needsCustomization,attr"` // True if this NIC needs customization.

	NetworkConnectionIndex           int    `xml:"NetworkConnectionIndex"` // Virtual slot number associated with this NIC. First slot number is 0.
	IPAddress                        string `xml:"IpAddress,omitempty"`    // IP address assigned to this NIC.
	IpType                           string `xml:"IpType,omitempty"`
	IsConnected                      bool   `xml:"IsConnected"`             // If the virtual machine is undeployed, this value specifies whether the NIC should be connected upon deployment. If the virtual machine is deployed, this value reports the current status of this NIC's connection, and can be updated to change that connection status.
	MACAddress                       string `xml:"MACAddress,omitempty"`    // MAC address associated with the NIC.
	IPAddressAllocationMode          string `xml:"IpAddressAllocationMode"` // IP address allocation mode for this connection. One of: POOL (A static IP address is allocated automatically from a pool of addresses.) DHCP (The IP address is obtained from a DHCP service.) MANUAL (The IP address is assigned manually in the IpAddress element.) NONE (No IP addressing mode specified.)
	SecondaryIpAddressAllocationMode string `xml:"SecondaryIpAddressAllocationMode"`

	ExternalIPAddress  string `xml:"ExternalIpAddress,omitempty"` // If the network to which this NIC connects provides NAT services, the external address assigned to this NIC appears here.
	NetworkAdapterType string `xml:"NetworkAdapterType,omitempty"`
}

type NetworkConnectionSection

type NetworkConnectionSection struct {
	XMLName     xml.Name `xml:"NetworkConnectionSection"`
	Xmlns       string   `xml:"xmlns,attr,omitempty"`
	OvfRequired string   `xml:"required,attr,omitempty"`

	Info string `xml:"Info"`
	//
	HREF                          string               `xml:"href,attr,omitempty"`
	Type                          string               `xml:"type,attr,omitempty"`
	PrimaryNetworkConnectionIndex int                  `xml:"PrimaryNetworkConnectionIndex"`
	NetworkConnection             []*NetworkConnection `xml:"NetworkConnection,omitempty"`
	Link                          []*types.Link        `xml:"Link,omitempty"`
}

type NetworkConnectionSectionMarshal

type NetworkConnectionSectionMarshal struct {
	XMLName     xml.Name `xml:"NetworkConnectionSection"`
	Xmlns       string   `xml:"xmlns,attr,omitempty"`
	HREF        string   `xml:"href,attr,omitempty"`
	Type        string   `xml:"type,attr,omitempty"`
	OvfRequired string   `xml:"ovf:required,attr,omitempty"`

	Info string `xml:"ovf:Info"`
	//
	PrimaryNetworkConnectionIndex int                  `xml:"PrimaryNetworkConnectionIndex"`
	NetworkConnection             []*NetworkConnection `xml:"NetworkConnection,omitempty"`
	Link                          []*types.Link        `xml:"Link,omitempty"`
}

type NillableElement

type NillableElement struct {
	XmlnsXsi string `xml:"xsi,attr,omitempty"`
	XsiNil   bool   `xml:"xsi:nil,attr,omitempty"`
	Value    string `xml:",chardata"`
}

type NillableElementMarshal

type NillableElementMarshal struct {
	XmlnsXsi string `xml:"xmlns:xsi,attr,omitempty"`
	XsiNil   string `xml:"xsi:nil,attr,omitempty"`
	Value    string `xml:",chardata"`
}

type NoRDEError

type NoRDEError struct {
	// contains filtered or unexported fields
}

NoRDEError is an error used when the InfraID value in the VCDCluster object does not point to a valid RDE in VCD

func NewNoRDEError

func NewNoRDEError(message string) *NoRDEError

func (*NoRDEError) Error

func (nre *NoRDEError) Error() string

type NonCAPVCDEntityError

type NonCAPVCDEntityError struct {
	EntityTypeID string
}

func (NonCAPVCDEntityError) Error

func (e NonCAPVCDEntityError) Error() string

type OneArm

type OneArm struct {
	StartIP string
	EndIP   string
}

type OrgManager

type OrgManager struct {
	// client should be refreshed separately
	Client  *Client
	OrgName string
}

func NewOrgManager

func NewOrgManager(client *Client, orgName string) (*OrgManager, error)

func (*OrgManager) GetCatalogByName

func (orgManager *OrgManager) GetCatalogByName(catalogName string) (*govcd.Catalog, error)

func (*OrgManager) GetComputePolicyDetailsFromName

func (orgManager *OrgManager) GetComputePolicyDetailsFromName(computePolicyName string) (*types.VdcComputePolicy, error)

type PortDetails

type PortDetails struct {
	Protocol     string
	PortSuffix   string
	ExternalPort int32
	InternalPort int32
	UseSSL       bool
	CertAlias    string
}

type QueryResultCatalogRecordType

type QueryResultCatalogRecordType struct {
	Xmlns                 string    `xml:"xmlns,attr,omitempty"`
	HREF                  string    `xml:"href,attr,omitempty"`
	ID                    string    `xml:"id,attr,omitempty"`
	Type                  string    `xml:"type,attr,omitempty"`
	Name                  string    `xml:"name,attr,omitempty"`
	IsPublished           string    `xml:"isPublished,attr,omitempty"`
	IsShared              bool      `xml:"isShared,attr,omitempty"`
	CreationDate          time.Time `xml:"creationDate,attr,omitempty"`
	OrgName               string    `xml:"orgName,attr,omitempty"`
	OwnerName             string    `xml:"ownerName,attr,omitempty"`
	NumberOfVAppTemplates int32     `xml:"numberOfVAppTemplates,attr,omitempty"`
	NumberOfMedia         int32     `xml:"numberOfMedia,attr,omitempty"`
	Owner                 string    `xml:"owner,attr,omitempty"`
}

type QueryResultOrgVdcRecordType

type QueryResultOrgVdcRecordType struct {
	Xmlns                          string `xml:"xmlns,attr,omitempty"`
	HREF                           string `xml:"href,attr,omitempty"`
	ID                             string `xml:"id,attr,omitempty"`
	Type                           string `xml:"type,attr,omitempty"`
	Name                           string `xml:"name,attr,omitempty"`
	Description                    string `xml:"description,attr,omitempty"`
	ComputeProviderScope           string `xml:"computeProviderScope,attr,omitempty"`
	NetworkProviderScope           string `xml:"networkProviderScope,attr,omitempty"`
	IsEnabled                      bool   `xml:"isEnabled,attr,omitempty"`
	CpuAllocationMhz               int64  `xml:"cpuAllocationMhz,attr,omitempty"`
	CpuLimitMhz                    int64  `xml:"cpuLimitMhz,attr,omitempty"`
	CpuUsedMhz                     int64  `xml:"cpuUsedMhz,attr,omitempty"`
	CpuReservedMhz                 int64  `xml:"cpuReservedMhz,attr,omitempty"`
	MemoryAllocationMB             int64  `xml:"memoryAllocationMB,attr,omitempty"`
	MemoryLimitMB                  int64  `xml:"memoryLimitMB,attr,omitempty"`
	MemoryUsedMB                   int64  `xml:"memoryUsedMB,attr,omitempty"`
	MemoryReservedMB               int64  `xml:"memoryReservedMB,attr,omitempty"`
	StorageLimitMB                 int64  `xml:"storageLimitMB,attr,omitempty"`
	StorageUsedMB                  int64  `xml:"storageUsedMB,attr,omitempty"`
	ProviderVdcName                string `xml:"providerVdcName,attr,omitempty"`
	ProviderVdc                    string `xml:"providerVdc,attr,omitempty"`
	OrgName                        string `xml:"orgName,attr,omitempty"`
	NumberOfVApps                  int32  `xml:"numberOfVApps,attr,omitempty"`
	NumberOfUnmanagedVApps         int32  `xml:"numberOfUnmanagedVApps,attr,omitempty"`
	NumberOfMedia                  int32  `xml:"numberOfMedia,attr,omitempty"`
	NumberOfDisks                  int32  `xml:"numberOfDisks,attr,omitempty"`
	NumberOfVAppTemplates          int32  `xml:"numberOfVAppTemplates,attr,omitempty"`
	IsBusy                         bool   `xml:"isBusy,attr,omitempty"`
	Status                         string `xml:"status,attr,omitempty"`
	NumberOfDatastores             int32  `xml:"numberOfDatastores,attr,omitempty"`
	NumberOfStorageProfiles        int32  `xml:"numberOfStorageProfiles,attr,omitempty"`
	NumberOfVMs                    int32  `xml:"numberOfVMs,attr,omitempty"`
	NumberOfRunningVMs             int32  `xml:"numberOfRunningVMs,attr,omitempty"`
	NetworkPoolUniversalId         string `xml:"networkPoolUniversalId,attr,omitempty"`
	NumberOfDeployedVApps          int32  `xml:"numberOfDeployedVApps,attr,omitempty"`
	NumberOfDeployedUnmanagedVApps int32  `xml:"numberOfDeployedUnmanagedVApps,attr,omitempty"`
	IsThinProvisioned              bool   `xml:"isThinProvisioned,attr,omitempty"`
	IsFastProvisioned              bool   `xml:"isFastProvisioned,attr,omitempty"`
}

type QueryResultRecordsType

type QueryResultRecordsType struct {
	Xmlns string `xml:"xmlns,attr,omitempty"`
	// Attributes
	HREF     string  `xml:"href,attr,omitempty"`     // The URI of the entity.
	Type     string  `xml:"type,attr,omitempty"`     // The MIME type of the entity.
	Name     string  `xml:"name,attr,omitempty"`     // The name of the entity.
	Page     int32   `xml:"page,attr,omitempty"`     // Page of the result set that this container holds. The first page is page number 1.
	PageSize int32   `xml:"pageSize,attr,omitempty"` // Page size, as a number of records or references.
	Total    float64 `xml:"total,attr,omitempty"`    // Total number of records or references in the container.
	// Elements
	Link          []*types.Link                   `xml:"Link,omitempty"`          // A reference to an entity or operation associated with this object.
	OrgVdcRecord  []*QueryResultOrgVdcRecordType  `xml:"OrgVdcRecord"`            // A record representing storage profiles
	CatalogRecord []*QueryResultCatalogRecordType `xml:"CatalogRecord,omitempty"` // A record representing Catalog records
}

type RDEManager

type RDEManager struct {
	Client                 *Client
	StatusComponentName    string
	StatusComponentVersion string
	ClusterID              string
}

func NewRDEManager

func NewRDEManager(client *Client, clusterID string, statusComponentName string, statusComponentVersion string) *RDEManager

func (*RDEManager) AddToErrorSet

func (rdeManager *RDEManager) AddToErrorSet(ctx context.Context, componentSectionName string, newError BackendError, rollingWindowSize int) error

TODO requested from Sahithi: 1. Implement a method that takes list of errors (or) list of events 2. When 1 is implemented, modify removeErrorByNameOrIdFromErrorSet to sort elements by timestamps before removal as the order coming in are not necessary sorted by timestamps 3.A method that will remove errors and addition of success event at the same time

func (*RDEManager) AddToEventSet

func (rdeManager *RDEManager) AddToEventSet(ctx context.Context, componentSectionName string, newEvent BackendEvent, rollingWindowSize int) error

AddToEventSet function takes BackendEvent as an input and adds it to the "eventSet" of the specified "componentSectionName" in the RDE status. It caps the size of the "eventSet" in the specified "componentSectionName" to the "rollingWindowSize" by removing the oldest entries.

It raises errors on below conditions. It is caller/component's responsibility to distinguish the errors as either hard (or) soft failures.

  • If rdeId is not valid or empty.
  • If rde.entity.status section is missing
  • If rde is not of type capvcdCluster
  • On any failures while updating the RDE.

Below is the sample structure of the RDE this function operates on. status:

<componentSectionName>:
   eventSet:
     - <newEvent>
     - existingEvent

func (*RDEManager) AddToVCDResourceSet

func (rdeManager *RDEManager) AddToVCDResourceSet(ctx context.Context, component string, resourceType string,
	resourceName string, resourceId string, additionalDetails map[string]interface{}) error

AddToVCDResourceSet adds a VCDResource to the VCDResourceSet of the component in the RDE

func (*RDEManager) IsCapvcdEntityTypeRegistered

func (rdeManager *RDEManager) IsCapvcdEntityTypeRegistered(version string) bool

func (*RDEManager) RemoveErrorByNameOrIdFromErrorSet

func (rdeManager *RDEManager) RemoveErrorByNameOrIdFromErrorSet(ctx context.Context, componentSectionName string, errorName string, vcdResourceId string, vcdResourceName string) error

RemoveErrorByNameOrIdFromErrorSet Given a name (and/or) vcdResourceId of the error, it removes all the matching entries from the errorset of the specified component section in the RDE.status.

Note that vcdResourceId parameter is optional. If a non-empty vcdResourceId is passed, it tries to match both the errorName and vcdResourceId

Below is the RDE portion this function operates on RDE.entity

status
  <componentSectionName> //capvcd, csi, cpi, vkp
      errorSet
         <controlPlaneError>
         <cloudInitError>

func (*RDEManager) RemoveFromVCDResourceSet

func (rdeManager *RDEManager) RemoveFromVCDResourceSet(ctx context.Context, component, resourceType, resourceName string) error

RemoveFromVCDResourceSet removes a VCD resource from the VCDResourceSet property belonging to a component (CPI, CSI or CAPVCD) Removal of a VCDResource from VCDResourceSet is done by name to support removal of the resource from RDE on retries if the resource has been deleted from VCD

type VCDAuthConfig

type VCDAuthConfig struct {
	User         string `json:"user"`
	Password     string `json:"password"`
	RefreshToken string `json:"refreshToken"`
	UserOrg      string `json:"org"`
	Host         string `json:"host"`
	CloudAPIHref string `json:"cloudapihref"`
	VDC          string `json:"vdc"` // TODO: Get rid of
	Insecure     bool   `json:"insecure"`
	IsSysAdmin   bool   // will be set by GetBearerToken()
}

VCDAuthConfig : contains config related to vcd auth

func NewVCDAuthConfigFromSecrets

func NewVCDAuthConfigFromSecrets(host string, user string, secret string,
	refreshToken string, userOrg string, insecure bool) *VCDAuthConfig

func (*VCDAuthConfig) GetBearerToken

func (config *VCDAuthConfig) GetBearerToken() (*govcd.VCDClient, *http.Response, error)

Arvind Bhoj - Replace this whole function as it is

func (*VCDAuthConfig) GetPlainClientFromSecrets

func (config *VCDAuthConfig) GetPlainClientFromSecrets() (*govcd.VCDClient, error)

func (*VCDAuthConfig) GetSwaggerClientFromSecrets

func (config *VCDAuthConfig) GetSwaggerClientFromSecrets() (*govcd.VCDClient, *swaggerClient.APIClient, error)

type VCDResource

type VCDResource struct {
	Type              string                 `json:"type,omitempty"`
	ID                string                 `json:"id,omitempty"`
	Name              string                 `json:"name,omitempty"`
	AdditionalDetails map[string]interface{} `json:"additionalDetails,omitempty"`
}

type VdcManager

type VdcManager struct {
	OrgName string
	VdcName string
	Vdc     *govcd.Vdc
	// client should be refreshed
	Client *Client
}

func NewVDCManager

func NewVDCManager(client *Client, orgName string, vdcName string) (*VdcManager, error)

func (*VdcManager) AddMetadataToVApp

func (vdc *VdcManager) AddMetadataToVApp(VAppName string, paramMap map[string]string) error

func (*VdcManager) AddNewMultipleVM

func (vdc *VdcManager) AddNewMultipleVM(vapp *govcd.VApp, vmNamePrefix string, vmNum int,
	catalogName string, templateName string, placementPolicyName string, computePolicyName string,
	storageProfileName string, guestCustScript string, acceptAllEulas bool, powerOn bool) (govcd.Task, error)

AddNewMultipleVM will create vmNum VMs in parallel, including recompose VApp of all VMs settings, power on VMs and join the cluster with hardcoded script

func (*VdcManager) AddNewTkgVM

func (vdc *VdcManager) AddNewTkgVM(vmNamePrefix string, VAppName string, vmNum int,
	catalogName string, templateName string, placementPolicyName string, computePolicyName string,
	storageProfileName string, powerOn bool) error

func (*VdcManager) AddNewVM

func (vdc *VdcManager) AddNewVM(vmNamePrefix string, VAppName string, vmNum int,
	catalogName string, templateName string, placementPolicyName string, computePolicyName string,
	storageProfileName string, guestCustScript string, powerOn bool) error

func (*VdcManager) DeleteVApp

func (vdc *VdcManager) DeleteVApp(VAppName string) error

func (*VdcManager) DeleteVM

func (vdc *VdcManager) DeleteVM(VAppName, vmName string) error

func (*VdcManager) FindAllVMsInVapp

func (vdc *VdcManager) FindAllVMsInVapp(VAppName string) ([]*types.Vm, error)

func (*VdcManager) FindVMByName

func (vdc *VdcManager) FindVMByName(VAppName string, vmName string) (*govcd.VM, error)

FindVMByName finds a VM in a vApp using the name. The client is expected to have a valid bearer token when this function is called.

func (*VdcManager) FindVMByUUID

func (vdc *VdcManager) FindVMByUUID(VAppName string, vcdVmUUID string) (*govcd.VM, error)

FindVMByUUID finds a VM in a vApp using the UUID. The client is expected to have a valid bearer token when this function is called.

func (*VdcManager) GetExtraConfigValue

func (vdc *VdcManager) GetExtraConfigValue(vm *govcd.VM, key string) (string, error)

func (*VdcManager) GetMetadataByKey

func (vdc *VdcManager) GetMetadataByKey(vApp *govcd.VApp, key string) (value string, err error)

func (*VdcManager) GetOrCreateVApp

func (vdc *VdcManager) GetOrCreateVApp(VAppName string, ovdcNetworkName string) (*govcd.VApp, error)

no need to make reentrant since VCD will take care of it and Kubernetes will retry

func (*VdcManager) GetVAppNameFromVMName

func (vdc *VdcManager) GetVAppNameFromVMName(VAppName string, vmName string) (string, error)

func (*VdcManager) IsVmNotAvailable

func (vdc *VdcManager) IsVmNotAvailable(err error) bool

IsVmNotAvailable : In VCD, if the VM is not available, it can be an access error or the VM may not be present. Hence we sometimes get an error different from govcd.ErrorEntityNotFound

func (*VdcManager) RebootVm

func (vdc *VdcManager) RebootVm(vm *govcd.VM) error

func (*VdcManager) SetVmExtraConfigKeyValue

func (vdc *VdcManager) SetVmExtraConfigKeyValue(vm *govcd.VM, key string, value string, required bool) error

func (*VdcManager) WaitForGuestScriptCompletion

func (vdc *VdcManager) WaitForGuestScriptCompletion(VAppName, vmName string) error

type VirtualHardwareConnectionMarshal

type VirtualHardwareConnectionMarshal struct {
	IpAddressingMode  string `xml:"ns10:ipAddressingMode,attr,omitempty"`
	IPAddress         string `xml:"ns10:ipAddress,attr,omitempty"`
	PrimaryConnection bool   `xml:"ns10:primaryNetworkConnection,attr,omitempty"`
	Value             string `xml:",chardata"`
}

type VirtualHardwareHostResource

type VirtualHardwareHostResource struct {
	BusType           int    `xml:"busType,attr,omitempty"`
	BusSubType        string `xml:"busSubType,attr,omitempty"`
	Capacity          int    `xml:"capacity,attr,omitempty"`
	StorageProfile    string `xml:"storageProfileHref,attr,omitempty"`
	OverrideVmDefault string `xml:"storageProfileOverrideVmDefault,attr,omitempty"`
	Disk              string `xml:"disk,attr,omitempty"`
	Iops              string `xml:"iops,attr,omitempty"`
}

type VirtualHardwareHostResourceMarshal

type VirtualHardwareHostResourceMarshal struct {
	StorageProfile    string `xml:"ns10:storageProfileHref,attr,omitempty"`
	BusType           int    `xml:"ns10:busType,attr,omitempty"`
	BusSubType        string `xml:"ns10:busSubType,attr,omitempty"`
	Capacity          int    `xml:"ns10:capacity,attr,omitempty"`
	Iops              string `xml:"ns10:iops,attr,omitempty"`
	OverrideVmDefault string `xml:"ns10:storageProfileOverrideVmDefault,attr,omitempty"`
}

type VirtualHardwareItem

type VirtualHardwareItem struct {
	XMLName xml.Name `xml:"Item"`
	Type    string   `xml:"type,attr,omitempty"`
	Href    string   `xml:"href,attr,omitempty"`

	Address               *NillableElement                   `xml:"Address"`
	AddressOnParent       *NillableElement                   `xml:"AddressOnParent"`
	AllocationUnits       *NillableElement                   `xml:"AllocationUnits"`
	AutomaticAllocation   *NillableElement                   `xml:"AutomaticAllocation"`
	AutomaticDeallocation *NillableElement                   `xml:"AutomaticDeallocation"`
	ConfigurationName     *NillableElement                   `xml:"ConfigurationName"`
	Connection            []*types.VirtualHardwareConnection `xml:"Connection,omitempty"`
	ConsumerVisibility    *NillableElement                   `xml:"ConsumerVisibility"`
	Description           *NillableElement                   `xml:"Description"`
	ElementName           *NillableElement                   `xml:"ElementName"`
	Generation            *NillableElement                   `xml:"Generation"`
	HostResource          []*VirtualHardwareHostResource     `xml:"HostResource,omitempty"`
	InstanceID            int                                `xml:"InstanceID,omitempty"`
	Limit                 *NillableElement                   `xml:"Limit"`
	MappingBehavior       *NillableElement                   `xml:"MappingBehavior"`
	OtherResourceType     *NillableElement                   `xml:"OtherResourceType"`
	Parent                *NillableElement                   `xml:"Parent"`
	PoolID                *NillableElement                   `xml:"PoolID"`
	Reservation           *NillableElement                   `xml:"Reservation"`
	ResourceSubType       *NillableElement                   `xml:"ResourceSubType"`
	ResourceType          *NillableElementMarshal            `xml:"ResourceType"`
	VirtualQuantity       *NillableElement                   `xml:"VirtualQuantity"`
	VirtualQuantityUnits  *NillableElement                   `xml:"VirtualQuantityUnits"`
	Weight                *NillableElement                   `xml:"Weight"`

	CoresPerSocket *CoresPerSocket `xml:"CoresPerSocket,omitempty"`
	Link           []*types.Link   `xml:"Link,omitempty"`
}

type VirtualHardwareItemMarshal

type VirtualHardwareItemMarshal struct {
	XMLName xml.Name `xml:"ovf:Item"`
	Type    string   `xml:"ns10:type,attr,omitempty"`
	Href    string   `xml:"ns10:href,attr,omitempty"`

	Address               *NillableElementMarshal               `xml:"rasd:Address"`
	AddressOnParent       *NillableElementMarshal               `xml:"rasd:AddressOnParent"`
	AllocationUnits       *NillableElementMarshal               `xml:"rasd:AllocationUnits"`
	AutomaticAllocation   *NillableElementMarshal               `xml:"rasd:AutomaticAllocation"`
	AutomaticDeallocation *NillableElementMarshal               `xml:"rasd:AutomaticDeallocation"`
	ConfigurationName     *NillableElementMarshal               `xml:"rasd:ConfigurationName"`
	Connection            []*VirtualHardwareConnectionMarshal   `xml:"rasd:Connection,omitempty"`
	ConsumerVisibility    *NillableElementMarshal               `xml:"rasd:ConsumerVisibility"`
	Description           *NillableElementMarshal               `xml:"rasd:Description"`
	ElementName           *NillableElementMarshal               `xml:"rasd:ElementName,omitempty"`
	Generation            *NillableElementMarshal               `xml:"rasd:Generation"`
	HostResource          []*VirtualHardwareHostResourceMarshal `xml:"rasd:HostResource,omitempty"`
	InstanceID            int                                   `xml:"rasd:InstanceID"`
	Limit                 *NillableElementMarshal               `xml:"rasd:Limit"`
	MappingBehavior       *NillableElementMarshal               `xml:"rasd:MappingBehavior"`
	OtherResourceType     *NillableElementMarshal               `xml:"rasd:OtherResourceType"`
	Parent                *NillableElementMarshal               `xml:"rasd:Parent"`
	PoolID                *NillableElementMarshal               `xml:"rasd:PoolID"`
	Reservation           *NillableElementMarshal               `xml:"rasd:Reservation"`
	ResourceSubType       *NillableElementMarshal               `xml:"rasd:ResourceSubType"`
	ResourceType          *NillableElementMarshal               `xml:"rasd:ResourceType"`
	VirtualQuantity       *NillableElementMarshal               `xml:"rasd:VirtualQuantity"`
	VirtualQuantityUnits  *NillableElementMarshal               `xml:"rasd:VirtualQuantityUnits"`
	Weight                *NillableElementMarshal               `xml:"rasd:Weight"`

	CoresPerSocket *CoresPerSocketMarshal `xml:"vmw:CoresPerSocket,omitempty"`
	Link           []*types.Link          `xml:"Link,omitempty"`
}

type VirtualServiceBusyError

type VirtualServiceBusyError struct {
	VirtualServiceName string
}

func NewVirtualServiceBusyError

func NewVirtualServiceBusyError(virtualServiceName string) *VirtualServiceBusyError

func (*VirtualServiceBusyError) Error

func (vsError *VirtualServiceBusyError) Error() string

type VirtualServicePendingError

type VirtualServicePendingError struct {
	VirtualServiceName string
}

func NewVirtualServicePendingError

func NewVirtualServicePendingError(virtualServiceName string) *VirtualServicePendingError

func (*VirtualServicePendingError) Error

func (vsError *VirtualServicePendingError) Error() string

type Vm

type Vm struct {
	Xmlns                   string `xml:"xmlns,attr,omitempty"`
	Vmext                   string `xml:"vmext,attr,omitempty"`
	Ovf                     string `xml:"ovf,attr,omitempty"`
	Vssd                    string `xml:"vssd,attr,omitempty"`
	Common                  string `xml:"common,attr,omitempty"`
	Rasd                    string `xml:"rasd,attr,omitempty"`
	Vmw                     string `xml:"vmw,attr,omitempty"`
	Ovfenv                  string `xml:"ovfenv,attr,omitempty"`
	Ns9                     string `xml:"ns9,attr,omitempty"`
	NeedsCustomization      string `xml:"needsCustomization,attr,omitempty"`
	NestedHypervisorEnabled string `xml:"nestedHypervisorEnabled,attr,omitempty"`
	Deployed                string `xml:"deployed,attr,omitempty"`
	Status                  string `xml:"status,attr,omitempty"`
	Name                    string `xml:"name,attr,omitempty"`
	Id                      string `xml:"id,attr,omitempty"`
	Href                    string `xml:"href,attr,omitempty"`
	Type                    string `xml:"type,attr,omitempty"`

	Description                       string                             `xml:"Description,omitempty"`
	VmSpecSection                     *VmSpecSection                     `xml:"VmSpecSection,omitempty"`
	ExtraConfigVirtualHardwareSection *ExtraConfigVirtualHardwareSection `xml:"VirtualHardwareSection,omitempty"`
	NetworkConnectionSection          *NetworkConnectionSection          `xml:"NetworkConnectionSection,omitempty"`
}

type VmMarshal

type VmMarshal struct {
	XMLName xml.Name `xml:"Vm"`

	Xmlns                   string `xml:"xmlns,attr,omitempty"`
	Vmext                   string `xml:"xmlns:vmext,attr,omitempty"`
	Ovf                     string `xml:"xmlns:ovf,attr,omitempty"`
	Vssd                    string `xml:"xmlns:vssd,attr,omitempty"`
	Common                  string `xml:"xmlns:common,attr,omitempty"`
	Rasd                    string `xml:"xmlns:rasd,attr,omitempty"`
	Vmw                     string `xml:"xmlns:vmw,attr,omitempty"`
	Ovfenv                  string `xml:"xmlns:ovfenv,attr,omitempty"`
	Ns9                     string `xml:"xmlns:ns9,attr,omitempty"`
	NeedsCustomization      string `xml:"needsCustomization,attr,omitempty"`
	NestedHypervisorEnabled string `xml:"nestedHypervisorEnabled,attr,omitempty"`
	Deployed                string `xml:"deployed,attr,omitempty"`
	Status                  string `xml:"status,attr,omitempty"`
	Name                    string `xml:"name,attr,omitempty"`
	Id                      string `xml:"id,attr,omitempty"`
	Href                    string `xml:"href,attr,omitempty"`
	Type                    string `xml:"type,attr,omitempty"`

	Description              string                                    `xml:"Description,omitempty"`
	VmSpecSection            *VmSpecSectionMarshal                     `xml:"VmSpecSection,omitempty"`
	VirtualHardwareSection   *ExtraConfigVirtualHardwareSectionMarshal `xml:"ovf:VirtualHardwareSection,omitempty"`
	NetworkConnectionSection *NetworkConnectionSectionMarshal          `xml:"NetworkConnectionSection,omitempty"`
}

type VmSpecSection

type VmSpecSection struct {
	Modified          *bool                   `xml:"Modified,attr,omitempty"`
	Info              string                  `xml:"Info"`
	OsType            string                  `xml:"OsType,omitempty"`            // The type of the OS. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	NumCpus           *int                    `xml:"NumCpus,omitempty"`           // Number of CPUs. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	NumCoresPerSocket *int                    `xml:"NumCoresPerSocket,omitempty"` // Number of cores among which to distribute CPUs in this virtual machine. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	CpuResourceMhz    *types.CpuResourceMhz   `xml:"CpuResourceMhz,omitempty"`    // CPU compute resources. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	MemoryResourceMb  *types.MemoryResourceMb `xml:"MemoryResourceMb"`            // Memory compute resources. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	MediaSection      *types.MediaSection     `xml:"MediaSection,omitempty"`      // The media devices of this VM.
	DiskSection       *DiskSection            `xml:"DiskSection,omitempty"`       // virtual disks of this VM.
	HardwareVersion   *types.HardwareVersion  `xml:"HardwareVersion"`             // vSphere name of Virtual Hardware Version of this VM. Example: vmx-13 - This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	VmToolsVersion    string                  `xml:"VmToolsVersion,omitempty"`    // VMware tools version of this VM.
	VirtualCpuType    string                  `xml:"VirtualCpuType,omitempty"`    // The capabilities settings for this VM. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	TimeSyncWithHost  *bool                   `xml:"TimeSyncWithHost,omitempty"`  // Synchronize the VM's time with the host.
}

type VmSpecSectionMarshal

type VmSpecSectionMarshal struct {
	Modified          *bool                   `xml:"Modified,attr,omitempty"`
	Info              string                  `xml:"ovf:Info"`
	OsType            string                  `xml:"OsType,omitempty"`            // The type of the OS. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	NumCpus           *int                    `xml:"NumCpus,omitempty"`           // Number of CPUs. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	NumCoresPerSocket *int                    `xml:"NumCoresPerSocket,omitempty"` // Number of cores among which to distribute CPUs in this virtual machine. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	CpuResourceMhz    *types.CpuResourceMhz   `xml:"CpuResourceMhz,omitempty"`    // CPU compute resources. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	MemoryResourceMb  *types.MemoryResourceMb `xml:"MemoryResourceMb"`            // Memory compute resources. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	MediaSection      *types.MediaSection     `xml:"MediaSection,omitempty"`      // The media devices of this VM.
	DiskSection       *DiskSection            `xml:"DiskSection,omitempty"`       // virtual disks of this VM.
	HardwareVersion   *types.HardwareVersion  `xml:"HardwareVersion"`             // vSphere name of Virtual Hardware Version of this VM. Example: vmx-13 - This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	VmToolsVersion    string                  `xml:"VmToolsVersion,omitempty"`    // VMware tools version of this VM.
	VirtualCpuType    string                  `xml:"VirtualCpuType,omitempty"`    // The capabilities settings for this VM. This parameter may be omitted when using the VmSpec to update the contents of an existing VM.
	TimeSyncWithHost  *bool                   `xml:"TimeSyncWithHost,omitempty"`  // Synchronize the VM's time with the host.
}

type Vms

type Vms struct {
	XMLName xml.Name `xml:"Vms"`
	Xmlns   string   `xml:"xmlns,attr,omitempty"`

	HREF string `xml:"href,attr"`
	Type string `xml:"type,attr"`

	// Elements
	Link            []*types.Link          `xml:"Link,omitempty"`
	VCloudExtension *types.VCloudExtension `xml:"VCloudExtension,omitempty"`
	VmReference     []*types.Reference     `xml:"VmReference,omitempty"`
}

Represents a list of virtual machines Reference: vCloud API 35.0 - VmsType https://code.vmware.com/apis/1046/vmware-cloud-director/doc/doc/types/VmsType.html

Jump to

Keyboard shortcuts

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