Documentation ¶
Index ¶
- func Upload(ctx context.Context, optflags *OptionsFlag, c *govmomi.Client) (*object.VirtualMachine, error)
- func VMPassthrough(ctx context.Context, host *object.HostSystem, vm *object.VirtualMachine, ...) error
- type Archive
- type ArchiveFlag
- type Credentials
- type FileArchive
- type FolderFlag
- type Network
- type Options
- type OptionsFlag
- type OptionsFlagHost
- func (flag *OptionsFlagHost) Datacenter() *object.Datacenter
- func (flag *OptionsFlagHost) Datastore() *object.Datastore
- func (flag *OptionsFlagHost) Folder() *object.Folder
- func (flag *OptionsFlagHost) HostSystem() *object.HostSystem
- func (flag *OptionsFlagHost) ResourcePool() *object.ResourcePool
- func (flag *OptionsFlagHost) Validate(ctx context.Context, client *vim25.Client) (bool, error)
- type OptionsFlagTarget
- type OptionsFlagVC
- func (flag *OptionsFlagVC) Datacenter() *object.Datacenter
- func (flag *OptionsFlagVC) Datastore() *object.Datastore
- func (flag *OptionsFlagVC) Folder() *object.Folder
- func (flag *OptionsFlagVC) HostSystem() *object.HostSystem
- func (flag *OptionsFlagVC) ResourcePool() *object.ResourcePool
- func (flag *OptionsFlagVC) Validate(ctx context.Context, client *vim25.Client) (bool, error)
- type Property
- type TapeArchive
- type TapeArchiveEntry
- type Vcenter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Upload ¶
func Upload(ctx context.Context, optflags *OptionsFlag, c *govmomi.Client) (*object.VirtualMachine, error)
Upload is a test function to push a new OVA to vCenter
func VMPassthrough ¶
func VMPassthrough(ctx context.Context, host *object.HostSystem, vm *object.VirtualMachine, client *vim25.Client) error
VMPassthrough adds a Host PCI device to a VM.
Types ¶
type Archive ¶
type Archive interface {
Open(string) (io.ReadCloser, int64, error)
}
Archive is an interface for DI of input types
type ArchiveFlag ¶
type ArchiveFlag struct {
Archive
}
ArchiveFlag doesn't register any flags; only encapsulates some common archive related functionality.
func (*ArchiveFlag) Process ¶
func (f *ArchiveFlag) Process(ctx context.Context) error
Process comment
func (*ArchiveFlag) ReadEnvelope ¶
func (f *ArchiveFlag) ReadEnvelope(fpath string) (*ovf.Envelope, error)
ReadEnvelope retrieves the metadata from the OVF
type Credentials ¶
Credentials holds the connections information
type FileArchive ¶
type FileArchive struct {
Path string
}
FileArchive is used for the normal OVF file loading
func (*FileArchive) Open ¶
func (t *FileArchive) Open(name string) (io.ReadCloser, int64, error)
Open starts reading from the file
type FolderFlag ¶
type FolderFlag struct { *flags.DatacenterFlag // contains filtered or unexported fields }
FolderFlag represents folder object in vSphere for use as argument
func (*FolderFlag) Folder ¶
func (flag *FolderFlag) Folder() (*object.Folder, error)
Folder checks if the requested folder exists
type Options ¶
type Options struct { AllDeploymentOptions []string `json:",omitempty"` Deployment string AllDiskProvisioningOptions []string `json:",omitempty"` DiskProvisioning string AllIPAllocationPolicyOptions []string `json:",omitempty"` IPAllocationPolicy string AllIPProtocolOptions []string `json:",omitempty"` IPProtocol string PropertyMapping []Property `json:",omitempty"` NetworkMapping []Network `json:",omitempty"` Annotation string `json:",omitempty"` PowerOn bool InjectOvfEnv bool WaitForIP bool Name *string }
Options object in vSphere OVF deployment for use as argument
type OptionsFlag ¶
type OptionsFlag struct { Options Options Target OptionsFlagTarget Path string }
OptionsFlag is the common parent struct for options
func (*OptionsFlag) ProcessOptionsFile ¶
func (flag *OptionsFlag) ProcessOptionsFile(ctx context.Context, path string) error
ProcessOptionsFile opens the options file and converts JSON into an options datastructure
type OptionsFlagHost ¶
type OptionsFlagHost struct { DatastoreName string FolderName string ResourcePoolName string // contains filtered or unexported fields }
OptionsFlagHost carries the config for ESXi-based deployments
func (*OptionsFlagHost) Datacenter ¶
func (flag *OptionsFlagHost) Datacenter() *object.Datacenter
Datacenter gets the datacenter object
func (*OptionsFlagHost) Datastore ¶
func (flag *OptionsFlagHost) Datastore() *object.Datastore
Datastore gets the datastore object
func (*OptionsFlagHost) Folder ¶
func (flag *OptionsFlagHost) Folder() *object.Folder
Folder get the Folder object
func (*OptionsFlagHost) HostSystem ¶
func (flag *OptionsFlagHost) HostSystem() *object.HostSystem
HostSystem get the HostSystem object
func (*OptionsFlagHost) ResourcePool ¶
func (flag *OptionsFlagHost) ResourcePool() *object.ResourcePool
ResourcePool get the resource pool object
type OptionsFlagTarget ¶
type OptionsFlagTarget interface { Validate(context.Context, *vim25.Client) (bool, error) Datastore() *object.Datastore ResourcePool() *object.ResourcePool HostSystem() *object.HostSystem Folder() *object.Folder Datacenter() *object.Datacenter }
OptionsFlagTarget is common parent of ESXi and VC-based imports
type OptionsFlagVC ¶
type OptionsFlagVC struct { DatastoreName string DatacenterName string ClusterName string HostName string FolderName string ResourcePoolName string // contains filtered or unexported fields }
OptionsFlagVC carries the config for VC-based targets
func (*OptionsFlagVC) Datacenter ¶
func (flag *OptionsFlagVC) Datacenter() *object.Datacenter
Datacenter gets the datacenter object
func (*OptionsFlagVC) Datastore ¶
func (flag *OptionsFlagVC) Datastore() *object.Datastore
Datastore gets the datastore object
func (*OptionsFlagVC) Folder ¶
func (flag *OptionsFlagVC) Folder() *object.Folder
Folder get the Folder object
func (*OptionsFlagVC) HostSystem ¶
func (flag *OptionsFlagVC) HostSystem() *object.HostSystem
HostSystem get the HostSystem object
func (*OptionsFlagVC) ResourcePool ¶
func (flag *OptionsFlagVC) ResourcePool() *object.ResourcePool
ResourcePool get the resource pool object
type TapeArchive ¶
type TapeArchive struct {
Path string
}
TapeArchive used for OVA TAR files
func (*TapeArchive) Open ¶
func (t *TapeArchive) Open(name string) (io.ReadCloser, int64, error)
Open retrieves files from within a tar file
type TapeArchiveEntry ¶
TapeArchiveEntry used to handle OVA TAR files
func (*TapeArchiveEntry) Close ¶
func (t *TapeArchiveEntry) Close() error
Close terminates the input stream
type Vcenter ¶
type Vcenter struct { Credentials *Credentials //move this to a common package Insecure bool Client *govmomi.Client Context context.Context }
Vcenter is the main struct
func (*Vcenter) FindHostSystemByName ¶
func (vc *Vcenter) FindHostSystemByName(hostname string) (*object.HostSystem, error)
FindHostSystemByName returns a HostSystem object