Documentation ¶
Overview ¶
Package simulator is a mock framework for the vSphere API.
See also: https://github.com/vmware/govmomi/blob/main/vcsim/README.md
Example ¶
Example of extending the simulator to inject faults.
package main import ( "context" "fmt" "log" "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) // BusyVM changes the behavior of simulator.VirtualMachine type BusyVM struct { *simulator.VirtualMachine } // Override simulator.VirtualMachine.PowerOffVMTask to inject faults func (vm *BusyVM) PowerOffVMTask(ctx *simulator.Context, req *types.PowerOffVM_Task) soap.HasFault { task := simulator.CreateTask(req.This, "powerOff", func(*simulator.Task) (types.AnyType, types.BaseMethodFault) { return nil, &types.TaskInProgress{} }) return &methods.PowerOffVM_TaskBody{ Res: &types.PowerOffVM_TaskResponse{ Returnval: task.Run(ctx), }, } } // Add AcquireTicket method, not implemented by simulator.VirtualMachine func (vm *BusyVM) AcquireTicket(req *types.AcquireTicket) soap.HasFault { body := &methods.AcquireTicketBody{} if req.TicketType != "mks" { body.Fault_ = simulator.Fault("", &types.InvalidArgument{}) } body.Res = &types.AcquireTicketResponse{ Returnval: types.VirtualMachineTicket{ Ticket: "welcome 2 the machine", }, } return body } // Example of extending the simulator to inject faults. func main() { ctx := context.Background() model := simulator.VPX() defer model.Remove() _ = model.Create() s := model.Service.NewServer() defer s.Close() // NewClient connects to s.URL over https and invokes 2 SOAP methods (RetrieveServiceContent + Login) c, _ := govmomi.NewClient(ctx, s.URL, true) // Shortcut to choose any VM, rather than using the more verbose Finder or ContainerView. obj := simulator.Map.Any("VirtualMachine").(*simulator.VirtualMachine) // Validate VM is powered on if obj.Runtime.PowerState != "poweredOn" { log.Fatal(obj.Runtime.PowerState) } // Wrap the existing vm object, using the same vm.Self (ManagedObjectReference) value as the Map key. simulator.Map.Put(&BusyVM{obj}) vm := object.NewVirtualMachine(c.Client, obj.Reference()) // Start a PowerOff task using the SOAP client. task, _ := vm.PowerOff(ctx) // Wait for task completion, expecting failure. err := task.Wait(ctx) if err == nil { log.Fatal("expected error") } // Invalid ticket type, expecting failure. _, err = vm.AcquireTicket(ctx, "pks") if err == nil { log.Fatal("expected error") } mks, _ := vm.AcquireTicket(ctx, "mks") fmt.Println(mks.Ticket, obj.Runtime.PowerState) }
Output: welcome 2 the machine poweredOn
Example (RunContainer) ¶
Tie a docker container to the lifecycle of a vcsim VM
package main import ( "bytes" "context" "fmt" "log" "os" "os/exec" "path/filepath" "strings" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/types" ) func main() { simulator.Test(func(ctx context.Context, c *vim25.Client) { if _, err := exec.LookPath("docker"); err != nil { fmt.Println("0 diff") return } finder := find.NewFinder(c) pool, _ := finder.ResourcePool(ctx, "DC0_H0/Resources") dc, err := finder.Datacenter(ctx, "DC0") if err != nil { log.Fatal(err) } f, _ := dc.Folders(ctx) dir, err := os.MkdirTemp("", "example") if err != nil { log.Fatal(err) } os.Chmod(dir, 0755) fpath := filepath.Join(dir, "index.html") fcontent := "foo" os.WriteFile(fpath, []byte(fcontent), 0644) // just in case umask gets in the way os.Chmod(fpath, 0644) defer os.RemoveAll(dir) args := fmt.Sprintf("-v '%s:/usr/share/nginx/html:ro' nginx", dir) spec := types.VirtualMachineConfigSpec{ Name: "nginx", Files: &types.VirtualMachineFileInfo{ VmPathName: "[LocalDS_0] nginx", }, ExtraConfig: []types.BaseOptionValue{ &types.OptionValue{Key: "RUN.container", Value: args}, // run nginx &types.OptionValue{Key: "RUN.port.80", Value: "8888"}, // test port remap }, } // Create a new VM task, err := f.VmFolder.CreateVM(ctx, spec, pool, nil) if err != nil { log.Fatal(err) } info, err := task.WaitForResult(ctx, nil) if err != nil { log.Fatal(err) } vm := object.NewVirtualMachine(c, info.Result.(types.ManagedObjectReference)) // PowerOn VM starts the nginx container task, _ = vm.PowerOn(ctx) err = task.Wait(ctx) if err != nil { log.Fatal(err) } ip, _ := vm.WaitForIP(ctx, true) // Returns the docker container's IP // Count the number of bytes in feature_test.go via nginx going direct to the container cmd := exec.Command("docker", "run", "--rm", "curlimages/curl", "curl", "-f", fmt.Sprintf("http://%s", ip)) var buf bytes.Buffer cmd.Stdout = &buf err = cmd.Run() res := buf.String() if err != nil || strings.TrimSpace(res) != fcontent { log.Fatal(err, buf.String()) } // Count the number of bytes in feature_test.go via nginx going via port remap on host cmd = exec.Command("curl", "-f", "http://localhost:8888") buf.Reset() cmd.Stdout = &buf err = cmd.Run() res = buf.String() if err != nil || strings.TrimSpace(res) != fcontent { log.Fatal(err, buf.String()) } // PowerOff stops the container task, _ = vm.PowerOff(ctx) _ = task.Wait(ctx) // Destroy deletes the container task, _ = vm.Destroy(ctx) _ = task.Wait(ctx) fmt.Printf("%d diff", buf.Len()-len(fcontent)) }) }
Output: 0 diff
Example (SetVirtualMachineProperties) ¶
Set VM properties that the API cannot change in a real vCenter.
package main import ( "context" "fmt" "log" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/types" ) func main() { simulator.Test(func(ctx context.Context, c *vim25.Client) { vm, err := find.NewFinder(c).VirtualMachine(ctx, "DC0_H0_VM0") if err != nil { log.Fatal(err) } spec := types.VirtualMachineConfigSpec{ ExtraConfig: []types.BaseOptionValue{ &types.OptionValue{Key: "SET.guest.ipAddress", Value: "10.0.0.42"}, }, } task, _ := vm.Reconfigure(ctx, spec) _ = task.Wait(ctx) ip, _ := vm.WaitForIP(ctx) fmt.Printf("ip is %s", ip) }) }
Output: ip is 10.0.0.42
Example (UsernamePasswordLogin) ¶
Custom username + password authentication
package main import ( "context" "fmt" "log" "net/url" "github.com/vmware/govmomi" "github.com/vmware/govmomi/simulator" ) func main() { model := simulator.VPX() defer model.Remove() err := model.Create() if err != nil { log.Fatal(err) } model.Service.Listen = &url.URL{ User: url.UserPassword("my-username", "my-password"), } s := model.Service.NewServer() defer s.Close() c, err := govmomi.NewClient(context.Background(), s.URL, true) if err != nil { log.Fatal(err) } fmt.Printf("login to %s as %s", c.Client.ServiceContent.About.ApiType, s.URL.User) }
Output: login to VirtualCenter as my-username:my-password
Index ¶
- Constants
- Variables
- func CreateDefaultESX(ctx *Context, f *Folder)
- func DisableRuleset(info *types.HostFirewallInfo, id string) bool
- func EnableRuleset(info *types.HostFirewallInfo, id string) bool
- func Fault(msg string, fault types.BaseMethodFault) *soap.Fault
- func FindReference(refs []types.ManagedObjectReference, match ...types.ManagedObjectReference) *types.ManagedObjectReference
- func NewOptionManager(ref *types.ManagedObjectReference, setting []types.BaseOptionValue, ...) object.Reference
- func NewPropertyCollector(ref types.ManagedObjectReference) object.Reference
- func NewVAppConfigSpec() types.VAppConfigSpec
- func RegisterEndpoint(endpoint func(*Service, *Registry))
- func RemoveReference(field *[]types.ManagedObjectReference, ref types.ManagedObjectReference)
- func RenameTask(ctx *Context, e mo.Entity, r *types.Rename_Task, dup ...bool) soap.HasFault
- func Run(f func(context.Context, *vim25.Client) error, model ...*Model)
- func RunContainer(ctx context.Context, c *vim25.Client, vm mo.Reference, args string) error
- func ServeGuest(w http.ResponseWriter, r *http.Request)
- func ServeNFC(w http.ResponseWriter, r *http.Request)
- func SessionIdleWatch(ctx context.Context, id string, expired func(string, time.Time) bool)
- func SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault
- func Test(f func(context.Context, *vim25.Client), model ...*Model)
- type Alarm
- type AlarmManager
- type AuthorizationManager
- func (m *AuthorizationManager) AddAuthorizationRole(req *types.AddAuthorizationRole) soap.HasFault
- func (m *AuthorizationManager) FetchUserPrivilegeOnEntities(req *types.FetchUserPrivilegeOnEntities) soap.HasFault
- func (m *AuthorizationManager) HasPrivilegeOnEntities(req *types.HasPrivilegeOnEntities) soap.HasFault
- func (m *AuthorizationManager) HasPrivilegeOnEntity(req *types.HasPrivilegeOnEntity) soap.HasFault
- func (m *AuthorizationManager) HasUserPrivilegeOnEntities(req *types.HasUserPrivilegeOnEntities) soap.HasFault
- func (m *AuthorizationManager) RemoveAuthorizationRole(req *types.RemoveAuthorizationRole) soap.HasFault
- func (m *AuthorizationManager) RemoveEntityPermission(req *types.RemoveEntityPermission) soap.HasFault
- func (m *AuthorizationManager) RetrieveAllPermissions(req *types.RetrieveAllPermissions) soap.HasFault
- func (m *AuthorizationManager) RetrieveEntityPermissions(req *types.RetrieveEntityPermissions) soap.HasFault
- func (m *AuthorizationManager) RetrieveRolePermissions(req *types.RetrieveRolePermissions) soap.HasFault
- func (m *AuthorizationManager) SetEntityPermissions(req *types.SetEntityPermissions) soap.HasFault
- func (m *AuthorizationManager) UpdateAuthorizationRole(req *types.UpdateAuthorizationRole) soap.HasFault
- type ClusterComputeResource
- func (c *ClusterComputeResource) AddHostTask(ctx *Context, add *types.AddHost_Task) soap.HasFault
- func (c *ClusterComputeResource) MoveIntoTask(ctx *Context, req *types.MoveInto_Task) soap.HasFault
- func (c *ClusterComputeResource) PlaceVm(ctx *Context, req *types.PlaceVm) soap.HasFault
- func (c *ClusterComputeResource) ReconfigureComputeResourceTask(ctx *Context, req *types.ReconfigureComputeResource_Task) soap.HasFault
- func (c *ClusterComputeResource) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault
- type ContainerView
- func (v *ContainerView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault
- func (v *ContainerView) PutObject(obj mo.Reference)
- func (v *ContainerView) RemoveObject(ctx *Context, obj types.ManagedObjectReference)
- func (*ContainerView) UpdateObject(*Context, mo.Reference, []types.PropertyChange)
- type Context
- type CryptoManagerKmip
- func (m *CryptoManagerKmip) GenerateKey(ctx *Context, req *types.GenerateKey) soap.HasFault
- func (m *CryptoManagerKmip) GetDefaultKmsCluster(ctx *Context, req *types.GetDefaultKmsCluster) soap.HasFault
- func (m *CryptoManagerKmip) ListKeys(ctx *Context, req *types.ListKeys) soap.HasFault
- func (m *CryptoManagerKmip) ListKmipServers(ctx *Context, req *types.ListKmipServers) soap.HasFault
- func (m *CryptoManagerKmip) MarkDefault(ctx *Context, req *types.MarkDefault) soap.HasFault
- func (m *CryptoManagerKmip) RegisterKmipServer(ctx *Context, req *types.RegisterKmipServer) soap.HasFault
- func (m *CryptoManagerKmip) RegisterKmsCluster(ctx *Context, req *types.RegisterKmsCluster) soap.HasFault
- func (m *CryptoManagerKmip) RemoveKmipServer(ctx *Context, req *types.RemoveKmipServer) soap.HasFault
- func (m *CryptoManagerKmip) RetrieveKmipServersStatusTask(ctx *Context, req *types.RetrieveKmipServersStatus_Task) soap.HasFault
- func (m *CryptoManagerKmip) SetDefaultKmsCluster(ctx *Context, req *types.SetDefaultKmsCluster) soap.HasFault
- func (m *CryptoManagerKmip) UnregisterKmsCluster(ctx *Context, req *types.UnregisterKmsCluster) soap.HasFault
- func (m *CryptoManagerKmip) UpdateKmipServer(ctx *Context, req *types.UpdateKmipServer) soap.HasFault
- type CustomFieldsManager
- func (c *CustomFieldsManager) AddCustomFieldDef(ctx *Context, req *types.AddCustomFieldDef) soap.HasFault
- func (c *CustomFieldsManager) RemoveCustomFieldDef(ctx *Context, req *types.RemoveCustomFieldDef) soap.HasFault
- func (c *CustomFieldsManager) RenameCustomFieldDef(ctx *Context, req *types.RenameCustomFieldDef) soap.HasFault
- func (c *CustomFieldsManager) SetField(ctx *Context, req *types.SetField) soap.HasFault
- type CustomizationSpecManager
- func (m *CustomizationSpecManager) CreateCustomizationSpec(ctx *Context, req *types.CreateCustomizationSpec) soap.HasFault
- func (m *CustomizationSpecManager) DoesCustomizationSpecExist(ctx *Context, req *types.DoesCustomizationSpecExist) soap.HasFault
- func (m *CustomizationSpecManager) Get() mo.Reference
- func (m *CustomizationSpecManager) GetCustomizationSpec(ctx *Context, req *types.GetCustomizationSpec) soap.HasFault
- func (m *CustomizationSpecManager) OverwriteCustomizationSpec(ctx *Context, req *types.OverwriteCustomizationSpec) soap.HasFault
- type DataSet
- type Datacenter
- type Datastore
- type DatastoreNamespaceManager
- type DelayConfig
- type DistributedVirtualPortgroup
- func (s *DistributedVirtualPortgroup) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
- func (s *DistributedVirtualPortgroup) ReconfigureDVPortgroupTask(ctx *Context, req *types.ReconfigureDVPortgroup_Task) soap.HasFault
- func (s *DistributedVirtualPortgroup) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault
- type DistributedVirtualSwitch
- func (s *DistributedVirtualSwitch) AddDVPortgroupTask(ctx *Context, c *types.AddDVPortgroup_Task) soap.HasFault
- func (s *DistributedVirtualSwitch) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
- func (s *DistributedVirtualSwitch) FetchDVPorts(req *types.FetchDVPorts) soap.HasFault
- func (s *DistributedVirtualSwitch) ReconfigureDvsTask(ctx *Context, req *types.ReconfigureDvs_Task) soap.HasFault
- type DistributedVirtualSwitchManager
- type Element
- type EnvironmentBrowser
- func (b *EnvironmentBrowser) QueryConfigOption(req *types.QueryConfigOption) soap.HasFault
- func (b *EnvironmentBrowser) QueryConfigOptionDescriptor(ctx *Context, req *types.QueryConfigOptionDescriptor) soap.HasFault
- func (b *EnvironmentBrowser) QueryConfigOptionEx(req *types.QueryConfigOptionEx) soap.HasFault
- func (b *EnvironmentBrowser) QueryConfigTarget(ctx *Context, req *types.QueryConfigTarget) soap.HasFault
- func (b *EnvironmentBrowser) QueryTargetCapabilities(ctx *Context, req *types.QueryTargetCapabilities) soap.HasFault
- type EventHistoryCollector
- func (c *EventHistoryCollector) Get() mo.Reference
- func (c *EventHistoryCollector) GetLatestPage() []types.BaseEvent
- func (c *EventHistoryCollector) ReadNextEvents(ctx *Context, req *types.ReadNextEvents) soap.HasFault
- func (c *EventHistoryCollector) ReadPreviousEvents(ctx *Context, req *types.ReadPreviousEvents) soap.HasFault
- type EventManager
- type ExtensionManager
- func (m *ExtensionManager) FindExtension(ctx *Context, req *types.FindExtension) soap.HasFault
- func (m *ExtensionManager) RegisterExtension(ctx *Context, req *types.RegisterExtension) soap.HasFault
- func (m *ExtensionManager) SetExtensionCertificate(ctx *Context, req *types.SetExtensionCertificate) soap.HasFault
- func (m *ExtensionManager) UnregisterExtension(ctx *Context, req *types.UnregisterExtension) soap.HasFault
- func (m *ExtensionManager) UpdateExtension(ctx *Context, req *types.UpdateExtension) soap.HasFault
- type FileManager
- func (f *FileManager) CopyDatastoreFileTask(ctx *Context, req *types.CopyDatastoreFile_Task) soap.HasFault
- func (f *FileManager) DeleteDatastoreFileTask(ctx *Context, req *types.DeleteDatastoreFile_Task) soap.HasFault
- func (f *FileManager) MakeDirectory(req *types.MakeDirectory) soap.HasFault
- func (f *FileManager) MoveDatastoreFileTask(ctx *Context, req *types.MoveDatastoreFile_Task) soap.HasFault
- type Folder
- func (f *Folder) AddOpaqueNetwork(ctx *Context, summary types.OpaqueNetworkSummary) error
- func (f *Folder) AddStandaloneHostTask(ctx *Context, a *types.AddStandaloneHost_Task) soap.HasFault
- func (f *Folder) CreateClusterEx(ctx *Context, c *types.CreateClusterEx) soap.HasFault
- func (f *Folder) CreateDVSTask(ctx *Context, req *types.CreateDVS_Task) soap.HasFault
- func (f *Folder) CreateDatacenter(ctx *Context, c *types.CreateDatacenter) soap.HasFault
- func (f *Folder) CreateFolder(ctx *Context, c *types.CreateFolder) soap.HasFault
- func (f *Folder) CreateStoragePod(ctx *Context, c *types.CreateStoragePod) soap.HasFault
- func (f *Folder) CreateVMTask(ctx *Context, c *types.CreateVM_Task) soap.HasFault
- func (f *Folder) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
- func (f *Folder) MoveIntoFolderTask(ctx *Context, c *types.MoveIntoFolder_Task) soap.HasFault
- func (f *Folder) PlaceVmsXCluster(ctx *Context, req *types.PlaceVmsXCluster) soap.HasFault
- func (f *Folder) RegisterVMTask(ctx *Context, c *types.RegisterVM_Task) soap.HasFault
- func (f *Folder) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault
- type GuestFileManager
- func (m *GuestFileManager) ChangeFileAttributesInGuest(ctx *Context, req *types.ChangeFileAttributesInGuest) soap.HasFault
- func (m *GuestFileManager) CreateTemporaryDirectoryInGuest(ctx *Context, req *types.CreateTemporaryDirectoryInGuest) soap.HasFault
- func (m *GuestFileManager) CreateTemporaryFileInGuest(ctx *Context, req *types.CreateTemporaryFileInGuest) soap.HasFault
- func (m *GuestFileManager) DeleteDirectoryInGuest(ctx *Context, req *types.DeleteDirectoryInGuest) soap.HasFault
- func (m *GuestFileManager) DeleteFileInGuest(ctx *Context, req *types.DeleteFileInGuest) soap.HasFault
- func (m *GuestFileManager) InitiateFileTransferFromGuest(ctx *Context, req *types.InitiateFileTransferFromGuest) soap.HasFault
- func (m *GuestFileManager) InitiateFileTransferToGuest(ctx *Context, req *types.InitiateFileTransferToGuest) soap.HasFault
- func (m *GuestFileManager) ListFilesInGuest(ctx *Context, req *types.ListFilesInGuest) soap.HasFault
- func (m *GuestFileManager) MakeDirectoryInGuest(ctx *Context, req *types.MakeDirectoryInGuest) soap.HasFault
- func (m *GuestFileManager) MoveDirectoryInGuest(ctx *Context, req *types.MoveDirectoryInGuest) soap.HasFault
- func (m *GuestFileManager) MoveFileInGuest(ctx *Context, req *types.MoveFileInGuest) soap.HasFault
- type GuestOperationsManager
- type GuestProcessManager
- func (m *GuestProcessManager) ListProcessesInGuest(ctx *Context, req *types.ListProcessesInGuest) soap.HasFault
- func (m *GuestProcessManager) StartProgramInGuest(ctx *Context, req *types.StartProgramInGuest) soap.HasFault
- func (m *GuestProcessManager) TerminateProcessInGuest(ctx *Context, req *types.TerminateProcessInGuest) soap.HasFault
- type HistoryCollector
- func (c *HistoryCollector) DestroyCollector(ctx *Context, req *types.DestroyCollector) soap.HasFault
- func (c *HistoryCollector) ResetCollector(ctx *Context, req *types.ResetCollector) soap.HasFault
- func (c *HistoryCollector) RewindCollector(ctx *Context, req *types.RewindCollector) soap.HasFault
- func (c *HistoryCollector) SetCollectorPageSize(ctx *Context, req *types.SetCollectorPageSize) soap.HasFault
- type HostCertificateManager
- type HostDatastoreBrowser
- type HostDatastoreSystem
- type HostFirewallSystem
- type HostLocalAccountManager
- type HostNetworkSystem
- func (s *HostNetworkSystem) AddPortGroup(ctx *Context, c *types.AddPortGroup) soap.HasFault
- func (s *HostNetworkSystem) AddVirtualSwitch(c *types.AddVirtualSwitch) soap.HasFault
- func (s *HostNetworkSystem) QueryNetworkHint(req *types.QueryNetworkHint) soap.HasFault
- func (s *HostNetworkSystem) RemovePortGroup(ctx *Context, c *types.RemovePortGroup) soap.HasFault
- func (s *HostNetworkSystem) RemoveVirtualSwitch(c *types.RemoveVirtualSwitch) soap.HasFault
- func (s *HostNetworkSystem) UpdateNetworkConfig(req *types.UpdateNetworkConfig) soap.HasFault
- type HostStorageSystem
- type HostSystem
- func (h *HostSystem) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
- func (h *HostSystem) DisconnectHostTask(ctx *Context, spec *types.DisconnectHost_Task) soap.HasFault
- func (h *HostSystem) EnterMaintenanceModeTask(ctx *Context, spec *types.EnterMaintenanceMode_Task) soap.HasFault
- func (h *HostSystem) ExitMaintenanceModeTask(ctx *Context, spec *types.ExitMaintenanceMode_Task) soap.HasFault
- func (s *HostSystem) QueryTpmAttestationReport(req *types.QueryTpmAttestationReport) soap.HasFault
- func (h *HostSystem) ReconnectHostTask(ctx *Context, spec *types.ReconnectHost_Task) soap.HasFault
- type HostVirtualNicManager
- type HttpNfcLease
- func (l *HttpNfcLease) HttpNfcLeaseAbort(ctx *Context, req *types.HttpNfcLeaseAbort) soap.HasFault
- func (l *HttpNfcLease) HttpNfcLeaseComplete(ctx *Context, req *types.HttpNfcLeaseComplete) soap.HasFault
- func (l *HttpNfcLease) HttpNfcLeaseGetManifest(ctx *Context, req *types.HttpNfcLeaseGetManifest) soap.HasFault
- func (l *HttpNfcLease) HttpNfcLeaseProgress(ctx *Context, req *types.HttpNfcLeaseProgress) soap.HasFault
- type IpPool
- type IpPoolManager
- func (m *IpPoolManager) AllocateIpv4Address(req *types.AllocateIpv4Address) soap.HasFault
- func (m *IpPoolManager) AllocateIpv6Address(req *types.AllocateIpv6Address) soap.HasFault
- func (m *IpPoolManager) CreateIpPool(req *types.CreateIpPool) soap.HasFault
- func (m *IpPoolManager) DestroyIpPool(req *types.DestroyIpPool) soap.HasFault
- func (m *IpPoolManager) QueryIPAllocations(req *types.QueryIPAllocations) soap.HasFault
- func (m *IpPoolManager) QueryIpPools(req *types.QueryIpPools) soap.HasFault
- func (m *IpPoolManager) ReleaseIpAllocation(req *types.ReleaseIpAllocation) soap.HasFault
- func (m *IpPoolManager) UpdateIpPool(req *types.UpdateIpPool) soap.HasFault
- type LicenseAssignmentManager
- type LicenseManager
- type ListView
- type Method
- type Model
- type OptionManager
- type OvfManager
- type PerformanceManager
- func (p *PerformanceManager) QueryAvailablePerfMetric(ctx *Context, req *types.QueryAvailablePerfMetric) soap.HasFault
- func (p *PerformanceManager) QueryPerf(ctx *Context, req *types.QueryPerf) soap.HasFault
- func (p *PerformanceManager) QueryPerfCounter(ctx *Context, req *types.QueryPerfCounter) soap.HasFault
- func (p *PerformanceManager) QueryPerfProviderSummary(ctx *Context, req *types.QueryPerfProviderSummary) soap.HasFault
- type PropertyCollector
- func (pc *PropertyCollector) CancelWaitForUpdates(r *types.CancelWaitForUpdates) soap.HasFault
- func (pc *PropertyCollector) ContinueRetrievePropertiesEx(ctx *Context, r *types.ContinueRetrievePropertiesEx) soap.HasFault
- func (pc *PropertyCollector) CreateFilter(ctx *Context, c *types.CreateFilter) soap.HasFault
- func (pc *PropertyCollector) CreatePropertyCollector(ctx *Context, c *types.CreatePropertyCollector) soap.HasFault
- func (pc *PropertyCollector) DestroyPropertyCollector(ctx *Context, c *types.DestroyPropertyCollector) soap.HasFault
- func (pc *PropertyCollector) Fetch(ctx *Context, req *internal.Fetch) soap.HasFault
- func (*PropertyCollector) Lock()
- func (pc *PropertyCollector) PutObject(o mo.Reference)
- func (pc *PropertyCollector) RemoveObject(_ *Context, ref types.ManagedObjectReference)
- func (pc *PropertyCollector) RetrieveProperties(ctx *Context, r *types.RetrieveProperties) soap.HasFault
- func (pc *PropertyCollector) RetrievePropertiesEx(ctx *Context, r *types.RetrievePropertiesEx) soap.HasFault
- func (*PropertyCollector) Unlock()
- func (pc *PropertyCollector) UpdateObject(_ *Context, o mo.Reference, changes []types.PropertyChange)
- func (pc *PropertyCollector) WaitForUpdates(ctx *Context, r *types.WaitForUpdates) soap.HasFault
- func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpdatesEx) soap.HasFault
- type PropertyFilter
- func (f *PropertyFilter) DestroyPropertyFilter(ctx *Context, c *types.DestroyPropertyFilter) soap.HasFault
- func (_ *PropertyFilter) PutObject(_ mo.Reference)
- func (_ *PropertyFilter) RemoveObject(_ *Context, _ types.ManagedObjectReference)
- func (f *PropertyFilter) UpdateObject(ctx *Context, o mo.Reference, changes []types.PropertyChange)
- type RegisterObject
- type Registry
- func (r *Registry) AcquireLock(onBehalfOf *Context, obj mo.Reference) func()
- func (r *Registry) AddHandler(h RegisterObject)
- func (r *Registry) AddReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ...)
- func (r *Registry) AlarmManager() *AlarmManager
- func (r *Registry) All(kind string) []mo.Entity
- func (r *Registry) AllReference(kind string) []mo.Reference
- func (r *Registry) Any(kind string) mo.Entity
- func (r *Registry) AppendReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ...)
- func (r *Registry) AtomicUpdate(ctx *Context, obj mo.Reference, changes []types.PropertyChange)
- func (r *Registry) CryptoManager() *CryptoManagerKmip
- func (r *Registry) CustomFieldsManager() *CustomFieldsManager
- func (r *Registry) EventManager() *EventManager
- func (r *Registry) ExtensionManager() *ExtensionManager
- func (r *Registry) FileManager() *FileManager
- func (r *Registry) FindByName(name string, refs []types.ManagedObjectReference) mo.Entity
- func (r *Registry) Get(ref types.ManagedObjectReference) mo.Reference
- func (r *Registry) IsESX() bool
- func (r *Registry) IsVPX() bool
- func (r *Registry) MarshalJSON() ([]byte, error)
- func (r *Registry) NewEntity(item mo.Entity) mo.Entity
- func (r *Registry) OptionManager() *OptionManager
- func (r *Registry) Put(item mo.Reference) mo.Reference
- func (r *Registry) PutEntity(parent mo.Entity, item mo.Entity) mo.Entity
- func (r *Registry) Remove(ctx *Context, item types.ManagedObjectReference)
- func (r *Registry) RemoveHandler(h RegisterObject)
- func (r *Registry) RemoveReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ...)
- func (r *Registry) SearchIndex() *SearchIndex
- func (r *Registry) SessionManager() *SessionManager
- func (r *Registry) TenantManager() *TenantManager
- func (r *Registry) Update(ctx *Context, obj mo.Reference, changes []types.PropertyChange)
- func (r *Registry) UserDirectory() *UserDirectory
- func (r *Registry) ViewManager() *ViewManager
- func (r *Registry) VirtualDiskManager() VirtualDiskManagerInterface
- func (r *Registry) VmCompatibilityChecker() *VmCompatibilityChecker
- func (r *Registry) VmProvisioningChecker() *VmProvisioningChecker
- func (r *Registry) WithLock(onBehalfOf *Context, obj mo.Reference, f func())
- type ResourcePool
- func (p *ResourcePool) CreateResourcePool(c *types.CreateResourcePool) soap.HasFault
- func (p *ResourcePool) CreateVApp(req *types.CreateVApp) soap.HasFault
- func (p *ResourcePool) DestroyChildren(ctx *Context, req *types.DestroyChildren) soap.HasFault
- func (p *ResourcePool) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
- func (p *ResourcePool) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault
- func (p *ResourcePool) UpdateConfig(c *types.UpdateConfig) soap.HasFault
- type SearchIndex
- func (s *SearchIndex) FindAllByDnsName(req *types.FindAllByDnsName) soap.HasFault
- func (s *SearchIndex) FindAllByIp(req *types.FindAllByIp) soap.HasFault
- func (s *SearchIndex) FindByDatastorePath(r *types.FindByDatastorePath) soap.HasFault
- func (s *SearchIndex) FindByDnsName(req *types.FindByDnsName) soap.HasFault
- func (s *SearchIndex) FindByInventoryPath(req *types.FindByInventoryPath) soap.HasFault
- func (s *SearchIndex) FindByIp(req *types.FindByIp) soap.HasFault
- func (s *SearchIndex) FindByUuid(req *types.FindByUuid) soap.HasFault
- func (s *SearchIndex) FindChild(req *types.FindChild) soap.HasFault
- type Server
- type Service
- func (s *Service) About(w http.ResponseWriter, r *http.Request)
- func (s *Service) Handle(pattern string, handler http.Handler)
- func (s *Service) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (s *Service) NewServer() *Server
- func (s *Service) RegisterSDK(r *Registry, alias ...string)
- func (s *Service) RoundTrip(ctx context.Context, request, response soap.HasFault) error
- func (s *Service) ServeDatastore(w http.ResponseWriter, r *http.Request)
- func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request)
- func (s *Service) ServiceVersions(w http.ResponseWriter, r *http.Request)
- func (s *Service) ServiceVersionsVsan(w http.ResponseWriter, r *http.Request)
- type ServiceInstance
- type Session
- type SessionManager
- func (s *SessionManager) AcquireCloneTicket(ctx *Context, _ *types.AcquireCloneTicket) soap.HasFault
- func (s *SessionManager) AcquireGenericServiceTicket(ticket *types.AcquireGenericServiceTicket) soap.HasFault
- func (s *SessionManager) Authenticate(u url.URL, req *types.Login) bool
- func (s *SessionManager) CloneSession(ctx *Context, ticket *types.CloneSession) soap.HasFault
- func (s *SessionManager) ImpersonateUser(ctx *Context, req *types.ImpersonateUser) soap.HasFault
- func (*SessionManager) Lock()
- func (s *SessionManager) Login(ctx *Context, req *types.Login) soap.HasFault
- func (s *SessionManager) LoginByToken(ctx *Context, req *types.LoginByToken) soap.HasFault
- func (s *SessionManager) LoginExtensionByCertificate(ctx *Context, req *types.LoginExtensionByCertificate) soap.HasFault
- func (s *SessionManager) Logout(ctx *Context, _ *types.Logout) soap.HasFault
- func (s *SessionManager) SessionIsActive(ctx *Context, req *types.SessionIsActive) soap.HasFault
- func (s *SessionManager) TerminateSession(ctx *Context, req *types.TerminateSession) soap.HasFault
- func (*SessionManager) Unlock()
- type StoragePod
- type StorageResourceManager
- type Task
- func (t *Task) CancelTask(ctx *Context, req *types.CancelTask) soap.HasFault
- func (t *Task) Run(ctx *Context) types.ManagedObjectReference
- func (t *Task) RunBlocking(ctx *Context)
- func (t *Task) SetTaskDescription(ctx *Context, req *types.SetTaskDescription) soap.HasFault
- func (t *Task) SetTaskState(ctx *Context, req *types.SetTaskState) soap.HasFault
- func (t *Task) UpdateProgress(ctx *Context, req *types.UpdateProgress) soap.HasFault
- func (t *Task) Wait()
- type TaskHistoryCollector
- func (c *TaskHistoryCollector) Get() mo.Reference
- func (c *TaskHistoryCollector) GetLatestPage() []types.TaskInfo
- func (c *TaskHistoryCollector) ReadNextTasks(ctx *Context, req *types.ReadNextTasks) soap.HasFault
- func (c *TaskHistoryCollector) ReadPreviousTasks(ctx *Context, req *types.ReadPreviousTasks) soap.HasFault
- type TaskManager
- func (m *TaskManager) CreateCollectorForTasks(ctx *Context, req *types.CreateCollectorForTasks) soap.HasFault
- func (m *TaskManager) CreateTask(ctx *Context, req *types.CreateTask) soap.HasFault
- func (m *TaskManager) PutObject(obj mo.Reference)
- func (*TaskManager) RemoveObject(*Context, types.ManagedObjectReference)
- func (m *TaskManager) UpdateObject(ctx *Context, obj mo.Reference, pc []types.PropertyChange)
- type TaskRunner
- type TenantManager
- func (t *TenantManager) MarkServiceProviderEntities(req *types.MarkServiceProviderEntities) soap.HasFault
- func (t *TenantManager) RetrieveServiceProviderEntities(req *types.RetrieveServiceProviderEntities) soap.HasFault
- func (t *TenantManager) UnmarkServiceProviderEntities(req *types.UnmarkServiceProviderEntities) soap.HasFault
- type UserDirectory
- type VStorageObject
- type VcenterVStorageObjectManager
- func (m *VcenterVStorageObjectManager) AttachTagToVStorageObject(ctx *Context, req *types.AttachTagToVStorageObject) soap.HasFault
- func (m *VcenterVStorageObjectManager) CreateDiskTask(ctx *Context, req *types.CreateDisk_Task) soap.HasFault
- func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(ctx *Context, req *types.DeleteSnapshot_Task) soap.HasFault
- func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(ctx *Context, req *types.DeleteVStorageObject_Task) soap.HasFault
- func (m *VcenterVStorageObjectManager) DetachTagFromVStorageObject(ctx *Context, req *types.DetachTagFromVStorageObject) soap.HasFault
- func (m *VcenterVStorageObjectManager) ExtendDiskTask(ctx *Context, req *types.ExtendDisk_Task) soap.HasFault
- func (m *VcenterVStorageObjectManager) ListTagsAttachedToVStorageObject(ctx *Context, req *types.ListTagsAttachedToVStorageObject) soap.HasFault
- func (m *VcenterVStorageObjectManager) ListVStorageObject(req *types.ListVStorageObject) soap.HasFault
- func (m *VcenterVStorageObjectManager) ListVStorageObjectsAttachedToTag(ctx *Context, req *types.ListVStorageObjectsAttachedToTag) soap.HasFault
- func (m *VcenterVStorageObjectManager) ReconcileDatastoreInventoryTask(ctx *Context, req *types.ReconcileDatastoreInventory_Task) soap.HasFault
- func (m *VcenterVStorageObjectManager) RegisterDisk(ctx *Context, req *types.RegisterDisk) soap.HasFault
- func (m *VcenterVStorageObjectManager) RetrieveSnapshotInfo(req *types.RetrieveSnapshotInfo) soap.HasFault
- func (m *VcenterVStorageObjectManager) RetrieveVStorageObject(ctx *Context, req *types.RetrieveVStorageObject) soap.HasFault
- func (m *VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask(ctx *Context, req *types.VStorageObjectCreateSnapshot_Task) soap.HasFault
- type ViewManager
- type VirtualApp
- func (a *VirtualApp) CloneVAppTask(ctx *Context, req *types.CloneVApp_Task) soap.HasFault
- func (a *VirtualApp) CreateChildVMTask(ctx *Context, req *types.CreateChildVM_Task) soap.HasFault
- func (a *VirtualApp) CreateVApp(req *types.CreateVApp) soap.HasFault
- func (a *VirtualApp) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
- func (a *VirtualApp) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault
- type VirtualDiskManager
- func (m *VirtualDiskManager) CopyVirtualDiskTask(ctx *Context, req *types.CopyVirtualDisk_Task) soap.HasFault
- func (m *VirtualDiskManager) CreateVirtualDiskTask(ctx *Context, req *types.CreateVirtualDisk_Task) soap.HasFault
- func (m *VirtualDiskManager) DeleteVirtualDiskTask(ctx *Context, req *types.DeleteVirtualDisk_Task) soap.HasFault
- func (m *VirtualDiskManager) ExtendVirtualDiskTask(ctx *Context, req *types.ExtendVirtualDisk_Task) soap.HasFault
- func (m *VirtualDiskManager) MO() mo.VirtualDiskManager
- func (m *VirtualDiskManager) MoveVirtualDiskTask(ctx *Context, req *types.MoveVirtualDisk_Task) soap.HasFault
- func (m *VirtualDiskManager) QueryVirtualDiskUuid(ctx *Context, req *types.QueryVirtualDiskUuid) soap.HasFault
- func (m *VirtualDiskManager) SetVirtualDiskUuid(_ *Context, req *types.SetVirtualDiskUuid) soap.HasFault
- type VirtualDiskManagerInterface
- type VirtualMachine
- func (vm *VirtualMachine) AttachDiskTask(ctx *Context, req *types.AttachDisk_Task) soap.HasFault
- func (vm *VirtualMachine) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soap.HasFault
- func (vm *VirtualMachine) CreateSnapshotTask(ctx *Context, req *types.CreateSnapshot_Task) soap.HasFault
- func (vm *VirtualMachine) CustomizeVMTask(ctx *Context, req *types.CustomizeVM_Task) soap.HasFault
- func (vm *VirtualMachine) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
- func (vm *VirtualMachine) DetachDiskTask(ctx *Context, req *types.DetachDisk_Task) soap.HasFault
- func (vm *VirtualMachine) MarkAsTemplate(req *types.MarkAsTemplate) soap.HasFault
- func (vm *VirtualMachine) MarkAsVirtualMachine(req *types.MarkAsVirtualMachine) soap.HasFault
- func (vm *VirtualMachine) PowerOffVMTask(ctx *Context, c *types.PowerOffVM_Task) soap.HasFault
- func (vm *VirtualMachine) PowerOnVMTask(ctx *Context, c *types.PowerOnVM_Task) soap.HasFault
- func (vm *VirtualMachine) RebootGuest(ctx *Context, req *types.RebootGuest) soap.HasFault
- func (vm *VirtualMachine) ReconfigVMTask(ctx *Context, req *types.ReconfigVM_Task) soap.HasFault
- func (vm *VirtualMachine) RefreshStorageInfo(ctx *Context, req *types.RefreshStorageInfo) soap.HasFault
- func (*VirtualMachine) Reload(*types.Reload) soap.HasFault
- func (vm *VirtualMachine) RelocateVMTask(ctx *Context, req *types.RelocateVM_Task) soap.HasFault
- func (vm *VirtualMachine) RemoveAllSnapshotsTask(ctx *Context, req *types.RemoveAllSnapshots_Task) soap.HasFault
- func (o *VirtualMachine) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault
- func (vm *VirtualMachine) ResetVMTask(ctx *Context, req *types.ResetVM_Task) soap.HasFault
- func (vm *VirtualMachine) RevertToCurrentSnapshotTask(ctx *Context, req *types.RevertToCurrentSnapshot_Task) soap.HasFault
- func (vm *VirtualMachine) SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault
- func (vm *VirtualMachine) ShutdownGuest(ctx *Context, c *types.ShutdownGuest) soap.HasFault
- func (vm *VirtualMachine) StandbyGuest(ctx *Context, c *types.StandbyGuest) soap.HasFault
- func (vm *VirtualMachine) SuspendVMTask(ctx *Context, req *types.SuspendVM_Task) soap.HasFault
- func (vm *VirtualMachine) UnregisterVM(ctx *Context, c *types.UnregisterVM) soap.HasFault
- func (vm *VirtualMachine) UpgradeVMTask(ctx *Context, req *types.UpgradeVM_Task) soap.HasFault
- type VirtualMachineSnapshot
- type VmCompatibilityChecker
- type VmProvisioningChecker
Examples ¶
Constants ¶
const ContainerBackingOptionKey = "RUN.container"
Variables ¶
var ( // Trace when set to true, writes SOAP traffic to stderr Trace = false // TraceFile is the output file when Trace = true TraceFile = os.Stderr // DefaultLogin for authentication DefaultLogin = url.UserPassword("user", "pass") )
var DefaultCustomizationSpec = []types.CustomizationSpecItem{ { Info: types.CustomizationSpecInfo{ Name: "vcsim-linux", Description: "", Type: "Linux", ChangeVersion: "1569965707", LastUpdateTime: types.NewTime(time.Now()), }, Spec: types.CustomizationSpec{ Options: &types.CustomizationLinuxOptions{}, Identity: &types.CustomizationLinuxPrep{ CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, HostName: &types.CustomizationVirtualMachineName{}, Domain: "eng.vmware.com", TimeZone: "Pacific/Apia", HwClockUTC: types.NewBool(true), }, GlobalIPSettings: types.CustomizationGlobalIPSettings{ DnsSuffixList: nil, DnsServerList: []string{"127.0.1.1"}, }, NicSettingMap: []types.CustomizationAdapterMapping{ { MacAddress: "", Adapter: types.CustomizationIPSettings{ Ip: &types.CustomizationDhcpIpGenerator{}, SubnetMask: "", Gateway: nil, IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), DnsServerList: nil, DnsDomain: "", PrimaryWINS: "", SecondaryWINS: "", NetBIOS: "", }, }, }, EncryptionKey: nil, }, }, { Info: types.CustomizationSpecInfo{ Name: "vcsim-linux-static", Description: "", Type: "Linux", ChangeVersion: "1569969598", LastUpdateTime: types.NewTime(time.Now()), }, Spec: types.CustomizationSpec{ Options: &types.CustomizationLinuxOptions{}, Identity: &types.CustomizationLinuxPrep{ CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, HostName: &types.CustomizationPrefixName{ CustomizationName: types.CustomizationName{}, Base: "vcsim", }, Domain: "eng.vmware.com", TimeZone: "Africa/Cairo", HwClockUTC: types.NewBool(true), }, GlobalIPSettings: types.CustomizationGlobalIPSettings{ DnsSuffixList: nil, DnsServerList: []string{"127.0.1.1"}, }, NicSettingMap: []types.CustomizationAdapterMapping{ { MacAddress: "", Adapter: types.CustomizationIPSettings{ Ip: &types.CustomizationUnknownIpGenerator{}, SubnetMask: "255.255.255.0", Gateway: []string{"10.0.0.1"}, IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), DnsServerList: nil, DnsDomain: "", PrimaryWINS: "", SecondaryWINS: "", NetBIOS: "", }, }, }, EncryptionKey: nil, }, }, { Info: types.CustomizationSpecInfo{ Name: "vcsim-windows-static", Description: "", Type: "Windows", ChangeVersion: "1569978029", LastUpdateTime: types.NewTime(time.Now()), }, Spec: types.CustomizationSpec{ Options: &types.CustomizationWinOptions{ CustomizationOptions: types.CustomizationOptions{}, ChangeSID: true, DeleteAccounts: false, Reboot: "", }, Identity: &types.CustomizationSysprep{ CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, GuiUnattended: types.CustomizationGuiUnattended{ Password: (*types.CustomizationPassword)(nil), TimeZone: 2, AutoLogon: false, AutoLogonCount: 1, }, UserData: types.CustomizationUserData{ FullName: "vcsim", OrgName: "VMware", ComputerName: &types.CustomizationVirtualMachineName{}, ProductId: "", }, GuiRunOnce: (*types.CustomizationGuiRunOnce)(nil), Identification: types.CustomizationIdentification{ JoinWorkgroup: "WORKGROUP", JoinDomain: "", DomainAdmin: "", DomainAdminPassword: (*types.CustomizationPassword)(nil), }, LicenseFilePrintData: &types.CustomizationLicenseFilePrintData{ AutoMode: "perServer", AutoUsers: 5, }, }, GlobalIPSettings: types.CustomizationGlobalIPSettings{}, NicSettingMap: []types.CustomizationAdapterMapping{ { MacAddress: "", Adapter: types.CustomizationIPSettings{ Ip: &types.CustomizationUnknownIpGenerator{}, SubnetMask: "255.255.255.0", Gateway: []string{"10.0.0.1"}, IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), DnsServerList: nil, DnsDomain: "", PrimaryWINS: "", SecondaryWINS: "", NetBIOS: "", }, }, }, EncryptionKey: nil, }, }, { Info: types.CustomizationSpecInfo{ Name: "vcsim-windows-domain", Description: "", Type: "Windows", ChangeVersion: "1569970234", LastUpdateTime: types.NewTime(time.Now()), }, Spec: types.CustomizationSpec{ Options: &types.CustomizationWinOptions{ CustomizationOptions: types.CustomizationOptions{}, ChangeSID: true, DeleteAccounts: false, Reboot: "", }, Identity: &types.CustomizationSysprep{ CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, GuiUnattended: types.CustomizationGuiUnattended{ Password: &types.CustomizationPassword{ Value: "3Gs...==", PlainText: false, }, TimeZone: 15, AutoLogon: false, AutoLogonCount: 1, }, UserData: types.CustomizationUserData{ FullName: "dougm", OrgName: "VMware", ComputerName: &types.CustomizationVirtualMachineName{}, ProductId: "", }, GuiRunOnce: (*types.CustomizationGuiRunOnce)(nil), Identification: types.CustomizationIdentification{ JoinWorkgroup: "", JoinDomain: "DOMAIN", DomainAdmin: "vcsim", DomainAdminPassword: &types.CustomizationPassword{ Value: "H3g...==", PlainText: false, }, }, LicenseFilePrintData: &types.CustomizationLicenseFilePrintData{ AutoMode: "perServer", AutoUsers: 5, }, }, GlobalIPSettings: types.CustomizationGlobalIPSettings{}, NicSettingMap: []types.CustomizationAdapterMapping{ { MacAddress: "", Adapter: types.CustomizationIPSettings{ Ip: &types.CustomizationUnknownIpGenerator{}, SubnetMask: "255.255.255.0", Gateway: []string{"10.0.0.1"}, IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), DnsServerList: nil, DnsDomain: "", PrimaryWINS: "", SecondaryWINS: "", NetBIOS: "", }, }, }, EncryptionKey: nil, }, }, }
var DefaultUserGroup = []*types.UserSearchResult{ {FullName: "root", Group: true, Principal: "root"}, {FullName: "root", Group: false, Principal: "root"}, {FullName: "administrator", Group: false, Principal: "admin"}, }
var EvalLicense = types.LicenseManagerLicenseInfo{ LicenseKey: "00000-00000-00000-00000-00000", EditionKey: "eval", Name: "Evaluation Mode", Properties: []types.KeyAnyValue{ { Key: "feature", Value: types.KeyValue{ Key: "serialuri:2", Value: "Remote virtual Serial Port Concentrator", }, }, { Key: "feature", Value: types.KeyValue{ Key: "dvs", Value: "vSphere Distributed Switch", }, }, }, }
EvalLicense is the default license
var ExtensionList = []types.Extension{ { Description: &types.Description{ Label: "vcsim", Summary: "Go vCenter simulator", }, Key: "com.vmware.govmomi.simulator", Company: "VMware, Inc.", Type: "", Version: "0.37.0", SubjectName: "", Server: nil, Client: nil, TaskList: []types.ExtensionTaskTypeInfo{ { TaskID: "com.vmware.govmomi.simulator.test", }, }, EventList: nil, FaultList: nil, PrivilegeList: nil, ResourceList: nil, LastHeartbeatTime: time.Now(), HealthInfo: (*types.ExtensionHealthInfo)(nil), OvfConsumerInfo: (*types.ExtensionOvfConsumerInfo)(nil), ExtendedProductInfo: (*types.ExtExtendedProductInfo)(nil), ManagedEntityInfo: nil, ShownInSolutionManager: types.NewBool(false), SolutionManagerInfo: (*types.ExtSolutionManagerInfo)(nil), }, }
var GuestID = types.VirtualMachineGuestOsIdentifier("").Values()
GuestID is the list of valid types.VirtualMachineGuestOsIdentifier
var Map = NewRegistry()
Map is the default Registry instance.
TODO/WIP: To support the eventual removal of this unsyncronized global variable, the Map should be accessed through any Context.Map that is passed in to functions that may need it.
var ( // SessionIdleTimeout duration used to expire idle sessions SessionIdleTimeout time.Duration )
var StatusSDK = http.StatusOK
StatusSDK can be used to simulate an /sdk HTTP response code other than 200. The value of StatusSDK is restored to http.StatusOK after 1 response. This can be useful to test vim25.Retry() for example.
var TaskDelay = DelayConfig{}
TaskDelay applies to all tasks. Names for DelayConfig.MethodDelay will differ for task and api delays. API level names often look like PowerOff_Task, whereas the task name is simply PowerOff.
Functions ¶
func CreateDefaultESX ¶
CreateDefaultESX creates a standalone ESX Adds objects of type: Datacenter, Network, ComputeResource, ResourcePool and HostSystem
func DisableRuleset ¶
func DisableRuleset(info *types.HostFirewallInfo, id string) bool
func EnableRuleset ¶
func EnableRuleset(info *types.HostFirewallInfo, id string) bool
func Fault ¶
func Fault(msg string, fault types.BaseMethodFault) *soap.Fault
Fault wraps the given message and fault in a soap.Fault
func FindReference ¶
func FindReference(refs []types.ManagedObjectReference, match ...types.ManagedObjectReference) *types.ManagedObjectReference
FindReference returns the 1st match found in refs, or nil if not found.
func NewOptionManager ¶
func NewOptionManager(ref *types.ManagedObjectReference, setting []types.BaseOptionValue, mirror *[]types.BaseOptionValue) object.Reference
NewOptionManager constructs the type. If mirror is non-nil it takes precedence over settings, and settings is ignored. Args:
- ref - used to set OptionManager.Self if non-nil
- setting - initial options, may be nil.
- mirror - options array to keep updated with the OptionManager.Settings, may be nil.
func NewPropertyCollector ¶
func NewPropertyCollector(ref types.ManagedObjectReference) object.Reference
func NewVAppConfigSpec ¶
func NewVAppConfigSpec() types.VAppConfigSpec
func RegisterEndpoint ¶ added in v0.22.0
RegisterEndpoint funcs are called after the Server is initialized if Service.RegisterEndpoints=true. Such a func would typically register a SOAP endpoint via Service.RegisterSDK or REST endpoint via Service.Handle
func RemoveReference ¶
func RemoveReference(field *[]types.ManagedObjectReference, ref types.ManagedObjectReference)
RemoveReference removes ref from the given field.
func RenameTask ¶
func Run ¶ added in v0.22.0
Run calls Model.Run for each model and will panic if f returns an error. If no model is specified, the VPX Model is used by default.
func RunContainer ¶ added in v0.26.0
RunContainer runs a vm container with the given args
func ServeGuest ¶ added in v0.23.0
func ServeGuest(w http.ResponseWriter, r *http.Request)
ServeGuest handles container guest file upload/download
func ServeNFC ¶ added in v0.21.0
func ServeNFC(w http.ResponseWriter, r *http.Request)
ServeNFC handles NFC file upload/download
func SessionIdleWatch ¶ added in v0.23.0
SessionIdleWatch starts a goroutine that calls func expired() at SessionIdleTimeout intervals. The goroutine exits if the func returns true.
func SetCustomValue ¶ added in v0.20.0
func SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault
func Test ¶ added in v0.22.0
Test calls Run and expects the caller propagate any errors, via testing.T for example.
Example ¶
Test simplifies startup/cleanup of a simulator instance for testing purposes.
package main import ( "context" "fmt" "log" "github.com/vmware/govmomi/session" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25" ) func main() { simulator.Test(func(ctx context.Context, c *vim25.Client) { // Client has connected and logged in to a new simulator instance. // Server.Close and Model.Remove are called when this func returns. s, err := session.NewManager(c).UserSession(ctx) if err != nil { log.Fatal(err) } fmt.Print(s.UserName) }) }
Output: user
Types ¶
type Alarm ¶ added in v0.40.0
func (*Alarm) ReconfigureAlarm ¶ added in v0.40.0
func (*Alarm) RemoveAlarm ¶ added in v0.40.0
type AlarmManager ¶ added in v0.40.0
type AlarmManager struct { mo.AlarmManager types.GetAlarmResponse }
func (*AlarmManager) AcknowledgeAlarm ¶ added in v0.40.0
func (m *AlarmManager) AcknowledgeAlarm(ctx *Context, req *types.AcknowledgeAlarm) soap.HasFault
func (*AlarmManager) CreateAlarm ¶ added in v0.40.0
func (m *AlarmManager) CreateAlarm(ctx *Context, req *types.CreateAlarm) soap.HasFault
type AuthorizationManager ¶
type AuthorizationManager struct { mo.AuthorizationManager // contains filtered or unexported fields }
func (*AuthorizationManager) AddAuthorizationRole ¶
func (m *AuthorizationManager) AddAuthorizationRole(req *types.AddAuthorizationRole) soap.HasFault
func (*AuthorizationManager) FetchUserPrivilegeOnEntities ¶ added in v0.24.0
func (m *AuthorizationManager) FetchUserPrivilegeOnEntities(req *types.FetchUserPrivilegeOnEntities) soap.HasFault
func (*AuthorizationManager) HasPrivilegeOnEntities ¶ added in v0.23.0
func (m *AuthorizationManager) HasPrivilegeOnEntities(req *types.HasPrivilegeOnEntities) soap.HasFault
func (*AuthorizationManager) HasPrivilegeOnEntity ¶ added in v0.24.0
func (m *AuthorizationManager) HasPrivilegeOnEntity(req *types.HasPrivilegeOnEntity) soap.HasFault
func (*AuthorizationManager) HasUserPrivilegeOnEntities ¶ added in v0.24.0
func (m *AuthorizationManager) HasUserPrivilegeOnEntities(req *types.HasUserPrivilegeOnEntities) soap.HasFault
func (*AuthorizationManager) RemoveAuthorizationRole ¶
func (m *AuthorizationManager) RemoveAuthorizationRole(req *types.RemoveAuthorizationRole) soap.HasFault
func (*AuthorizationManager) RemoveEntityPermission ¶
func (m *AuthorizationManager) RemoveEntityPermission(req *types.RemoveEntityPermission) soap.HasFault
func (*AuthorizationManager) RetrieveAllPermissions ¶
func (m *AuthorizationManager) RetrieveAllPermissions(req *types.RetrieveAllPermissions) soap.HasFault
func (*AuthorizationManager) RetrieveEntityPermissions ¶
func (m *AuthorizationManager) RetrieveEntityPermissions(req *types.RetrieveEntityPermissions) soap.HasFault
func (*AuthorizationManager) RetrieveRolePermissions ¶
func (m *AuthorizationManager) RetrieveRolePermissions(req *types.RetrieveRolePermissions) soap.HasFault
func (*AuthorizationManager) SetEntityPermissions ¶
func (m *AuthorizationManager) SetEntityPermissions(req *types.SetEntityPermissions) soap.HasFault
func (*AuthorizationManager) UpdateAuthorizationRole ¶
func (m *AuthorizationManager) UpdateAuthorizationRole(req *types.UpdateAuthorizationRole) soap.HasFault
type ClusterComputeResource ¶
type ClusterComputeResource struct { mo.ClusterComputeResource // contains filtered or unexported fields }
func CreateClusterComputeResource ¶
func CreateClusterComputeResource(ctx *Context, f *Folder, name string, spec types.ClusterConfigSpecEx) (*ClusterComputeResource, types.BaseMethodFault)
func (*ClusterComputeResource) AddHostTask ¶
func (c *ClusterComputeResource) AddHostTask(ctx *Context, add *types.AddHost_Task) soap.HasFault
func (*ClusterComputeResource) MoveIntoTask ¶ added in v0.31.0
func (c *ClusterComputeResource) MoveIntoTask(ctx *Context, req *types.MoveInto_Task) soap.HasFault
func (*ClusterComputeResource) ReconfigureComputeResourceTask ¶ added in v0.17.0
func (c *ClusterComputeResource) ReconfigureComputeResourceTask(ctx *Context, req *types.ReconfigureComputeResource_Task) soap.HasFault
func (*ClusterComputeResource) RenameTask ¶ added in v0.20.0
func (c *ClusterComputeResource) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault
type ContainerView ¶
type ContainerView struct { mo.ContainerView // contains filtered or unexported fields }
func (*ContainerView) DestroyView ¶
func (v *ContainerView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault
func (*ContainerView) PutObject ¶ added in v0.24.0
func (v *ContainerView) PutObject(obj mo.Reference)
func (*ContainerView) RemoveObject ¶ added in v0.24.0
func (v *ContainerView) RemoveObject(ctx *Context, obj types.ManagedObjectReference)
func (*ContainerView) UpdateObject ¶ added in v0.24.0
func (*ContainerView) UpdateObject(*Context, mo.Reference, []types.PropertyChange)
type Context ¶ added in v0.17.0
type Context struct { context.Context Session *Session Header soap.Header Caller *types.ManagedObjectReference Map *Registry // contains filtered or unexported fields }
Context provides per-request Session management.
func SpoofContext ¶ added in v0.25.0
func SpoofContext() *Context
When simulator code needs to call other simulator code, it typically passes whatever context is associated with the request it's servicing. Model code isn't servicing a request, but still needs a context, so we spoof one for the purposes of calling simulator code. Test code also tends to do this.
func (*Context) SetSession ¶ added in v0.17.0
SetSession should be called after successful authentication.
type CryptoManagerKmip ¶ added in v0.44.0
type CryptoManagerKmip struct { mo.CryptoManagerKmip // contains filtered or unexported fields }
func (*CryptoManagerKmip) GenerateKey ¶ added in v0.44.0
func (m *CryptoManagerKmip) GenerateKey( ctx *Context, req *types.GenerateKey) soap.HasFault
func (*CryptoManagerKmip) GetDefaultKmsCluster ¶ added in v0.44.0
func (m *CryptoManagerKmip) GetDefaultKmsCluster( ctx *Context, req *types.GetDefaultKmsCluster) soap.HasFault
TODO: Implement req.DefaultsToParent
func (*CryptoManagerKmip) ListKmipServers ¶ added in v0.44.0
func (m *CryptoManagerKmip) ListKmipServers( ctx *Context, req *types.ListKmipServers) soap.HasFault
func (*CryptoManagerKmip) MarkDefault ¶ added in v0.44.0
func (m *CryptoManagerKmip) MarkDefault( ctx *Context, req *types.MarkDefault) soap.HasFault
func (*CryptoManagerKmip) RegisterKmipServer ¶ added in v0.44.0
func (m *CryptoManagerKmip) RegisterKmipServer( ctx *Context, req *types.RegisterKmipServer) soap.HasFault
func (*CryptoManagerKmip) RegisterKmsCluster ¶ added in v0.44.0
func (m *CryptoManagerKmip) RegisterKmsCluster( ctx *Context, req *types.RegisterKmsCluster) soap.HasFault
func (*CryptoManagerKmip) RemoveKmipServer ¶ added in v0.44.0
func (m *CryptoManagerKmip) RemoveKmipServer( ctx *Context, req *types.RemoveKmipServer) soap.HasFault
func (*CryptoManagerKmip) RetrieveKmipServersStatusTask ¶ added in v0.44.0
func (m *CryptoManagerKmip) RetrieveKmipServersStatusTask( ctx *Context, req *types.RetrieveKmipServersStatus_Task) soap.HasFault
func (*CryptoManagerKmip) SetDefaultKmsCluster ¶ added in v0.44.0
func (m *CryptoManagerKmip) SetDefaultKmsCluster( ctx *Context, req *types.SetDefaultKmsCluster) soap.HasFault
func (*CryptoManagerKmip) UnregisterKmsCluster ¶ added in v0.44.0
func (m *CryptoManagerKmip) UnregisterKmsCluster( ctx *Context, req *types.UnregisterKmsCluster) soap.HasFault
func (*CryptoManagerKmip) UpdateKmipServer ¶ added in v0.44.0
func (m *CryptoManagerKmip) UpdateKmipServer( ctx *Context, req *types.UpdateKmipServer) soap.HasFault
type CustomFieldsManager ¶
type CustomFieldsManager struct { mo.CustomFieldsManager // contains filtered or unexported fields }
func (*CustomFieldsManager) AddCustomFieldDef ¶
func (c *CustomFieldsManager) AddCustomFieldDef(ctx *Context, req *types.AddCustomFieldDef) soap.HasFault
func (*CustomFieldsManager) RemoveCustomFieldDef ¶
func (c *CustomFieldsManager) RemoveCustomFieldDef(ctx *Context, req *types.RemoveCustomFieldDef) soap.HasFault
func (*CustomFieldsManager) RenameCustomFieldDef ¶
func (c *CustomFieldsManager) RenameCustomFieldDef(ctx *Context, req *types.RenameCustomFieldDef) soap.HasFault
type CustomizationSpecManager ¶ added in v0.22.0
type CustomizationSpecManager struct { mo.CustomizationSpecManager // contains filtered or unexported fields }
func (*CustomizationSpecManager) CreateCustomizationSpec ¶ added in v0.22.0
func (m *CustomizationSpecManager) CreateCustomizationSpec(ctx *Context, req *types.CreateCustomizationSpec) soap.HasFault
func (*CustomizationSpecManager) DoesCustomizationSpecExist ¶ added in v0.22.0
func (m *CustomizationSpecManager) DoesCustomizationSpecExist(ctx *Context, req *types.DoesCustomizationSpecExist) soap.HasFault
func (*CustomizationSpecManager) Get ¶ added in v0.22.0
func (m *CustomizationSpecManager) Get() mo.Reference
func (*CustomizationSpecManager) GetCustomizationSpec ¶ added in v0.22.0
func (m *CustomizationSpecManager) GetCustomizationSpec(ctx *Context, req *types.GetCustomizationSpec) soap.HasFault
func (*CustomizationSpecManager) OverwriteCustomizationSpec ¶ added in v0.22.0
func (m *CustomizationSpecManager) OverwriteCustomizationSpec(ctx *Context, req *types.OverwriteCustomizationSpec) soap.HasFault
type Datacenter ¶ added in v0.17.0
type Datacenter struct { mo.Datacenter // contains filtered or unexported fields }
func NewDatacenter ¶ added in v0.17.0
func NewDatacenter(ctx *Context, f *mo.Folder) *Datacenter
NewDatacenter creates a Datacenter and its child folders.
func (*Datacenter) DestroyTask ¶ added in v0.17.1
func (d *Datacenter) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
func (*Datacenter) PowerOnMultiVMTask ¶ added in v0.17.0
func (dc *Datacenter) PowerOnMultiVMTask(ctx *Context, req *types.PowerOnMultiVM_Task) soap.HasFault
func (*Datacenter) RenameTask ¶ added in v0.22.0
func (dc *Datacenter) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault
type Datastore ¶
func (*Datastore) DestroyTask ¶ added in v0.21.0
func (*Datastore) RefreshDatastore ¶
func (ds *Datastore) RefreshDatastore(*types.RefreshDatastore) soap.HasFault
type DatastoreNamespaceManager ¶ added in v0.40.0
type DatastoreNamespaceManager struct {
mo.DatastoreNamespaceManager
}
func (*DatastoreNamespaceManager) ConvertNamespacePathToUuidPath ¶ added in v0.40.0
func (m *DatastoreNamespaceManager) ConvertNamespacePathToUuidPath(ctx *Context, req *types.ConvertNamespacePathToUuidPath) soap.HasFault
type DelayConfig ¶ added in v0.20.0
type DelayConfig struct { // Delay specifies the number of milliseconds to delay serving a SOAP call. 0 means no delay. // This can be used to simulate a poorly performing vCenter or network lag. Delay int // Delay specifies the number of milliseconds to delay serving a specific method. // Each entry in the map represents the name of a method and its associated delay in milliseconds, // This can be used to simulate a poorly performing vCenter or network lag. MethodDelay map[string]int // DelayJitter defines the delay jitter as a coefficient of variation (stddev/mean). // This can be used to simulate unpredictable delay. 0 means no jitter, i.e. all invocations get the same delay. DelayJitter float64 }
type DistributedVirtualPortgroup ¶
type DistributedVirtualPortgroup struct {
mo.DistributedVirtualPortgroup
}
func (*DistributedVirtualPortgroup) DestroyTask ¶
func (s *DistributedVirtualPortgroup) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
func (*DistributedVirtualPortgroup) ReconfigureDVPortgroupTask ¶
func (s *DistributedVirtualPortgroup) ReconfigureDVPortgroupTask(ctx *Context, req *types.ReconfigureDVPortgroup_Task) soap.HasFault
func (*DistributedVirtualPortgroup) RenameTask ¶ added in v0.27.1
func (s *DistributedVirtualPortgroup) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault
type DistributedVirtualSwitch ¶
type DistributedVirtualSwitch struct { mo.DistributedVirtualSwitch types.FetchDVPortsResponse }
func (*DistributedVirtualSwitch) AddDVPortgroupTask ¶
func (s *DistributedVirtualSwitch) AddDVPortgroupTask(ctx *Context, c *types.AddDVPortgroup_Task) soap.HasFault
Example ¶
AddDVPortgroup against vcsim can create both standard and nsx backed DistributedVirtualPortgroup networks
package main import ( "context" "fmt" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) func main() { simulator.Run(func(ctx context.Context, c *vim25.Client) error { finder := find.NewFinder(c) dvs0, err := finder.Network(ctx, "DVS0") if err != nil { return err } spec := types.DVPortgroupConfigSpec{ Name: "my-nsx-dvpg", LogicalSwitchUuid: "my-nsx-id", } dvs := dvs0.(*object.DistributedVirtualSwitch) task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{spec}) if err != nil { return err } if err = task.Wait(ctx); err != nil { return err } pg0, err := finder.Network(ctx, spec.Name) if err != nil { return err } pg := pg0.(*object.DistributedVirtualPortgroup) var props mo.DistributedVirtualPortgroup err = pg.Properties(ctx, pg.Reference(), []string{"config"}, &props) if err != nil { return err } fmt.Printf("%s: %s %s", pg.Name(), props.Config.BackingType, props.Config.LogicalSwitchUuid) return nil }) }
Output: my-nsx-dvpg: nsx my-nsx-id
func (*DistributedVirtualSwitch) DestroyTask ¶
func (s *DistributedVirtualSwitch) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
func (*DistributedVirtualSwitch) FetchDVPorts ¶
func (s *DistributedVirtualSwitch) FetchDVPorts(req *types.FetchDVPorts) soap.HasFault
func (*DistributedVirtualSwitch) ReconfigureDvsTask ¶
func (s *DistributedVirtualSwitch) ReconfigureDvsTask(ctx *Context, req *types.ReconfigureDvs_Task) soap.HasFault
type DistributedVirtualSwitchManager ¶ added in v0.24.1
type DistributedVirtualSwitchManager struct {
mo.DistributedVirtualSwitchManager
}
func (*DistributedVirtualSwitchManager) DVSManagerLookupDvPortGroup ¶ added in v0.24.1
func (m *DistributedVirtualSwitchManager) DVSManagerLookupDvPortGroup(ctx *Context, req *types.DVSManagerLookupDvPortGroup) soap.HasFault
type Element ¶ added in v0.18.0
type Element struct {
// contains filtered or unexported fields
}
Element can be used to defer decoding of an XML node.
func (*Element) UnmarshalXML ¶ added in v0.18.0
type EnvironmentBrowser ¶ added in v0.20.0
type EnvironmentBrowser struct { mo.EnvironmentBrowser QueryConfigTargetResponse types.QueryConfigTargetResponse QueryConfigOptionResponse types.QueryConfigOptionResponse QueryConfigOptionDescriptorResponse types.QueryConfigOptionDescriptorResponse QueryTargetCapabilitiesResponse types.QueryTargetCapabilitiesResponse }
func (*EnvironmentBrowser) QueryConfigOption ¶ added in v0.20.0
func (b *EnvironmentBrowser) QueryConfigOption(req *types.QueryConfigOption) soap.HasFault
func (*EnvironmentBrowser) QueryConfigOptionDescriptor ¶ added in v0.21.0
func (b *EnvironmentBrowser) QueryConfigOptionDescriptor(ctx *Context, req *types.QueryConfigOptionDescriptor) soap.HasFault
func (*EnvironmentBrowser) QueryConfigOptionEx ¶ added in v0.20.0
func (b *EnvironmentBrowser) QueryConfigOptionEx(req *types.QueryConfigOptionEx) soap.HasFault
func (*EnvironmentBrowser) QueryConfigTarget ¶ added in v0.21.0
func (b *EnvironmentBrowser) QueryConfigTarget(ctx *Context, req *types.QueryConfigTarget) soap.HasFault
func (*EnvironmentBrowser) QueryTargetCapabilities ¶ added in v0.32.0
func (b *EnvironmentBrowser) QueryTargetCapabilities(ctx *Context, req *types.QueryTargetCapabilities) soap.HasFault
type EventHistoryCollector ¶ added in v0.17.0
type EventHistoryCollector struct { mo.EventHistoryCollector *HistoryCollector }
func (*EventHistoryCollector) Get ¶ added in v0.17.0
func (c *EventHistoryCollector) Get() mo.Reference
func (*EventHistoryCollector) GetLatestPage ¶ added in v0.17.1
func (c *EventHistoryCollector) GetLatestPage() []types.BaseEvent
func (*EventHistoryCollector) ReadNextEvents ¶ added in v0.20.0
func (c *EventHistoryCollector) ReadNextEvents(ctx *Context, req *types.ReadNextEvents) soap.HasFault
func (*EventHistoryCollector) ReadPreviousEvents ¶ added in v0.20.0
func (c *EventHistoryCollector) ReadPreviousEvents(ctx *Context, req *types.ReadPreviousEvents) soap.HasFault
type EventManager ¶ added in v0.17.0
type EventManager struct { mo.EventManager // contains filtered or unexported fields }
func (*EventManager) CreateCollectorForEvents ¶ added in v0.17.0
func (m *EventManager) CreateCollectorForEvents(ctx *Context, req *types.CreateCollectorForEvents) soap.HasFault
func (*EventManager) QueryEvents ¶ added in v0.17.1
func (m *EventManager) QueryEvents(ctx *Context, req *types.QueryEvents) soap.HasFault
type ExtensionManager ¶ added in v0.37.0
type ExtensionManager struct {
mo.ExtensionManager
}
func (*ExtensionManager) FindExtension ¶ added in v0.37.0
func (m *ExtensionManager) FindExtension(ctx *Context, req *types.FindExtension) soap.HasFault
func (*ExtensionManager) RegisterExtension ¶ added in v0.37.0
func (m *ExtensionManager) RegisterExtension(ctx *Context, req *types.RegisterExtension) soap.HasFault
func (*ExtensionManager) SetExtensionCertificate ¶ added in v0.37.0
func (m *ExtensionManager) SetExtensionCertificate(ctx *Context, req *types.SetExtensionCertificate) soap.HasFault
func (*ExtensionManager) UnregisterExtension ¶ added in v0.37.0
func (m *ExtensionManager) UnregisterExtension(ctx *Context, req *types.UnregisterExtension) soap.HasFault
func (*ExtensionManager) UpdateExtension ¶ added in v0.37.0
func (m *ExtensionManager) UpdateExtension(ctx *Context, req *types.UpdateExtension) soap.HasFault
type FileManager ¶
type FileManager struct {
mo.FileManager
}
func (*FileManager) CopyDatastoreFileTask ¶
func (f *FileManager) CopyDatastoreFileTask(ctx *Context, req *types.CopyDatastoreFile_Task) soap.HasFault
func (*FileManager) DeleteDatastoreFileTask ¶
func (f *FileManager) DeleteDatastoreFileTask(ctx *Context, req *types.DeleteDatastoreFile_Task) soap.HasFault
func (*FileManager) MakeDirectory ¶
func (f *FileManager) MakeDirectory(req *types.MakeDirectory) soap.HasFault
func (*FileManager) MoveDatastoreFileTask ¶
func (f *FileManager) MoveDatastoreFileTask(ctx *Context, req *types.MoveDatastoreFile_Task) soap.HasFault
type Folder ¶
func (*Folder) AddOpaqueNetwork ¶ added in v0.23.0
func (f *Folder) AddOpaqueNetwork(ctx *Context, summary types.OpaqueNetworkSummary) error
AddOpaqueNetwork adds an OpaqueNetwork type to the inventory, with default backing to that of an nsx.LogicalSwitch. The vSphere API does not have a method to add this directly, so it must either be called directly or via Model.OpaqueNetwork setting.
Example ¶
Folder.AddOpaqueNetwork can be used to create an NSX backed OpaqueNetwork.
package main import ( "context" "fmt" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/types" ) func main() { simulator.Run(func(ctx context.Context, c *vim25.Client) error { finder := find.NewFinder(c) // Find the network folder via vSphere API obj, err := finder.Folder(ctx, "network") if err != nil { return err } // Get vcsim's network Folder object folder := simulator.Map.Get(obj.Reference()).(*simulator.Folder) spec := types.OpaqueNetworkSummary{ NetworkSummary: types.NetworkSummary{ Name: "my-nsx-network", }, OpaqueNetworkId: "my-nsx-id", OpaqueNetworkType: "nsx.LogicalSwitch", } // Add NSX backed OpaqueNetwork, calling the simulator.Folder method directly. err = folder.AddOpaqueNetwork(simulator.SpoofContext(), spec) if err != nil { return err } // Find the OpaqueNetwork via vSphere API net, err := finder.Network(ctx, spec.Name) if err != nil { return err } nsx := net.(*object.OpaqueNetwork) summary, err := nsx.Summary(ctx) if err != nil { return err } // The summary fields should match those of the spec used to create it fmt.Printf("%s: %s", nsx.Name(), summary.OpaqueNetworkId) return nil }) }
Output: my-nsx-network: my-nsx-id
func (*Folder) AddStandaloneHostTask ¶
func (*Folder) CreateClusterEx ¶
func (*Folder) CreateDVSTask ¶
func (*Folder) CreateDatacenter ¶
func (*Folder) CreateFolder ¶
func (*Folder) CreateStoragePod ¶
func (*Folder) CreateVMTask ¶
func (*Folder) DestroyTask ¶ added in v0.17.1
func (*Folder) MoveIntoFolderTask ¶
func (*Folder) PlaceVmsXCluster ¶ added in v0.27.4
func (*Folder) RegisterVMTask ¶
func (*Folder) RenameTask ¶
type GuestFileManager ¶ added in v0.23.0
type GuestFileManager struct {
mo.GuestFileManager
}
func (*GuestFileManager) ChangeFileAttributesInGuest ¶ added in v0.26.0
func (m *GuestFileManager) ChangeFileAttributesInGuest(ctx *Context, req *types.ChangeFileAttributesInGuest) soap.HasFault
func (*GuestFileManager) CreateTemporaryDirectoryInGuest ¶ added in v0.26.0
func (m *GuestFileManager) CreateTemporaryDirectoryInGuest(ctx *Context, req *types.CreateTemporaryDirectoryInGuest) soap.HasFault
func (*GuestFileManager) CreateTemporaryFileInGuest ¶ added in v0.26.0
func (m *GuestFileManager) CreateTemporaryFileInGuest(ctx *Context, req *types.CreateTemporaryFileInGuest) soap.HasFault
func (*GuestFileManager) DeleteDirectoryInGuest ¶ added in v0.26.0
func (m *GuestFileManager) DeleteDirectoryInGuest(ctx *Context, req *types.DeleteDirectoryInGuest) soap.HasFault
func (*GuestFileManager) DeleteFileInGuest ¶ added in v0.26.0
func (m *GuestFileManager) DeleteFileInGuest(ctx *Context, req *types.DeleteFileInGuest) soap.HasFault
func (*GuestFileManager) InitiateFileTransferFromGuest ¶ added in v0.23.0
func (m *GuestFileManager) InitiateFileTransferFromGuest(ctx *Context, req *types.InitiateFileTransferFromGuest) soap.HasFault
func (*GuestFileManager) InitiateFileTransferToGuest ¶ added in v0.23.0
func (m *GuestFileManager) InitiateFileTransferToGuest(ctx *Context, req *types.InitiateFileTransferToGuest) soap.HasFault
func (*GuestFileManager) ListFilesInGuest ¶ added in v0.26.0
func (m *GuestFileManager) ListFilesInGuest(ctx *Context, req *types.ListFilesInGuest) soap.HasFault
func (*GuestFileManager) MakeDirectoryInGuest ¶ added in v0.26.0
func (m *GuestFileManager) MakeDirectoryInGuest(ctx *Context, req *types.MakeDirectoryInGuest) soap.HasFault
func (*GuestFileManager) MoveDirectoryInGuest ¶ added in v0.26.0
func (m *GuestFileManager) MoveDirectoryInGuest(ctx *Context, req *types.MoveDirectoryInGuest) soap.HasFault
func (*GuestFileManager) MoveFileInGuest ¶ added in v0.26.0
func (m *GuestFileManager) MoveFileInGuest(ctx *Context, req *types.MoveFileInGuest) soap.HasFault
type GuestOperationsManager ¶ added in v0.23.0
type GuestOperationsManager struct {
mo.GuestOperationsManager
}
type GuestProcessManager ¶ added in v0.23.0
type GuestProcessManager struct { mo.GuestProcessManager *process.Manager }
func (*GuestProcessManager) ListProcessesInGuest ¶ added in v0.26.0
func (m *GuestProcessManager) ListProcessesInGuest(ctx *Context, req *types.ListProcessesInGuest) soap.HasFault
func (*GuestProcessManager) StartProgramInGuest ¶ added in v0.26.0
func (m *GuestProcessManager) StartProgramInGuest(ctx *Context, req *types.StartProgramInGuest) soap.HasFault
func (*GuestProcessManager) TerminateProcessInGuest ¶ added in v0.26.0
func (m *GuestProcessManager) TerminateProcessInGuest(ctx *Context, req *types.TerminateProcessInGuest) soap.HasFault
type HistoryCollector ¶ added in v0.37.0
type HistoryCollector struct {
// contains filtered or unexported fields
}
func (*HistoryCollector) DestroyCollector ¶ added in v0.37.0
func (c *HistoryCollector) DestroyCollector(ctx *Context, req *types.DestroyCollector) soap.HasFault
func (*HistoryCollector) ResetCollector ¶ added in v0.37.0
func (c *HistoryCollector) ResetCollector(ctx *Context, req *types.ResetCollector) soap.HasFault
func (*HistoryCollector) RewindCollector ¶ added in v0.37.0
func (c *HistoryCollector) RewindCollector(ctx *Context, req *types.RewindCollector) soap.HasFault
func (*HistoryCollector) SetCollectorPageSize ¶ added in v0.37.0
func (c *HistoryCollector) SetCollectorPageSize(ctx *Context, req *types.SetCollectorPageSize) soap.HasFault
type HostCertificateManager ¶ added in v0.38.0
type HostCertificateManager struct { mo.HostCertificateManager Host *mo.HostSystem }
func NewHostCertificateManager ¶ added in v0.38.0
func NewHostCertificateManager(h *mo.HostSystem) *HostCertificateManager
func (*HostCertificateManager) GenerateCertificateSigningRequest ¶ added in v0.38.0
func (m *HostCertificateManager) GenerateCertificateSigningRequest(ctx *Context, req *types.GenerateCertificateSigningRequest) soap.HasFault
func (*HostCertificateManager) InstallServerCertificate ¶ added in v0.38.0
func (m *HostCertificateManager) InstallServerCertificate(ctx *Context, req *types.InstallServerCertificate) soap.HasFault
type HostDatastoreBrowser ¶
type HostDatastoreBrowser struct {
mo.HostDatastoreBrowser
}
func (*HostDatastoreBrowser) SearchDatastoreSubFoldersTask ¶
func (b *HostDatastoreBrowser) SearchDatastoreSubFoldersTask(ctx *Context, s *types.SearchDatastoreSubFolders_Task) soap.HasFault
func (*HostDatastoreBrowser) SearchDatastoreTask ¶
func (b *HostDatastoreBrowser) SearchDatastoreTask(ctx *Context, s *types.SearchDatastore_Task) soap.HasFault
type HostDatastoreSystem ¶
type HostDatastoreSystem struct { mo.HostDatastoreSystem Host *mo.HostSystem }
func (*HostDatastoreSystem) CreateLocalDatastore ¶
func (dss *HostDatastoreSystem) CreateLocalDatastore(ctx *Context, c *types.CreateLocalDatastore) soap.HasFault
func (*HostDatastoreSystem) CreateNasDatastore ¶
func (dss *HostDatastoreSystem) CreateNasDatastore(ctx *Context, c *types.CreateNasDatastore) soap.HasFault
type HostFirewallSystem ¶
type HostFirewallSystem struct {
mo.HostFirewallSystem
}
func NewHostFirewallSystem ¶
func NewHostFirewallSystem(_ *mo.HostSystem) *HostFirewallSystem
func (*HostFirewallSystem) DisableRuleset ¶
func (s *HostFirewallSystem) DisableRuleset(req *types.DisableRuleset) soap.HasFault
func (*HostFirewallSystem) EnableRuleset ¶
func (s *HostFirewallSystem) EnableRuleset(req *types.EnableRuleset) soap.HasFault
type HostLocalAccountManager ¶ added in v0.17.0
type HostLocalAccountManager struct {
mo.HostLocalAccountManager
}
func (*HostLocalAccountManager) CreateUser ¶ added in v0.17.0
func (h *HostLocalAccountManager) CreateUser(req *types.CreateUser) soap.HasFault
func (*HostLocalAccountManager) RemoveUser ¶ added in v0.17.0
func (h *HostLocalAccountManager) RemoveUser(req *types.RemoveUser) soap.HasFault
func (*HostLocalAccountManager) UpdateUser ¶ added in v0.17.0
func (h *HostLocalAccountManager) UpdateUser(req *types.UpdateUser) soap.HasFault
type HostNetworkSystem ¶
type HostNetworkSystem struct { mo.HostNetworkSystem Host *mo.HostSystem types.QueryNetworkHintResponse }
func NewHostNetworkSystem ¶
func NewHostNetworkSystem(host *mo.HostSystem) *HostNetworkSystem
func (*HostNetworkSystem) AddPortGroup ¶
func (s *HostNetworkSystem) AddPortGroup(ctx *Context, c *types.AddPortGroup) soap.HasFault
func (*HostNetworkSystem) AddVirtualSwitch ¶
func (s *HostNetworkSystem) AddVirtualSwitch(c *types.AddVirtualSwitch) soap.HasFault
func (*HostNetworkSystem) QueryNetworkHint ¶ added in v0.23.1
func (s *HostNetworkSystem) QueryNetworkHint(req *types.QueryNetworkHint) soap.HasFault
func (*HostNetworkSystem) RemovePortGroup ¶
func (s *HostNetworkSystem) RemovePortGroup(ctx *Context, c *types.RemovePortGroup) soap.HasFault
func (*HostNetworkSystem) RemoveVirtualSwitch ¶
func (s *HostNetworkSystem) RemoveVirtualSwitch(c *types.RemoveVirtualSwitch) soap.HasFault
func (*HostNetworkSystem) UpdateNetworkConfig ¶
func (s *HostNetworkSystem) UpdateNetworkConfig(req *types.UpdateNetworkConfig) soap.HasFault
type HostStorageSystem ¶ added in v0.23.0
type HostStorageSystem struct { mo.HostStorageSystem Host *mo.HostSystem HBA []types.BaseHostHostBusAdapter }
func NewHostStorageSystem ¶ added in v0.23.0
func NewHostStorageSystem(h *mo.HostSystem) *HostStorageSystem
func (*HostStorageSystem) RefreshStorageSystem ¶ added in v0.23.0
func (s *HostStorageSystem) RefreshStorageSystem(*Context, *types.RefreshStorageSystem) soap.HasFault
func (*HostStorageSystem) RescanAllHba ¶ added in v0.23.0
func (s *HostStorageSystem) RescanAllHba(ctx *Context, _ *types.RescanAllHba) soap.HasFault
RescanAllHba swaps HostStorageSystem.HBA and StorageDeviceInfo.HostBusAdapter. This allows testing HBA with and without Fibre Channel data.
func (*HostStorageSystem) RescanVmfs ¶ added in v0.23.0
func (s *HostStorageSystem) RescanVmfs(*Context, *types.RescanVmfs) soap.HasFault
type HostSystem ¶
type HostSystem struct { mo.HostSystem types.QueryTpmAttestationReportResponse // contains filtered or unexported fields }
func CreateStandaloneHost ¶
func CreateStandaloneHost(ctx *Context, f *Folder, spec types.HostConnectSpec) (*HostSystem, types.BaseMethodFault)
CreateStandaloneHost uses esx.HostSystem as a template, applying the given spec and creating the ComputeResource parent and ResourcePool sibling.
func NewHostSystem ¶
func NewHostSystem(host mo.HostSystem) *HostSystem
func (*HostSystem) DestroyTask ¶ added in v0.17.0
func (h *HostSystem) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
func (*HostSystem) DisconnectHostTask ¶ added in v0.30.0
func (h *HostSystem) DisconnectHostTask(ctx *Context, spec *types.DisconnectHost_Task) soap.HasFault
func (*HostSystem) EnterMaintenanceModeTask ¶
func (h *HostSystem) EnterMaintenanceModeTask(ctx *Context, spec *types.EnterMaintenanceMode_Task) soap.HasFault
func (*HostSystem) ExitMaintenanceModeTask ¶
func (h *HostSystem) ExitMaintenanceModeTask(ctx *Context, spec *types.ExitMaintenanceMode_Task) soap.HasFault
func (*HostSystem) QueryTpmAttestationReport ¶ added in v0.38.0
func (s *HostSystem) QueryTpmAttestationReport(req *types.QueryTpmAttestationReport) soap.HasFault
func (*HostSystem) ReconnectHostTask ¶ added in v0.30.0
func (h *HostSystem) ReconnectHostTask(ctx *Context, spec *types.ReconnectHost_Task) soap.HasFault
type HostVirtualNicManager ¶ added in v0.38.0
type HostVirtualNicManager struct { mo.HostVirtualNicManager Host *mo.HostSystem }
func NewHostVirtualNicManager ¶ added in v0.38.0
func NewHostVirtualNicManager(host *mo.HostSystem) *HostVirtualNicManager
func (*HostVirtualNicManager) QueryNetConfig ¶ added in v0.38.0
func (m *HostVirtualNicManager) QueryNetConfig(req *types.QueryNetConfig) soap.HasFault
type HttpNfcLease ¶ added in v0.21.0
type HttpNfcLease struct { mo.HttpNfcLease // contains filtered or unexported fields }
func (*HttpNfcLease) HttpNfcLeaseAbort ¶ added in v0.21.0
func (l *HttpNfcLease) HttpNfcLeaseAbort(ctx *Context, req *types.HttpNfcLeaseAbort) soap.HasFault
func (*HttpNfcLease) HttpNfcLeaseComplete ¶ added in v0.21.0
func (l *HttpNfcLease) HttpNfcLeaseComplete(ctx *Context, req *types.HttpNfcLeaseComplete) soap.HasFault
func (*HttpNfcLease) HttpNfcLeaseGetManifest ¶ added in v0.31.0
func (l *HttpNfcLease) HttpNfcLeaseGetManifest(ctx *Context, req *types.HttpNfcLeaseGetManifest) soap.HasFault
func (*HttpNfcLease) HttpNfcLeaseProgress ¶ added in v0.21.0
func (l *HttpNfcLease) HttpNfcLeaseProgress(ctx *Context, req *types.HttpNfcLeaseProgress) soap.HasFault
type IpPool ¶
type IpPool struct {
// contains filtered or unexported fields
}
func MustNewIpPool ¶
func (*IpPool) ReleaseIpv4 ¶
func (*IpPool) ReleaseIpv6 ¶
type IpPoolManager ¶
type IpPoolManager struct { mo.IpPoolManager // contains filtered or unexported fields }
IpPoolManager implements a simple IP Pool manager in which all pools are shared across different datacenters.
func (*IpPoolManager) AllocateIpv4Address ¶
func (m *IpPoolManager) AllocateIpv4Address(req *types.AllocateIpv4Address) soap.HasFault
func (*IpPoolManager) AllocateIpv6Address ¶
func (m *IpPoolManager) AllocateIpv6Address(req *types.AllocateIpv6Address) soap.HasFault
func (*IpPoolManager) CreateIpPool ¶
func (m *IpPoolManager) CreateIpPool(req *types.CreateIpPool) soap.HasFault
func (*IpPoolManager) DestroyIpPool ¶
func (m *IpPoolManager) DestroyIpPool(req *types.DestroyIpPool) soap.HasFault
func (*IpPoolManager) QueryIPAllocations ¶
func (m *IpPoolManager) QueryIPAllocations(req *types.QueryIPAllocations) soap.HasFault
func (*IpPoolManager) QueryIpPools ¶
func (m *IpPoolManager) QueryIpPools(req *types.QueryIpPools) soap.HasFault
func (*IpPoolManager) ReleaseIpAllocation ¶
func (m *IpPoolManager) ReleaseIpAllocation(req *types.ReleaseIpAllocation) soap.HasFault
func (*IpPoolManager) UpdateIpPool ¶
func (m *IpPoolManager) UpdateIpPool(req *types.UpdateIpPool) soap.HasFault
type LicenseAssignmentManager ¶
type LicenseAssignmentManager struct {
mo.LicenseAssignmentManager
}
func (*LicenseAssignmentManager) QueryAssignedLicenses ¶
func (m *LicenseAssignmentManager) QueryAssignedLicenses(req *types.QueryAssignedLicenses) soap.HasFault
type LicenseManager ¶
type LicenseManager struct {
mo.LicenseManager
}
func (*LicenseManager) AddLicense ¶
func (m *LicenseManager) AddLicense(req *types.AddLicense) soap.HasFault
func (*LicenseManager) RemoveLicense ¶
func (m *LicenseManager) RemoveLicense(req *types.RemoveLicense) soap.HasFault
func (*LicenseManager) UpdateLicenseLabel ¶ added in v0.20.0
func (m *LicenseManager) UpdateLicenseLabel(req *types.UpdateLicenseLabel) soap.HasFault
type ListView ¶ added in v0.19.0
func (*ListView) DestroyView ¶ added in v0.19.0
func (*ListView) ModifyListView ¶ added in v0.19.0
func (*ListView) ResetListView ¶ added in v0.19.0
type Method ¶
type Method struct { Name string This types.ManagedObjectReference Header soap.Header Body types.AnyType }
Method encapsulates a decoded SOAP client request
type Model ¶
type Model struct { Service *Service `json:"-"` ServiceContent types.ServiceContent `json:"-"` RootFolder mo.Folder `json:"-"` // Autostart will power on Model created VMs when true Autostart bool `json:"-"` // Datacenter specifies the number of Datacenter entities to create // Name prefix: DC, vcsim flag: -dc Datacenter int `json:"datacenter"` // Portgroup specifies the number of DistributedVirtualPortgroup entities to create per Datacenter // Name prefix: DVPG, vcsim flag: -pg Portgroup int `json:"portgroup"` // PortgroupNSX specifies the number NSX backed DistributedVirtualPortgroup entities to create per Datacenter // Name prefix: NSXPG, vcsim flag: -nsx-pg PortgroupNSX int `json:"portgroupNSX"` // OpaqueNetwork specifies the number of OpaqueNetwork entities to create per Datacenter, // with Summary.OpaqueNetworkType set to nsx.LogicalSwitch and Summary.OpaqueNetworkId to a random uuid. // Name prefix: NSX, vcsim flag: -nsx OpaqueNetwork int `json:"opaqueNetwork"` // Host specifies the number of standalone HostSystems entities to create per Datacenter // Name prefix: H, vcsim flag: -standalone-host Host int `json:"host,omitempty"` // Cluster specifies the number of ClusterComputeResource entities to create per Datacenter // Name prefix: C, vcsim flag: -cluster Cluster int `json:"cluster"` // ClusterHost specifies the number of HostSystems entities to create within a Cluster // Name prefix: H, vcsim flag: -host ClusterHost int `json:"clusterHost,omitempty"` // Pool specifies the number of ResourcePool entities to create per Cluster // Note that every cluster has a root ResourcePool named "Resources", as real vCenter does. // For example: /DC0/host/DC0_C0/Resources // The root ResourcePool is named "RP0" within other object names. // When Model.Pool is set to 1 or higher, this creates child ResourcePools under the root pool. // Note that this flag is not effective on standalone hosts. // For example: /DC0/host/DC0_C0/Resources/DC0_C0_RP1 // Name prefix: RP, vcsim flag: -pool Pool int `json:"pool"` // Datastore specifies the number of Datastore entities to create // Each Datastore will have temporary local file storage and will be mounted // on every HostSystem created by the ModelConfig // Name prefix: LocalDS, vcsim flag: -ds Datastore int `json:"datastore"` // Machine specifies the number of VirtualMachine entities to create per // ResourcePool. If the pool flag is specified, the specified number of virtual // machines will be deployed to each child pool and prefixed with the child // resource pool name. Otherwise they are deployed into the root resource pool, // prefixed with RP0. On standalone hosts, machines are always deployed into the // root resource pool without any prefix. // Name prefix: VM, vcsim flag: -vm Machine int `json:"machine"` // Folder specifies the number of Datacenter to place within a Folder. // This includes a folder for the Datacenter itself and its host, vm, network and datastore folders. // All resources for the Datacenter are placed within these folders, rather than the top-level folders. // Name prefix: F, vcsim flag: -folder Folder int `json:"folder"` // App specifies the number of VirtualApp to create per Cluster // Name prefix: APP, vcsim flag: -app App int `json:"app"` // Pod specifies the number of StoragePod to create per Cluster // Name prefix: POD, vcsim flag: -pod Pod int `json:"pod"` // Delay configurations DelayConfig DelayConfig `json:"-"` // contains filtered or unexported fields }
Model is used to populate a Model with an initial set of managed entities. This is a simple helper for tests running against a simulator, to populate an inventory with commonly used models. The inventory names generated by a Model have a string prefix per-type and integer suffix per-instance. The names are concatenated with their ancestor names and delimited by '_', making the generated names unique.
Example ¶
Example for starting a simulator with empty inventory, similar to a fresh install of vCenter.
package main import ( "context" "fmt" "log" "github.com/vmware/govmomi" "github.com/vmware/govmomi/simulator" ) func main() { ctx := context.Background() model := simulator.VPX() model.Datacenter = 0 // No DC == no inventory defer model.Remove() err := model.Create() if err != nil { log.Fatal(err) } s := model.Service.NewServer() defer s.Close() c, _ := govmomi.NewClient(ctx, s.URL, true) fmt.Printf("%s with %d hosts", c.Client.ServiceContent.About.ApiType, model.Count().Host) }
Output: VirtualCenter with 0 hosts
func ESX ¶
func ESX() *Model
ESX is the default Model for a standalone ESX instance
Example ¶
Example boilerplate for starting a simulator initialized with an ESX model.
package main import ( "context" "fmt" "log" "github.com/vmware/govmomi" "github.com/vmware/govmomi/simulator" ) func main() { ctx := context.Background() // ESXi model + initial set of objects (VMs, network, datastore) model := simulator.ESX() defer model.Remove() err := model.Create() if err != nil { log.Fatal(err) } s := model.Service.NewServer() defer s.Close() c, _ := govmomi.NewClient(ctx, s.URL, true) fmt.Printf("%s with %d host", c.Client.ServiceContent.About.ApiType, model.Count().Host) }
Output: HostAgent with 1 host
func VPX ¶
func VPX() *Model
VPX is the default Model for a vCenter instance
Example ¶
Example boilerplate for starting a simulator initialized with a vCenter model.
package main import ( "context" "fmt" "log" "github.com/vmware/govmomi" "github.com/vmware/govmomi/simulator" ) func main() { ctx := context.Background() // vCenter model + initial set of objects (cluster, hosts, VMs, network, datastore, etc) model := simulator.VPX() defer model.Remove() err := model.Create() if err != nil { log.Fatal(err) } s := model.Service.NewServer() defer s.Close() c, _ := govmomi.NewClient(ctx, s.URL, true) fmt.Printf("%s with %d hosts", c.Client.ServiceContent.About.ApiType, model.Count().Host) }
Output: VirtualCenter with 4 hosts
func (*Model) CreateInfrastructure ¶ added in v0.31.0
func (*Model) Load ¶ added in v0.22.0
Load Model from the given directory, as created by the 'govc object.save' command.
func (*Model) Remove ¶
func (m *Model) Remove()
Remove cleans up items created by the Model, such as local datastore directories
func (*Model) Run ¶ added in v0.21.0
Run calls f with a Client connected to a simulator server instance, which is stopped after f returns.
Example ¶
Run simplifies startup/cleanup of a simulator instance for example or testing purposes.
package main import ( "context" "fmt" "log" "github.com/vmware/govmomi/session" "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/vim25" ) func main() { err := simulator.VPX().Run(func(ctx context.Context, c *vim25.Client) error { // Client has connected and logged in to a new simulator instance. // Server.Close and Model.Remove are called when this func returns. s, err := session.NewManager(c).UserSession(ctx) if err != nil { return err } fmt.Print(s.UserName) return nil }) if err != nil { log.Fatal(err) } }
Output: user
type OptionManager ¶
type OptionManager struct { mo.OptionManager // contains filtered or unexported fields }
OptionManager is used in at least two locations for ESX: 1. ServiceContent.setting - this is empty on ESX and //TODO on VC 2. ConfigManager.advancedOption - this is where the bulk of the ESX settings are found
func (*OptionManager) QueryOptions ¶
func (m *OptionManager) QueryOptions(req *types.QueryOptions) soap.HasFault
func (*OptionManager) UpdateOptions ¶ added in v0.17.0
func (m *OptionManager) UpdateOptions(req *types.UpdateOptions) soap.HasFault
type OvfManager ¶ added in v0.21.0
type OvfManager struct {
mo.OvfManager
}
func (*OvfManager) CreateImportSpec ¶ added in v0.21.0
func (m *OvfManager) CreateImportSpec(ctx *Context, req *types.CreateImportSpec) soap.HasFault
type PerformanceManager ¶
type PerformanceManager struct { mo.PerformanceManager // contains filtered or unexported fields }
func (*PerformanceManager) QueryAvailablePerfMetric ¶ added in v0.19.0
func (p *PerformanceManager) QueryAvailablePerfMetric(ctx *Context, req *types.QueryAvailablePerfMetric) soap.HasFault
func (*PerformanceManager) QueryPerfCounter ¶ added in v0.19.0
func (p *PerformanceManager) QueryPerfCounter(ctx *Context, req *types.QueryPerfCounter) soap.HasFault
func (*PerformanceManager) QueryPerfProviderSummary ¶ added in v0.19.0
func (p *PerformanceManager) QueryPerfProviderSummary(ctx *Context, req *types.QueryPerfProviderSummary) soap.HasFault
type PropertyCollector ¶
type PropertyCollector struct { mo.PropertyCollector // contains filtered or unexported fields }
func (*PropertyCollector) CancelWaitForUpdates ¶
func (pc *PropertyCollector) CancelWaitForUpdates(r *types.CancelWaitForUpdates) soap.HasFault
func (*PropertyCollector) ContinueRetrievePropertiesEx ¶ added in v0.37.0
func (pc *PropertyCollector) ContinueRetrievePropertiesEx(ctx *Context, r *types.ContinueRetrievePropertiesEx) soap.HasFault
func (*PropertyCollector) CreateFilter ¶
func (pc *PropertyCollector) CreateFilter(ctx *Context, c *types.CreateFilter) soap.HasFault
func (*PropertyCollector) CreatePropertyCollector ¶
func (pc *PropertyCollector) CreatePropertyCollector(ctx *Context, c *types.CreatePropertyCollector) soap.HasFault
func (*PropertyCollector) DestroyPropertyCollector ¶
func (pc *PropertyCollector) DestroyPropertyCollector(ctx *Context, c *types.DestroyPropertyCollector) soap.HasFault
func (*PropertyCollector) Fetch ¶ added in v0.21.0
Fetch is not documented in the vSphere SDK, but ovftool depends on it. A Fetch request is converted to a RetrievePropertiesEx method call by vcsim.
func (*PropertyCollector) PutObject ¶ added in v0.19.0
func (pc *PropertyCollector) PutObject(o mo.Reference)
func (*PropertyCollector) RemoveObject ¶ added in v0.19.0
func (pc *PropertyCollector) RemoveObject(_ *Context, ref types.ManagedObjectReference)
func (*PropertyCollector) RetrieveProperties ¶
func (pc *PropertyCollector) RetrieveProperties(ctx *Context, r *types.RetrieveProperties) soap.HasFault
RetrieveProperties is deprecated, but govmomi is still using it at the moment.
func (*PropertyCollector) RetrievePropertiesEx ¶
func (pc *PropertyCollector) RetrievePropertiesEx(ctx *Context, r *types.RetrievePropertiesEx) soap.HasFault
func (*PropertyCollector) UpdateObject ¶ added in v0.19.0
func (pc *PropertyCollector) UpdateObject(_ *Context, o mo.Reference, changes []types.PropertyChange)
func (*PropertyCollector) WaitForUpdates ¶
func (pc *PropertyCollector) WaitForUpdates(ctx *Context, r *types.WaitForUpdates) soap.HasFault
WaitForUpdates is deprecated, but pyvmomi is still using it at the moment.
func (*PropertyCollector) WaitForUpdatesEx ¶
func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpdatesEx) soap.HasFault
type PropertyFilter ¶
type PropertyFilter struct { mo.PropertyFilter // contains filtered or unexported fields }
func (*PropertyFilter) DestroyPropertyFilter ¶
func (f *PropertyFilter) DestroyPropertyFilter(ctx *Context, c *types.DestroyPropertyFilter) soap.HasFault
func (*PropertyFilter) PutObject ¶ added in v0.44.0
func (_ *PropertyFilter) PutObject(_ mo.Reference)
func (*PropertyFilter) RemoveObject ¶ added in v0.44.0
func (_ *PropertyFilter) RemoveObject(_ *Context, _ types.ManagedObjectReference)
func (*PropertyFilter) UpdateObject ¶ added in v0.44.0
func (f *PropertyFilter) UpdateObject(ctx *Context, o mo.Reference, changes []types.PropertyChange)
type RegisterObject ¶
type RegisterObject interface { mo.Reference PutObject(mo.Reference) UpdateObject(*Context, mo.Reference, []types.PropertyChange) RemoveObject(*Context, types.ManagedObjectReference) }
RegisterObject interface supports callbacks when objects are created, updated and deleted from the Registry
type Registry ¶
type Registry struct { Namespace string Path string Handler func(*Context, *Method) (mo.Reference, types.BaseMethodFault) // contains filtered or unexported fields }
Registry manages a map of mo.Reference objects
func (*Registry) AcquireLock ¶ added in v0.25.0
AcquireLock acquires the lock for onBehalfOf then returns. The lock MUST be released by calling the returned function. WithLock should be preferred wherever possible.
func (*Registry) AddHandler ¶
func (r *Registry) AddHandler(h RegisterObject)
AddHandler adds a RegisterObject handler to the Registry.
func (*Registry) AddReference ¶ added in v0.17.0
func (r *Registry) AddReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference)
AddReference appends ref to field if not already in the given field.
func (*Registry) AlarmManager ¶ added in v0.40.0
func (r *Registry) AlarmManager() *AlarmManager
AlarmManager returns the AlarmManager singleton
func (*Registry) All ¶ added in v0.20.0
All returns all entities of type specified by kind. If kind is empty - all entities will be returned.
func (*Registry) AllReference ¶ added in v0.26.0
AllReference returns all mo.Reference objects of type specified by kind. If kind is empty - all objects will be returned.
func (*Registry) AppendReference ¶ added in v0.17.0
func (r *Registry) AppendReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref ...types.ManagedObjectReference)
AppendReference appends the given refs to field.
func (*Registry) AtomicUpdate ¶ added in v0.25.0
func (*Registry) CryptoManager ¶ added in v0.44.0
func (r *Registry) CryptoManager() *CryptoManagerKmip
CryptoManager returns the CryptoManagerKmip singleton
func (*Registry) CustomFieldsManager ¶ added in v0.20.0
func (r *Registry) CustomFieldsManager() *CustomFieldsManager
CustomFieldsManager returns CustomFieldsManager singleton
func (*Registry) EventManager ¶ added in v0.17.0
func (r *Registry) EventManager() *EventManager
EventManager returns the EventManager singleton
func (*Registry) ExtensionManager ¶ added in v0.37.0
func (r *Registry) ExtensionManager() *ExtensionManager
ExtensionManager returns the ExtensionManager singleton
func (*Registry) FileManager ¶
func (r *Registry) FileManager() *FileManager
FileManager returns the FileManager singleton
func (*Registry) FindByName ¶
FindByName returns the first mo.Entity of the given refs whose Name field is equal to the given name. If there is no match, nil is returned. This method is useful for cases where objects are required to have a unique name, such as Datastore with a HostStorageSystem or HostSystem within a ClusterComputeResource.
func (*Registry) Get ¶
func (r *Registry) Get(ref types.ManagedObjectReference) mo.Reference
Get returns the object for the given reference.
func (*Registry) MarshalJSON ¶ added in v0.17.0
func (*Registry) NewEntity ¶
NewEntity sets Entity().Self with a new, unique Value. Useful for creating object instances from templates.
func (*Registry) OptionManager ¶ added in v0.18.0
func (r *Registry) OptionManager() *OptionManager
OptionManager returns the OptionManager singleton
func (*Registry) Put ¶
Put adds a new object to Registry, generating a ManagedObjectReference if not already set.
func (*Registry) PutEntity ¶
PutEntity sets item.Parent to that of parent.Self before adding item to the Registry.
func (*Registry) Remove ¶
func (r *Registry) Remove(ctx *Context, item types.ManagedObjectReference)
Remove removes an object from the Registry.
func (*Registry) RemoveHandler ¶ added in v0.24.0
func (r *Registry) RemoveHandler(h RegisterObject)
RemoveHandler removes a RegisterObject handler from the Registry.
func (*Registry) RemoveReference ¶ added in v0.17.0
func (r *Registry) RemoveReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference)
RemoveReference removes ref from the given field.
func (*Registry) SearchIndex ¶
func (r *Registry) SearchIndex() *SearchIndex
SearchIndex returns the SearchIndex singleton
func (*Registry) SessionManager ¶ added in v0.17.0
func (r *Registry) SessionManager() *SessionManager
SessionManager returns the SessionManager singleton
func (*Registry) TenantManager ¶ added in v0.28.0
func (r *Registry) TenantManager() *TenantManager
TenantManager returns TenantManager singleton
func (*Registry) Update ¶ added in v0.19.0
Update dispatches object property changes to RegisterObject handlers, such as any PropertyCollector instances with in-progress WaitForUpdates calls. The changes are also applied to the given object via mo.ApplyPropertyChange, so there is no need to set object fields directly.
func (*Registry) UserDirectory ¶ added in v0.17.0
func (r *Registry) UserDirectory() *UserDirectory
UserDirectory returns the UserDirectory singleton
func (*Registry) ViewManager ¶
func (r *Registry) ViewManager() *ViewManager
ViewManager returns the ViewManager singleton
func (*Registry) VirtualDiskManager ¶
func (r *Registry) VirtualDiskManager() VirtualDiskManagerInterface
VirtualDiskManager returns the VirtualDiskManager singleton
func (*Registry) VmCompatibilityChecker ¶ added in v0.39.0
func (r *Registry) VmCompatibilityChecker() *VmCompatibilityChecker
VmCompatibilityChecker returns VmCompatibilityChecker singleton
func (*Registry) VmProvisioningChecker ¶ added in v0.39.0
func (r *Registry) VmProvisioningChecker() *VmProvisioningChecker
VmProvisioningChecker returns VmProvisioningChecker singleton
type ResourcePool ¶
type ResourcePool struct {
mo.ResourcePool
}
func NewResourcePool ¶
func NewResourcePool() *ResourcePool
func (*ResourcePool) CreateResourcePool ¶
func (p *ResourcePool) CreateResourcePool(c *types.CreateResourcePool) soap.HasFault
func (*ResourcePool) CreateVApp ¶
func (p *ResourcePool) CreateVApp(req *types.CreateVApp) soap.HasFault
func (*ResourcePool) DestroyChildren ¶ added in v0.24.1
func (p *ResourcePool) DestroyChildren(ctx *Context, req *types.DestroyChildren) soap.HasFault
func (*ResourcePool) DestroyTask ¶
func (p *ResourcePool) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
func (*ResourcePool) ImportVApp ¶ added in v0.21.0
func (p *ResourcePool) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault
func (*ResourcePool) UpdateConfig ¶
func (p *ResourcePool) UpdateConfig(c *types.UpdateConfig) soap.HasFault
type SearchIndex ¶
type SearchIndex struct {
mo.SearchIndex
}
func (*SearchIndex) FindAllByDnsName ¶ added in v0.20.0
func (s *SearchIndex) FindAllByDnsName(req *types.FindAllByDnsName) soap.HasFault
func (*SearchIndex) FindAllByIp ¶ added in v0.20.0
func (s *SearchIndex) FindAllByIp(req *types.FindAllByIp) soap.HasFault
func (*SearchIndex) FindByDatastorePath ¶
func (s *SearchIndex) FindByDatastorePath(r *types.FindByDatastorePath) soap.HasFault
func (*SearchIndex) FindByDnsName ¶ added in v0.20.0
func (s *SearchIndex) FindByDnsName(req *types.FindByDnsName) soap.HasFault
func (*SearchIndex) FindByInventoryPath ¶
func (s *SearchIndex) FindByInventoryPath(req *types.FindByInventoryPath) soap.HasFault
func (*SearchIndex) FindByIp ¶ added in v0.20.0
func (s *SearchIndex) FindByIp(req *types.FindByIp) soap.HasFault
func (*SearchIndex) FindByUuid ¶
func (s *SearchIndex) FindByUuid(req *types.FindByUuid) soap.HasFault
type Server ¶
type Server struct { *internal.Server URL *url.URL Tunnel int // contains filtered or unexported fields }
Server provides a simulator Service over HTTP
func (*Server) Certificate ¶
func (s *Server) Certificate() *x509.Certificate
Certificate returns the TLS certificate for the Server if started with TLS enabled. This method will panic if TLS is not enabled for the server.
func (*Server) CertificateFile ¶
CertificateFile returns a file name, where the file contains the PEM encoded Server.Certificate. The temporary file is removed when Server.Close() is called.
func (*Server) CertificateInfo ¶
func (s *Server) CertificateInfo() *object.HostCertificateInfo
CertificateInfo returns Server.Certificate() as object.HostCertificateInfo
func (*Server) Close ¶
func (s *Server) Close()
Close shuts down the server and blocks until all outstanding requests on this server have completed.
func (*Server) StartTunnel ¶ added in v0.18.0
StartTunnel runs an HTTP proxy for tunneling SDK requests that require TLS client certificate authentication.
type Service ¶
type Service struct { Listen *url.URL TLS *tls.Config ServeMux *http.ServeMux // RegisterEndpoints will initialize any endpoints added via RegisterEndpoint RegisterEndpoints bool // contains filtered or unexported fields }
Service decodes incoming requests and dispatches to a Handler
func New ¶
func New(instance *ServiceInstance) *Service
New returns an initialized simulator Service instance
func (*Service) About ¶
func (s *Service) About(w http.ResponseWriter, r *http.Request)
About generates some info about the simulator.
func (*Service) Handle ¶ added in v0.20.0
Handle registers the handler for the given pattern with Service.ServeMux.
func (*Service) HandleFunc ¶ added in v0.22.0
HandleFunc dispatches to http.ServeMux.HandleFunc after all endpoints have been registered. This allows dispatching to an endpoint's HandleFunc impl, such as vapi/simulator for example.
func (*Service) RegisterSDK ¶ added in v0.18.0
RegisterSDK adds an HTTP handler for the Registry's Path and Namespace. If r.Path is already registered, r's objects are added to the existing Registry. An optional set of aliases can be provided to register the same handler for multiple paths.
func (*Service) RoundTrip ¶
RoundTrip implements the soap.RoundTripper interface in process. Rather than encode/decode SOAP over HTTP, this implementation uses reflection.
func (*Service) ServeDatastore ¶
func (s *Service) ServeDatastore(w http.ResponseWriter, r *http.Request)
ServeDatastore handler for Datastore access via /folder path.
func (*Service) ServeSDK ¶
func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request)
ServeSDK implements the http.Handler interface
func (*Service) ServiceVersions ¶
func (s *Service) ServiceVersions(w http.ResponseWriter, r *http.Request)
ServiceVersions handler for the /sdk/vimServiceVersions.xml path.
func (*Service) ServiceVersionsVsan ¶ added in v0.37.0
func (s *Service) ServiceVersionsVsan(w http.ResponseWriter, r *http.Request)
ServiceVersionsVsan handler for the /sdk/vsanServiceVersions.xml path.
type ServiceInstance ¶
type ServiceInstance struct {
mo.ServiceInstance
}
func NewServiceInstance ¶
func NewServiceInstance(ctx *Context, content types.ServiceContent, folder mo.Folder) *ServiceInstance
func (*ServiceInstance) CurrentTime ¶
func (*ServiceInstance) CurrentTime(*types.CurrentTime) soap.HasFault
func (*ServiceInstance) RetrieveInternalContent ¶ added in v0.21.0
func (s *ServiceInstance) RetrieveInternalContent(*internal.RetrieveInternalContent) soap.HasFault
func (*ServiceInstance) RetrieveServiceContent ¶
func (s *ServiceInstance) RetrieveServiceContent(*types.RetrieveServiceContent) soap.HasFault
type Session ¶ added in v0.17.0
type Session struct { types.UserSession *Registry }
Session combines a UserSession and a Registry for per-session managed objects.
type SessionManager ¶
type SessionManager struct { mo.SessionManager ServiceHostName string TLSCert func() string ValidLogin func(*types.Login) bool // contains filtered or unexported fields }
func (*SessionManager) AcquireCloneTicket ¶ added in v0.17.0
func (s *SessionManager) AcquireCloneTicket(ctx *Context, _ *types.AcquireCloneTicket) soap.HasFault
func (*SessionManager) AcquireGenericServiceTicket ¶
func (s *SessionManager) AcquireGenericServiceTicket(ticket *types.AcquireGenericServiceTicket) soap.HasFault
func (*SessionManager) Authenticate ¶ added in v0.30.5
func (*SessionManager) CloneSession ¶ added in v0.17.0
func (s *SessionManager) CloneSession(ctx *Context, ticket *types.CloneSession) soap.HasFault
func (*SessionManager) ImpersonateUser ¶ added in v0.40.0
func (s *SessionManager) ImpersonateUser(ctx *Context, req *types.ImpersonateUser) soap.HasFault
func (*SessionManager) LoginByToken ¶ added in v0.18.0
func (s *SessionManager) LoginByToken(ctx *Context, req *types.LoginByToken) soap.HasFault
func (*SessionManager) LoginExtensionByCertificate ¶ added in v0.18.0
func (s *SessionManager) LoginExtensionByCertificate(ctx *Context, req *types.LoginExtensionByCertificate) soap.HasFault
func (*SessionManager) SessionIsActive ¶ added in v0.20.0
func (s *SessionManager) SessionIsActive(ctx *Context, req *types.SessionIsActive) soap.HasFault
func (*SessionManager) TerminateSession ¶ added in v0.17.0
func (s *SessionManager) TerminateSession(ctx *Context, req *types.TerminateSession) soap.HasFault
type StoragePod ¶
type StoragePod struct {
mo.StoragePod
}
StoragePod aka "Datastore Cluster"
func (*StoragePod) MoveIntoFolderTask ¶
func (p *StoragePod) MoveIntoFolderTask(ctx *Context, c *types.MoveIntoFolder_Task) soap.HasFault
type StorageResourceManager ¶ added in v0.20.0
type StorageResourceManager struct {
mo.StorageResourceManager
}
func (*StorageResourceManager) ConfigureStorageDrsForPodTask ¶ added in v0.20.0
func (m *StorageResourceManager) ConfigureStorageDrsForPodTask(ctx *Context, req *types.ConfigureStorageDrsForPod_Task) soap.HasFault
func (*StorageResourceManager) RecommendDatastores ¶ added in v0.20.0
func (m *StorageResourceManager) RecommendDatastores(req *types.RecommendDatastores) soap.HasFault
type Task ¶
type Task struct { mo.Task Execute func(*Task) (types.AnyType, types.BaseMethodFault) // contains filtered or unexported fields }
func CreateTask ¶
func NewTask ¶
func NewTask(runner TaskRunner) *Task
func (*Task) CancelTask ¶ added in v0.37.0
func (*Task) RunBlocking ¶ added in v0.25.0
RunBlocking() should only be used when an async simulator task needs to wait on another async simulator task. It polls for task completion to avoid the need to set up a PropertyCollector.
func (*Task) SetTaskDescription ¶ added in v0.37.0
func (*Task) SetTaskState ¶ added in v0.37.0
func (*Task) UpdateProgress ¶ added in v0.37.0
type TaskHistoryCollector ¶ added in v0.37.0
type TaskHistoryCollector struct { mo.TaskHistoryCollector *HistoryCollector }
func (*TaskHistoryCollector) Get ¶ added in v0.37.0
func (c *TaskHistoryCollector) Get() mo.Reference
func (*TaskHistoryCollector) GetLatestPage ¶ added in v0.37.0
func (c *TaskHistoryCollector) GetLatestPage() []types.TaskInfo
func (*TaskHistoryCollector) ReadNextTasks ¶ added in v0.37.0
func (c *TaskHistoryCollector) ReadNextTasks(ctx *Context, req *types.ReadNextTasks) soap.HasFault
func (*TaskHistoryCollector) ReadPreviousTasks ¶ added in v0.37.0
func (c *TaskHistoryCollector) ReadPreviousTasks(ctx *Context, req *types.ReadPreviousTasks) soap.HasFault
type TaskManager ¶
type TaskManager struct { mo.TaskManager sync.Mutex // contains filtered or unexported fields }
func (*TaskManager) CreateCollectorForTasks ¶ added in v0.37.0
func (m *TaskManager) CreateCollectorForTasks(ctx *Context, req *types.CreateCollectorForTasks) soap.HasFault
func (*TaskManager) CreateTask ¶ added in v0.37.0
func (m *TaskManager) CreateTask(ctx *Context, req *types.CreateTask) soap.HasFault
func (*TaskManager) PutObject ¶
func (m *TaskManager) PutObject(obj mo.Reference)
func (*TaskManager) RemoveObject ¶
func (*TaskManager) RemoveObject(*Context, types.ManagedObjectReference)
func (*TaskManager) UpdateObject ¶ added in v0.19.0
func (m *TaskManager) UpdateObject(ctx *Context, obj mo.Reference, pc []types.PropertyChange)
type TaskRunner ¶
type TenantManager ¶ added in v0.28.0
type TenantManager struct { mo.TenantTenantManager // contains filtered or unexported fields }
func (*TenantManager) MarkServiceProviderEntities ¶ added in v0.28.0
func (t *TenantManager) MarkServiceProviderEntities(req *types.MarkServiceProviderEntities) soap.HasFault
func (*TenantManager) RetrieveServiceProviderEntities ¶ added in v0.28.0
func (t *TenantManager) RetrieveServiceProviderEntities(req *types.RetrieveServiceProviderEntities) soap.HasFault
func (*TenantManager) UnmarkServiceProviderEntities ¶ added in v0.28.0
func (t *TenantManager) UnmarkServiceProviderEntities(req *types.UnmarkServiceProviderEntities) soap.HasFault
type UserDirectory ¶
type UserDirectory struct { mo.UserDirectory // contains filtered or unexported fields }
func (*UserDirectory) RetrieveUserGroups ¶
func (u *UserDirectory) RetrieveUserGroups(req *types.RetrieveUserGroups) soap.HasFault
type VStorageObject ¶ added in v0.20.0
type VStorageObject struct { types.VStorageObject types.VStorageObjectSnapshotInfo }
type VcenterVStorageObjectManager ¶ added in v0.20.0
type VcenterVStorageObjectManager struct { mo.VcenterVStorageObjectManager // contains filtered or unexported fields }
func (*VcenterVStorageObjectManager) AttachTagToVStorageObject ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) AttachTagToVStorageObject(ctx *Context, req *types.AttachTagToVStorageObject) soap.HasFault
func (*VcenterVStorageObjectManager) CreateDiskTask ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) CreateDiskTask(ctx *Context, req *types.CreateDisk_Task) soap.HasFault
func (*VcenterVStorageObjectManager) DeleteSnapshotTask ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(ctx *Context, req *types.DeleteSnapshot_Task) soap.HasFault
func (*VcenterVStorageObjectManager) DeleteVStorageObjectTask ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(ctx *Context, req *types.DeleteVStorageObject_Task) soap.HasFault
func (*VcenterVStorageObjectManager) DetachTagFromVStorageObject ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) DetachTagFromVStorageObject(ctx *Context, req *types.DetachTagFromVStorageObject) soap.HasFault
func (*VcenterVStorageObjectManager) ExtendDiskTask ¶ added in v0.26.1
func (m *VcenterVStorageObjectManager) ExtendDiskTask(ctx *Context, req *types.ExtendDisk_Task) soap.HasFault
func (*VcenterVStorageObjectManager) ListTagsAttachedToVStorageObject ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) ListTagsAttachedToVStorageObject(ctx *Context, req *types.ListTagsAttachedToVStorageObject) soap.HasFault
func (*VcenterVStorageObjectManager) ListVStorageObject ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) ListVStorageObject(req *types.ListVStorageObject) soap.HasFault
func (*VcenterVStorageObjectManager) ListVStorageObjectsAttachedToTag ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) ListVStorageObjectsAttachedToTag(ctx *Context, req *types.ListVStorageObjectsAttachedToTag) soap.HasFault
func (*VcenterVStorageObjectManager) ReconcileDatastoreInventoryTask ¶ added in v0.21.0
func (m *VcenterVStorageObjectManager) ReconcileDatastoreInventoryTask(ctx *Context, req *types.ReconcileDatastoreInventory_Task) soap.HasFault
func (*VcenterVStorageObjectManager) RegisterDisk ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) RegisterDisk(ctx *Context, req *types.RegisterDisk) soap.HasFault
func (*VcenterVStorageObjectManager) RetrieveSnapshotInfo ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) RetrieveSnapshotInfo(req *types.RetrieveSnapshotInfo) soap.HasFault
func (*VcenterVStorageObjectManager) RetrieveVStorageObject ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) RetrieveVStorageObject(ctx *Context, req *types.RetrieveVStorageObject) soap.HasFault
func (*VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask ¶ added in v0.20.0
func (m *VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask(ctx *Context, req *types.VStorageObjectCreateSnapshot_Task) soap.HasFault
type ViewManager ¶
type ViewManager struct { mo.ViewManager // contains filtered or unexported fields }
func (*ViewManager) CreateContainerView ¶
func (m *ViewManager) CreateContainerView(ctx *Context, req *types.CreateContainerView) soap.HasFault
func (*ViewManager) CreateListView ¶ added in v0.19.0
func (m *ViewManager) CreateListView(ctx *Context, req *types.CreateListView) soap.HasFault
type VirtualApp ¶
type VirtualApp struct {
mo.VirtualApp
}
func (*VirtualApp) CloneVAppTask ¶ added in v0.24.0
func (a *VirtualApp) CloneVAppTask(ctx *Context, req *types.CloneVApp_Task) soap.HasFault
func (*VirtualApp) CreateChildVMTask ¶
func (a *VirtualApp) CreateChildVMTask(ctx *Context, req *types.CreateChildVM_Task) soap.HasFault
func (*VirtualApp) CreateVApp ¶ added in v0.24.0
func (a *VirtualApp) CreateVApp(req *types.CreateVApp) soap.HasFault
func (*VirtualApp) DestroyTask ¶
func (a *VirtualApp) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
func (*VirtualApp) ImportVApp ¶ added in v0.23.0
func (a *VirtualApp) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault
type VirtualDiskManager ¶
type VirtualDiskManager struct {
mo.VirtualDiskManager
}
func (*VirtualDiskManager) CopyVirtualDiskTask ¶
func (m *VirtualDiskManager) CopyVirtualDiskTask(ctx *Context, req *types.CopyVirtualDisk_Task) soap.HasFault
func (*VirtualDiskManager) CreateVirtualDiskTask ¶
func (m *VirtualDiskManager) CreateVirtualDiskTask(ctx *Context, req *types.CreateVirtualDisk_Task) soap.HasFault
func (*VirtualDiskManager) DeleteVirtualDiskTask ¶
func (m *VirtualDiskManager) DeleteVirtualDiskTask(ctx *Context, req *types.DeleteVirtualDisk_Task) soap.HasFault
func (*VirtualDiskManager) ExtendVirtualDiskTask ¶ added in v0.39.0
func (m *VirtualDiskManager) ExtendVirtualDiskTask(ctx *Context, req *types.ExtendVirtualDisk_Task) soap.HasFault
func (*VirtualDiskManager) MO ¶ added in v0.23.0
func (m *VirtualDiskManager) MO() mo.VirtualDiskManager
func (*VirtualDiskManager) MoveVirtualDiskTask ¶
func (m *VirtualDiskManager) MoveVirtualDiskTask(ctx *Context, req *types.MoveVirtualDisk_Task) soap.HasFault
func (*VirtualDiskManager) QueryVirtualDiskUuid ¶ added in v0.17.0
func (m *VirtualDiskManager) QueryVirtualDiskUuid(ctx *Context, req *types.QueryVirtualDiskUuid) soap.HasFault
func (*VirtualDiskManager) SetVirtualDiskUuid ¶ added in v0.18.0
func (m *VirtualDiskManager) SetVirtualDiskUuid(_ *Context, req *types.SetVirtualDiskUuid) soap.HasFault
type VirtualDiskManagerInterface ¶ added in v0.23.0
type VirtualDiskManagerInterface interface { mo.Reference MO() mo.VirtualDiskManager CreateVirtualDiskTask(*Context, *types.CreateVirtualDisk_Task) soap.HasFault DeleteVirtualDiskTask(*Context, *types.DeleteVirtualDisk_Task) soap.HasFault MoveVirtualDiskTask(*Context, *types.MoveVirtualDisk_Task) soap.HasFault CopyVirtualDiskTask(*Context, *types.CopyVirtualDisk_Task) soap.HasFault QueryVirtualDiskUuid(*Context, *types.QueryVirtualDiskUuid) soap.HasFault SetVirtualDiskUuid(*Context, *types.SetVirtualDiskUuid) soap.HasFault }
type VirtualMachine ¶
type VirtualMachine struct { mo.VirtualMachine DataSets map[string]*DataSet // contains filtered or unexported fields }
func NewVirtualMachine ¶
func NewVirtualMachine(ctx *Context, parent types.ManagedObjectReference, spec *types.VirtualMachineConfigSpec) (*VirtualMachine, types.BaseMethodFault)
func (*VirtualMachine) AttachDiskTask ¶ added in v0.43.0
func (vm *VirtualMachine) AttachDiskTask(ctx *Context, req *types.AttachDisk_Task) soap.HasFault
func (*VirtualMachine) CloneVMTask ¶
func (vm *VirtualMachine) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soap.HasFault
func (*VirtualMachine) CreateSnapshotTask ¶
func (vm *VirtualMachine) CreateSnapshotTask(ctx *Context, req *types.CreateSnapshot_Task) soap.HasFault
func (*VirtualMachine) CustomizeVMTask ¶ added in v0.22.0
func (vm *VirtualMachine) CustomizeVMTask(ctx *Context, req *types.CustomizeVM_Task) soap.HasFault
func (*VirtualMachine) DestroyTask ¶
func (vm *VirtualMachine) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault
func (*VirtualMachine) DetachDiskTask ¶ added in v0.43.0
func (vm *VirtualMachine) DetachDiskTask(ctx *Context, req *types.DetachDisk_Task) soap.HasFault
func (*VirtualMachine) MarkAsTemplate ¶ added in v0.17.0
func (vm *VirtualMachine) MarkAsTemplate(req *types.MarkAsTemplate) soap.HasFault
func (*VirtualMachine) MarkAsVirtualMachine ¶ added in v0.23.0
func (vm *VirtualMachine) MarkAsVirtualMachine(req *types.MarkAsVirtualMachine) soap.HasFault
func (*VirtualMachine) PowerOffVMTask ¶
func (vm *VirtualMachine) PowerOffVMTask(ctx *Context, c *types.PowerOffVM_Task) soap.HasFault
func (*VirtualMachine) PowerOnVMTask ¶
func (vm *VirtualMachine) PowerOnVMTask(ctx *Context, c *types.PowerOnVM_Task) soap.HasFault
func (*VirtualMachine) RebootGuest ¶ added in v0.24.1
func (vm *VirtualMachine) RebootGuest(ctx *Context, req *types.RebootGuest) soap.HasFault
func (*VirtualMachine) ReconfigVMTask ¶
func (vm *VirtualMachine) ReconfigVMTask(ctx *Context, req *types.ReconfigVM_Task) soap.HasFault
func (*VirtualMachine) RefreshStorageInfo ¶ added in v0.20.0
func (vm *VirtualMachine) RefreshStorageInfo(ctx *Context, req *types.RefreshStorageInfo) soap.HasFault
func (*VirtualMachine) Reload ¶ added in v0.24.1
func (*VirtualMachine) Reload(*types.Reload) soap.HasFault
func (*VirtualMachine) RelocateVMTask ¶
func (vm *VirtualMachine) RelocateVMTask(ctx *Context, req *types.RelocateVM_Task) soap.HasFault
func (*VirtualMachine) RemoveAllSnapshotsTask ¶
func (vm *VirtualMachine) RemoveAllSnapshotsTask(ctx *Context, req *types.RemoveAllSnapshots_Task) soap.HasFault
func (*VirtualMachine) RenameTask ¶ added in v0.22.0
func (o *VirtualMachine) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault
func (*VirtualMachine) ResetVMTask ¶ added in v0.19.0
func (vm *VirtualMachine) ResetVMTask(ctx *Context, req *types.ResetVM_Task) soap.HasFault
func (*VirtualMachine) RevertToCurrentSnapshotTask ¶
func (vm *VirtualMachine) RevertToCurrentSnapshotTask(ctx *Context, req *types.RevertToCurrentSnapshot_Task) soap.HasFault
func (*VirtualMachine) SetCustomValue ¶ added in v0.20.0
func (vm *VirtualMachine) SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault
func (*VirtualMachine) ShutdownGuest ¶
func (vm *VirtualMachine) ShutdownGuest(ctx *Context, c *types.ShutdownGuest) soap.HasFault
func (*VirtualMachine) StandbyGuest ¶ added in v0.31.0
func (vm *VirtualMachine) StandbyGuest(ctx *Context, c *types.StandbyGuest) soap.HasFault
func (*VirtualMachine) SuspendVMTask ¶ added in v0.19.0
func (vm *VirtualMachine) SuspendVMTask(ctx *Context, req *types.SuspendVM_Task) soap.HasFault
func (*VirtualMachine) UnregisterVM ¶
func (vm *VirtualMachine) UnregisterVM(ctx *Context, c *types.UnregisterVM) soap.HasFault
func (*VirtualMachine) UpgradeVMTask ¶ added in v0.20.0
func (vm *VirtualMachine) UpgradeVMTask(ctx *Context, req *types.UpgradeVM_Task) soap.HasFault
type VirtualMachineSnapshot ¶
type VirtualMachineSnapshot struct { mo.VirtualMachineSnapshot DataSets map[string]*DataSet }
func (*VirtualMachineSnapshot) RemoveSnapshotTask ¶
func (v *VirtualMachineSnapshot) RemoveSnapshotTask(ctx *Context, req *types.RemoveSnapshot_Task) soap.HasFault
func (*VirtualMachineSnapshot) RevertToSnapshotTask ¶
func (v *VirtualMachineSnapshot) RevertToSnapshotTask(ctx *Context, req *types.RevertToSnapshot_Task) soap.HasFault
type VmCompatibilityChecker ¶ added in v0.39.0
type VmCompatibilityChecker struct {
mo.VirtualMachineCompatibilityChecker
}
func (*VmCompatibilityChecker) CheckCompatibilityTask ¶ added in v0.39.0
func (c *VmCompatibilityChecker) CheckCompatibilityTask( ctx *Context, r *types.CheckCompatibility_Task) soap.HasFault
func (*VmCompatibilityChecker) CheckVmConfigTask ¶ added in v0.39.0
func (c *VmCompatibilityChecker) CheckVmConfigTask( ctx *Context, r *types.CheckVmConfig_Task) soap.HasFault
type VmProvisioningChecker ¶ added in v0.39.0
type VmProvisioningChecker struct {
mo.VirtualMachineProvisioningChecker
}
func (*VmProvisioningChecker) CheckRelocateTask ¶ added in v0.39.0
func (c *VmProvisioningChecker) CheckRelocateTask( ctx *Context, r *types.CheckRelocate_Task) soap.HasFault
Source Files ¶
- alarm_manager.go
- authorization_manager.go
- cluster_compute_resource.go
- container.go
- container_host_system.go
- container_virtual_machine.go
- crypto_manager_kmip.go
- custom_fields_manager.go
- customization_spec_manager.go
- datacenter.go
- dataset.go
- datastore.go
- datastore_namespace_manager.go
- doc.go
- dvs.go
- dvs_manager.go
- entity.go
- environment_browser.go
- event_manager.go
- extension_manager.go
- file_manager.go
- folder.go
- guest_id.go
- guest_operations_manager.go
- history_collector.go
- host_certificate_manager.go
- host_datastore_browser.go
- host_datastore_system.go
- host_firewall_system.go
- host_local_account_manager.go
- host_network_system.go
- host_storage_system.go
- host_system.go
- host_vnic_manager.go
- http_nfc_lease.go
- ip_pool_manager.go
- license_manager.go
- model.go
- object.go
- option_manager.go
- ovf_manager.go
- performance_manager.go
- portgroup.go
- property_collector.go
- property_filter.go
- registry.go
- resource_pool.go
- search_index.go
- service_instance.go
- session_manager.go
- simulator.go
- snapshot.go
- storage_resource_manager.go
- task.go
- task_manager.go
- tenant_manager.go
- user_directory.go
- view_manager.go
- virtual_disk_manager.go
- virtual_machine.go
- vm_compatibility_checker.go
- vm_provisioning_checker.go
- vstorage_object_manager.go
Directories ¶
Path | Synopsis |
---|---|
Package esx contains SOAP responses from an ESX server, captured using `govc ...
|
Package esx contains SOAP responses from an ESX server, captured using `govc ... |
Package vpx contains SOAP responses from a vCenter server, captured using `govc ...
|
Package vpx contains SOAP responses from a vCenter server, captured using `govc ... |