Documentation ¶
Overview ¶
Package client is the main client for the CloudAvenue provider.
Package client is the main client for the CloudAvenue provider.
Index ¶
- Variables
- type AdminOrg
- type AdminVDC
- type CloudAvenue
- func (c *CloudAvenue) DefaultAdminVDCExist() bool
- func (c *CloudAvenue) DefaultVDCExist() bool
- func (c *CloudAvenue) GetAdminOrg() (*AdminOrg, error)
- func (c CloudAvenue) GetAdminVDC(opts ...GetAdminVDCOpts) (*AdminVDC, error)
- func (c *CloudAvenue) GetAffinityRule(affinityRuleID string) (affinityRule *govcd.VdcComputePolicyV2, err error)
- func (c *CloudAvenue) GetBootImage(bootImageID string) (bootImage *govcdtypes.Media, err error)
- func (c *CloudAvenue) GetDefaultVDC() string
- func (c *CloudAvenue) GetOrg() (*Org, error)
- func (c *CloudAvenue) GetOrgAndVDC(orgName, vdcName string) (org *govcd.Org, vdcOrVDCGroup VDCOrVDCGroupHandler, err error)
- func (c *CloudAvenue) GetOrgName() string
- func (c *CloudAvenue) GetTemplate(iD string) (vAppTemplate *govcd.VAppTemplate, err error)
- func (c *CloudAvenue) GetTemplateWithVMName(iD, vmName string) (vAppTemplate *govcd.VAppTemplate, err error)
- func (c *CloudAvenue) GetURL() string
- func (c *CloudAvenue) GetVDC(opts ...GetVDCOpts) (*VDC, error)
- func (c *CloudAvenue) GetVDCGroup(vdcGroupName string) (*VDCGroup, error)
- func (c *CloudAvenue) GetVDCOrVDCGroup(vdcOrVDCGroupName string) (VDCOrVDCGroupHandler, error)
- func (c *CloudAvenue) New() (*CloudAvenue, error)
- type GetAdminVDCOpts
- type GetVDCOpts
- type Org
- func (o *Org) DeleteNetworkDHCP(orgNetworkID string) error
- func (o *Org) GetID() string
- func (o *Org) GetName() string
- func (o *Org) GetNetworkDHCP(orgNetworkID string) (*govcd.OpenApiOrgVdcNetworkDhcp, error)
- func (o *Org) UpdateNetworkDHCP(orgNetworkID string, dhcpParameters *govcdtypes.OpenApiOrgVdcNetworkDhcp) error
- type VAPP
- func (v VAPP) GetDeploymentLeaseInSeconds() int
- func (v VAPP) GetDescription() string
- func (v VAPP) GetHREF() string
- func (v VAPP) GetID() string
- func (v VAPP) GetName() string
- func (v VAPP) GetStatusCode() int
- func (v VAPP) GetStorageLeaseInSeconds() int
- func (v VAPP) IsVAPPNetwork(networkName string) (bool, error)
- func (v VAPP) IsVAPPOrgNetwork(networkName string) (bool, error)
- type VDC
- func (v VDC) CreateVAPP(name, description string) (*VAPP, error)
- func (v VDC) GetDefaultPlacementPolicyID() string
- func (v VDC) GetID() string
- func (v VDC) GetIPSetByID(id string) (*govcd.NsxtFirewallGroup, error)
- func (v VDC) GetIPSetByName(name string) (*govcd.NsxtFirewallGroup, error)
- func (v VDC) GetIPSetByNameOrID(nameOrID string) (*govcd.NsxtFirewallGroup, error)
- func (v VDC) GetName() string
- func (v VDC) GetSecurityGroupByID(nsxtFirewallGroupID string) (*govcd.NsxtFirewallGroup, error)
- func (v VDC) GetSecurityGroupByName(nsxtFirewallGroupName string) (*govcd.NsxtFirewallGroup, error)
- func (v VDC) GetSecurityGroupByNameOrID(nsxtFirewallGroupNameOrID string) (*govcd.NsxtFirewallGroup, error)
- func (v VDC) GetVAPP(nameOrID string, refresh bool) (*VAPP, error)
- func (v VDC) IsVDCGroup() bool
- func (v VDC) SetIPSet(ipSetConfig *govcdtypes.NsxtFirewallGroup) (*govcd.NsxtFirewallGroup, error)
- type VDCGroup
- func (g VDCGroup) GetID() string
- func (g VDCGroup) GetIPSetByID(id string) (*govcd.NsxtFirewallGroup, error)
- func (g VDCGroup) GetIPSetByName(name string) (*govcd.NsxtFirewallGroup, error)
- func (g VDCGroup) GetIPSetByNameOrID(nameOrID string) (*govcd.NsxtFirewallGroup, error)
- func (g VDCGroup) GetName() string
- func (g VDCGroup) GetSecurityGroupByID(nsxtFirewallGroupID string) (*govcd.NsxtFirewallGroup, error)
- func (g VDCGroup) GetSecurityGroupByName(nsxtFirewallGroupName string) (*govcd.NsxtFirewallGroup, error)
- func (g VDCGroup) GetSecurityGroupByNameOrID(nsxtFirewallGroupNameOrID string) (*govcd.NsxtFirewallGroup, error)
- func (g VDCGroup) IsVDCGroup() bool
- func (g VDCGroup) SetIPSet(ipSetConfig *govcdtypes.NsxtFirewallGroup) (*govcd.NsxtFirewallGroup, error)
- type VDCOrVDCGroupHandler
- type VM
- func (v VM) CpusCoresIsDefined() bool
- func (v VM) CpusIsDefined() bool
- func (v VM) GetAffinityRuleID() string
- func (v VM) GetAffinityRuleIDOrDefault() (string, error)
- func (v VM) GetCPUHotAddEnabled() bool
- func (v VM) GetCpus() int
- func (v VM) GetCpusCores() int
- func (v VM) GetCustomization() (guestCustomization *govcdtypes.GuestCustomizationSection, err error)
- func (v VM) GetDefaultAffinityRuleID() (string, error)
- func (v VM) GetExposeHardwareVirtualization() bool
- func (v VM) GetGuestProperties() (guestProperties []*govcdtypes.Property, err error)
- func (v VM) GetMemory() int64
- func (v VM) GetMemoryHotAddEnabled() bool
- func (v VM) GetNetworkConnection() (networkConnections []*govcdtypes.NetworkConnection)
- func (v VM) GetOSType() string
- func (v VM) GetStorageProfileName() string
- func (v VM) HotAddIsDefined() bool
- func (v VM) MemoryIsDefined() bool
- func (v VM) NetworkConnectionIsDefined() bool
- func (v VM) SetCustomization(guestCustomization *govcdtypes.GuestCustomizationSection) (err error)
- func (v VM) SetExposeHardwareVirtualization(isEnabled bool) (err error)
- func (v VM) SetGuestProperties(guestProperties map[string]string) (err error)
- func (v VM) SetOSType(osType string) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAuthFailed is returned when the authentication failed. ErrAuthFailed = errors.New("authentication error") // ErrTokenEmpty is returned when the token is empty. ErrTokenEmpty = errors.New("token is empty") // ErrConfigureVmware is returned when the configuration of vmware failed. ErrConfigureVmware = errors.New("error configuring vmware") ErrVCDVersionEmpty = errors.New("empty vcd version") // ErrConfigureNetBackup is returned when the configuration of netbackup failed. ErrConfigureNetBackup = errors.New("error configuring netbackup") )
var ( ErrEmptyOrgNameProvided = errors.New("empty Org name provided") ErrEmptyVDCNameProvided = errors.New("empty VDC name provided") ErrRetrievingOrg = errors.New("error retrieving Org") ErrRetrievingOrgAdmin = errors.New("error retrieving Org admin") ErrEmptyOrgFound = errors.New("empty Org found") ErrRetrievingVDC = errors.New("error retrieving VDC") ErrRetrievingAdminVDC = errors.New("error retrieving AdminVDC") ErrRetrievingVDCGroup = errors.New("error retrieving VDC Group") ErrEmptyVDCFound = errors.New("empty VDC found") )
Functions ¶
This section is empty.
Types ¶
type AdminOrg ¶
func (*AdminOrg) GetOrgVAppLeaseSettings ¶ added in v0.2.0
func (ao *AdminOrg) GetOrgVAppLeaseSettings() *govcdtypes.VAppLeaseSettings
GetOrgVAppLeaseSettings retrieves the lease settings for a vApp in the specified organization.
func (*AdminOrg) ListCatalogs ¶
func (ao *AdminOrg) ListCatalogs() *govcdtypes.CatalogsList
ListCatalogs
Get the catalogs list from the admin org.
type CloudAvenue ¶
type CloudAvenue struct { Org string VDC string User string Password string URL string TerraformVersion string CloudAvenueVersion string // API CLOUDAVENUE APIClient *apiclient.APIClient Auth context.Context // API VMWARE Vmware *govcd.VCDClient VCDVersion string // API Backup of NetBackup BackupClient *clientca.Client BackupOpts *clientca.ClientOpts // contains filtered or unexported fields }
CloudAvenue is the main struct for the CloudAvenue client.
func (*CloudAvenue) DefaultAdminVDCExist ¶ added in v0.3.0
func (c *CloudAvenue) DefaultAdminVDCExist() bool
func (*CloudAvenue) DefaultVDCExist ¶
func (c *CloudAvenue) DefaultVDCExist() bool
DefaultVDCExist returns true if the default VDC exists.
func (*CloudAvenue) GetAdminOrg ¶
func (c *CloudAvenue) GetAdminOrg() (*AdminOrg, error)
GetAdminOrg return the admin org using the name provided in the provider.
func (CloudAvenue) GetAdminVDC ¶ added in v0.3.0
func (c CloudAvenue) GetAdminVDC(opts ...GetAdminVDCOpts) (*AdminVDC, error)
GetAdminVdc return the admin vdc using the name provided in the provider.
func (*CloudAvenue) GetAffinityRule ¶ added in v0.3.0
func (c *CloudAvenue) GetAffinityRule(affinityRuleID string) (affinityRule *govcd.VdcComputePolicyV2, err error)
getAffinityRule retrieves an affinity rule by name.
func (*CloudAvenue) GetBootImage ¶ added in v0.3.0
func (c *CloudAvenue) GetBootImage(bootImageID string) (bootImage *govcdtypes.Media, err error)
GetBootImage retrieves a boot image by ID.
func (*CloudAvenue) GetDefaultVDC ¶
func (c *CloudAvenue) GetDefaultVDC() string
GetDefaultVDC returns the default VDC.
func (*CloudAvenue) GetOrg ¶
func (c *CloudAvenue) GetOrg() (*Org, error)
GetOrg return the org using the name provided in the provider.
func (*CloudAvenue) GetOrgAndVDC ¶
func (c *CloudAvenue) GetOrgAndVDC(orgName, vdcName string) (org *govcd.Org, vdcOrVDCGroup VDCOrVDCGroupHandler, err error)
! Deprecated
GetOrgAndVDC ¶
finds a pair of org and vdc using the names provided in the args. If the names are empty, it will use the default org and vdc names from the provider.
DEPRECATED: use GetOrg, GetVDC, GetVDCGroup or GetVDCOrVDCGroup instead.
func (*CloudAvenue) GetOrgName ¶
func (c *CloudAvenue) GetOrgName() string
GetOrgName() returns the name of the organization.
func (*CloudAvenue) GetTemplate ¶ added in v0.3.0
func (c *CloudAvenue) GetTemplate(iD string) (vAppTemplate *govcd.VAppTemplate, err error)
GetTemplate retrieves a vApp template by name or ID.
func (*CloudAvenue) GetTemplateWithVMName ¶ added in v0.3.0
func (c *CloudAvenue) GetTemplateWithVMName(iD, vmName string) (vAppTemplate *govcd.VAppTemplate, err error)
GetTemplateWithVMName retrieves a vApp template with a VM name.
func (*CloudAvenue) GetURL ¶
func (c *CloudAvenue) GetURL() string
GetURL returns the base path of the API.
func (*CloudAvenue) GetVDC ¶
func (c *CloudAvenue) GetVDC(opts ...GetVDCOpts) (*VDC, error)
GetVDC return the vdc using the name provided in the argument. If the name is empty, it will try to use the default vdc provided in the provider.
func (*CloudAvenue) GetVDCGroup ¶
func (c *CloudAvenue) GetVDCGroup(vdcGroupName string) (*VDCGroup, error)
GetVDCGroup return the vdc group using the name provided in the argument.
func (*CloudAvenue) GetVDCOrVDCGroup ¶
func (c *CloudAvenue) GetVDCOrVDCGroup(vdcOrVDCGroupName string) (VDCOrVDCGroupHandler, error)
GetVDCOrVDCGroup return the vdc or vdc group using the name provided in the argument.
func (*CloudAvenue) New ¶
func (c *CloudAvenue) New() (*CloudAvenue, error)
New creates a new CloudAvenue client.
type GetAdminVDCOpts ¶ added in v0.3.0
type GetAdminVDCOpts func(*AdminVDC)
func WithAdminVDCName ¶ added in v0.3.0
func WithAdminVDCName(name string) GetAdminVDCOpts
type GetVDCOpts ¶
type GetVDCOpts func(*VDC)
func WithVDCName ¶
func WithVDCName(name string) GetVDCOpts
type Org ¶
func (*Org) DeleteNetworkDHCP ¶ added in v0.6.0
DeleteNetworkDHCP deletes the DHCP object for the org network provided in parameter.
func (*Org) GetNetworkDHCP ¶ added in v0.6.0
func (o *Org) GetNetworkDHCP(orgNetworkID string) (*govcd.OpenApiOrgVdcNetworkDhcp, error)
GetNetworkDHCP returns the DHCP object for the org network provided in parameter.
func (*Org) UpdateNetworkDHCP ¶ added in v0.6.0
func (o *Org) UpdateNetworkDHCP(orgNetworkID string, dhcpParameters *govcdtypes.OpenApiOrgVdcNetworkDhcp) error
UpdateNetworkDHCP updates the DHCP object for the org network provided in parameter.
type VAPP ¶
func (VAPP) GetDeploymentLeaseInSeconds ¶ added in v0.2.0
GetDeploymentLeaseInSeconds retrieves the lease duration in seconds for a deployment.
func (VAPP) GetDescription ¶
GetDescription give you the status code of the vApp.
func (VAPP) GetStatusCode ¶
GetStatusCode give you the status code of the vApp.
func (VAPP) GetStorageLeaseInSeconds ¶ added in v0.2.0
GetStorageLeaseInSeconds retrieves the lease duration in seconds for a storage resource.
func (VAPP) IsVAPPNetwork ¶ added in v0.3.0
IsVAPPNetwork check if it is a vApp network (not vApp Org Network).
type VDC ¶
func (VDC) CreateVAPP ¶ added in v0.2.0
CreateVAPP create new vApp.
func (VDC) GetDefaultPlacementPolicyID ¶ added in v0.3.0
GetDefaultPlacementPolicyID give you the ID of the default placement policy.
func (VDC) GetIPSetByID ¶ added in v0.7.0
func (v VDC) GetIPSetByID(id string) (*govcd.NsxtFirewallGroup, error)
GetIPSetByID return the NSX-T firewall group using the ID provided in the argument.
func (VDC) GetIPSetByName ¶ added in v0.7.0
func (v VDC) GetIPSetByName(name string) (*govcd.NsxtFirewallGroup, error)
GetIPSetByName return the NSX-T firewall group using the name provided in the argument.
func (VDC) GetIPSetByNameOrID ¶ added in v0.7.0
func (v VDC) GetIPSetByNameOrID(nameOrID string) (*govcd.NsxtFirewallGroup, error)
GetIPSetByNameOrId return the NSX-T firewall group using the name or ID provided in the argument.
func (VDC) GetSecurityGroupByID ¶ added in v0.6.0
func (v VDC) GetSecurityGroupByID(nsxtFirewallGroupID string) (*govcd.NsxtFirewallGroup, error)
GetSecurityGroupByID return the NSX-T security group using the ID provided in the argument.
func (VDC) GetSecurityGroupByName ¶ added in v0.6.0
func (v VDC) GetSecurityGroupByName(nsxtFirewallGroupName string) (*govcd.NsxtFirewallGroup, error)
GetSecurityGroupByName return the NSX-T security group using the name provided in the argument.
func (VDC) GetSecurityGroupByNameOrID ¶ added in v0.6.0
func (v VDC) GetSecurityGroupByNameOrID(nsxtFirewallGroupNameOrID string) (*govcd.NsxtFirewallGroup, error)
GetSecurityGroupByNameOrID return the NSX-T security group using the name or ID provided in the argument.
func (VDC) IsVDCGroup ¶ added in v0.6.0
IsVDCGroup return true if the object is a VDC Group.
func (VDC) SetIPSet ¶ added in v0.7.0
func (v VDC) SetIPSet(ipSetConfig *govcdtypes.NsxtFirewallGroup) (*govcd.NsxtFirewallGroup, error)
SetIPSet set the NSX-T firewall group using the name provided in the argument.
type VDCGroup ¶
func (VDCGroup) GetIPSetByID ¶ added in v0.7.0
func (g VDCGroup) GetIPSetByID(id string) (*govcd.NsxtFirewallGroup, error)
GetIPSetByID return the NSX-T firewall group using the ID provided in the argument.
func (VDCGroup) GetIPSetByName ¶ added in v0.7.0
func (g VDCGroup) GetIPSetByName(name string) (*govcd.NsxtFirewallGroup, error)
GetIPSetByName return the NSX-T firewall group using the name provided in the argument.
func (VDCGroup) GetIPSetByNameOrID ¶ added in v0.7.0
func (g VDCGroup) GetIPSetByNameOrID(nameOrID string) (*govcd.NsxtFirewallGroup, error)
GetIPSetByNameOrID return the NSX-T firewall group using the name or ID provided in the argument.
func (VDCGroup) GetSecurityGroupByID ¶ added in v0.6.0
func (g VDCGroup) GetSecurityGroupByID(nsxtFirewallGroupID string) (*govcd.NsxtFirewallGroup, error)
GetSecurityGroupByID return the NSX-T security group using the ID provided in the argument.
func (VDCGroup) GetSecurityGroupByName ¶ added in v0.6.0
func (g VDCGroup) GetSecurityGroupByName(nsxtFirewallGroupName string) (*govcd.NsxtFirewallGroup, error)
GetSecurityGroupByName return the NSX-T security group using the name provided in the argument.
func (VDCGroup) GetSecurityGroupByNameOrID ¶ added in v0.6.0
func (g VDCGroup) GetSecurityGroupByNameOrID(nsxtFirewallGroupNameOrID string) (*govcd.NsxtFirewallGroup, error)
GetSecurityGroupByNameOrID return the NSX-T security group using the name or ID provided in the argument.
func (VDCGroup) IsVDCGroup ¶ added in v0.6.0
IsVDCGroup return true if the object is a VDC Group.
func (VDCGroup) SetIPSet ¶ added in v0.7.0
func (g VDCGroup) SetIPSet(ipSetConfig *govcdtypes.NsxtFirewallGroup) (*govcd.NsxtFirewallGroup, error)
SetIPSet set the NSX-T firewall group using the name provided in the argument.
type VDCOrVDCGroupHandler ¶
type VDCOrVDCGroupHandler interface { // * Global Get GetName() string GetID() string // * Global Is IsVDCGroup() bool // * Network GetOpenApiOrgVdcNetworkByName(string) (*govcd.OpenApiOrgVdcNetwork, error) // * Security Group GetSecurityGroupByID(nsxtFirewallGroupID string) (*govcd.NsxtFirewallGroup, error) GetSecurityGroupByName(nsxtFirewallGroupName string) (*govcd.NsxtFirewallGroup, error) GetSecurityGroupByNameOrID(nsxtFirewallGroupNameOrID string) (*govcd.NsxtFirewallGroup, error) // * IP Set GetIPSetByID(id string) (*govcd.NsxtFirewallGroup, error) GetIPSetByName(name string) (*govcd.NsxtFirewallGroup, error) GetIPSetByNameOrID(nameOrID string) (*govcd.NsxtFirewallGroup, error) SetIPSet(ipSetConfig *govcdtypes.NsxtFirewallGroup) (*govcd.NsxtFirewallGroup, error) }
VDCOrVDCGroupHandler is an interface to access some common methods on VDC or VDC Group without explicitly handling exact types.
type VM ¶ added in v0.3.0
func (VM) CpusCoresIsDefined ¶ added in v0.3.0
CpusCoresIsDefined returns true if the number of cores per CPU of a VM is defined.
func (VM) CpusIsDefined ¶ added in v0.3.0
CpusIsDefined returns true if the number of CPUs of a VM is defined.
func (VM) GetAffinityRuleID ¶ added in v0.3.0
GetAffinityRuleID returns the affinity rule ID of a VM.
func (VM) GetAffinityRuleIDOrDefault ¶ added in v0.3.0
GetAffinityRuleIDOrDefault returns the affinity rule ID of a VM or the default affinity rule ID if the VM has no affinity rule ID.
func (VM) GetCPUHotAddEnabled ¶ added in v0.3.0
GetCPUHotAddEnabled returns the hot add of a VM.
func (VM) GetCpusCores ¶ added in v0.3.0
GetCpusCores returns the number of cores per CPU of a VM.
func (VM) GetCustomization ¶ added in v0.3.0
func (v VM) GetCustomization() (guestCustomization *govcdtypes.GuestCustomizationSection, err error)
GetCustomization returns the customization of a VM.
func (VM) GetDefaultAffinityRuleID ¶ added in v0.3.0
GetDefaultAffinityRuleID returns the default affinity rule ID of a VM.
func (VM) GetExposeHardwareVirtualization ¶ added in v0.3.0
GetExposeHardwareVirtualization returns the expose hardware virtualization of a VM.
func (VM) GetGuestProperties ¶ added in v0.3.0
func (v VM) GetGuestProperties() (guestProperties []*govcdtypes.Property, err error)
* Guest properties GetGuestProperties returns the guest properties of a VM.
func (VM) GetMemoryHotAddEnabled ¶ added in v0.3.0
GetMemoryHotAddEnabled returns the hot add of a VM.
func (VM) GetNetworkConnection ¶ added in v0.3.0
func (v VM) GetNetworkConnection() (networkConnections []*govcdtypes.NetworkConnection)
GetNetworkConnection returns the network connection of a VM.
func (VM) GetStorageProfileName ¶ added in v0.3.0
GetStorageProfileName returns the storage profile name of a VM.
func (VM) HotAddIsDefined ¶ added in v0.3.0
HotAddIsDefined returns true if the hot add of a VM is defined.
func (VM) MemoryIsDefined ¶ added in v0.3.0
MemoryIsDefined returns true if the memory of a VM is defined.
func (VM) NetworkConnectionIsDefined ¶ added in v0.3.0
NetworkConnectionIsDefined checks if a network connection is defined.
func (VM) SetCustomization ¶ added in v0.3.0
func (v VM) SetCustomization(guestCustomization *govcdtypes.GuestCustomizationSection) (err error)
SetCustomization sets the customization of a VM.
func (VM) SetExposeHardwareVirtualization ¶ added in v0.3.0
SetExposeHardwareVirtualization sets the expose hardware virtualization of a VM.
func (VM) SetGuestProperties ¶ added in v0.3.0
SetGuestProperties sets the guest properties of a VM If the guest property already exists, it will be updated.