folder

package
v0.0.0-...-71ad85e Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clone

func Clone(client *govmomi.Client, dc *object.Datacenter, vlans []*vlan.LocalList, Path, newPath, pool string, vmTemplate bool, status *taskstatus.Status) (err error)

Clone Wil clone all items in the speciefied folder and all it's subfolders

func Create

func Create(client *govmomi.Client, dc *object.Datacenter, Path string) (folderObject *object.Folder, err error)

CreateFolder Creates the full folder path spaeciefied

func CreateSingleFolder

func CreateSingleFolder(client *govmomi.Client, dc *object.Datacenter, Path string) (*object.Folder, error)

CreateFolder only creates last subfolder, it fails if the path doesnt exist

func CreateSnapshot

func CreateSnapshot(client *govmomi.Client, dc *object.Datacenter, Path, SnapshotName string, memory bool) error

func Delete

func Delete(client *govmomi.Client, dc *object.Datacenter, Path string, status *taskstatus.Status) error

func Exists

func Exists(client *govmomi.Client, dc *object.Datacenter, Path string) bool

func FromID

func FromID(client *govmomi.Client, id string) (*object.Folder, error)

FromID locates a Folder by its managed object reference ID.

func Get

func Get(client *govmomi.Client, dc *object.Datacenter, Path string) (*object.Folder, error)

GetFolder returns an *object.Folder from a given absolute path. If no such folder is found, an appropriate error will be returned.

func GetChildrenFromPath

func GetChildrenFromPath(client *govmomi.Client, dc *object.Datacenter, Path string) ([]*object.Folder, error)

func GetVmObjectsFromPath

func GetVmObjectsFromPath(client *govmomi.Client, dc *object.Datacenter, Path string) (vmObjects []*object.VirtualMachine, err error)

func HasChildren

func HasChildren(f *object.Folder) (bool, error)

func ListFolderItems

func ListFolderItems(client *govmomi.Client, dc *object.Datacenter, Path, Type string) (*[]string, error)

func ListSubFolders

func ListSubFolders(client *govmomi.Client, dc *object.Datacenter, Path string) (*[]string, error)

func ListVirtualMachinesInFolder

func ListVirtualMachinesInFolder(client *govmomi.Client, dc *object.Datacenter, Path string) (*[]string, error)

func ReStart

func ReStart(client *govmomi.Client, dc *object.Datacenter, Path string, status *taskstatus.Status) (err error)

Restarts all the virtualmachines in the folder and subfolders

func Start

func Start(client *govmomi.Client, dc *object.Datacenter, Path string, status *taskstatus.Status) (err error)

Starts all the virtualmachines in the folder and subfolders

func Stop

func Stop(client *govmomi.Client, dc *object.Datacenter, Path string, status *taskstatus.Status) (err error)

Stops all the virtualmachines in the folder and subfolders

Types

type FileSystemItem

type FileSystemItem struct {
	Name           string
	Subitems       []*FileSystemItem
	Folder         *object.Folder
	VirtualMachine *object.VirtualMachine
}

func ReadFileSystem

func ReadFileSystem(client *govmomi.Client, dc *object.Datacenter, Path string) (*FileSystemItem, error)

func (*FileSystemItem) Create

func (fileSystem *FileSystemItem) Create(client *govmomi.Client, dc *object.Datacenter, vlans []*vlan.LocalList, basefolder, pool string, vmTemplate bool, status *taskstatus.Status) (err error)

func (*FileSystemItem) GetVmObjects

func (fileSystem *FileSystemItem) GetVmObjects() []*object.VirtualMachine

func (*FileSystemItem) RecursiveCountVmObjects

func (fileSystem *FileSystemItem) RecursiveCountVmObjects(NumberOfVms uint) uint

this function recursivly calls itself to count all VirtualMachines in the filesystem

func (*FileSystemItem) RecursiveGetVmObjects

func (fileSystem *FileSystemItem) RecursiveGetVmObjects(vmArray []*object.VirtualMachine, vmCounter int) ([]*object.VirtualMachine, int)

Jump to

Keyboard shortcuts

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