本文整理汇总了Golang中github.com/vmware/govmomi/govc/flags.NewVirtualMachineFlag函数的典型用法代码示例。如果您正苦于以下问题:Golang NewVirtualMachineFlag函数的具体用法?Golang NewVirtualMachineFlag怎么用?Golang NewVirtualMachineFlag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NewVirtualMachineFlag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Register
func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.BoolVar(&cmd.recursive, "r", false, "Remove snapshot children")
f.BoolVar(&cmd.consolidate, "c", true, "Consolidate disks")
}
开发者ID:frapposelli,项目名称:govmomi,代码行数:7,代码来源:remove.go
示例2: Register
func (cmd *connect) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.StringVar(&cmd.device, "device", "", "serial port device name")
f.BoolVar(&cmd.client, "client", false, "Use client direction")
}
开发者ID:fdawg4l,项目名称:govmomi,代码行数:7,代码来源:connect.go
示例3: newGuestFlag
func newGuestFlag(ctx context.Context) (*GuestFlag, context.Context) {
f := &GuestFlag{}
f.ClientFlag, ctx = flags.NewClientFlag(ctx)
f.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
f.AuthFlag, ctx = newAuthFlag(ctx)
return f, ctx
}
开发者ID:robvanmieghem,项目名称:machine,代码行数:7,代码来源:guest.go
示例4: Register
func (cmd *info) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx)
cmd.OutputFlag.Register(ctx, f)
}
开发者ID:robvanmieghem,项目名称:machine,代码行数:7,代码来源:info.go
示例5: Register
func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.BoolVar(&cmd.memory, "m", true, "Include memory state")
f.BoolVar(&cmd.quiesce, "q", false, "Quiesce guest file system")
f.StringVar(&cmd.description, "d", "", "Snapshot description")
}
开发者ID:vmware,项目名称:vic,代码行数:8,代码来源:create.go
示例6: Register
func (cmd *insert) Register(ctx context.Context, f *flag.FlagSet) {
cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx)
cmd.DatastoreFlag.Register(ctx, f)
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.StringVar(&cmd.device, "device", "", "Floppy device name")
}
开发者ID:frapposelli,项目名称:govmomi,代码行数:8,代码来源:insert.go
示例7: Register
func (cmd *tree) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.BoolVar(&cmd.fullPath, "f", false, "Print the full path prefix for snapshot")
f.BoolVar(&cmd.current, "c", true, "Print the current snapshot")
f.BoolVar(&cmd.date, "D", false, "Print the snapshot creation date")
f.BoolVar(&cmd.id, "i", false, "Print the snapshot id")
}
开发者ID:vmware,项目名称:vic,代码行数:9,代码来源:tree.go
示例8: Register
func (cmd *attach) Register(ctx context.Context, f *flag.FlagSet) {
cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx)
cmd.DatastoreFlag.Register(ctx, f)
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.BoolVar(&cmd.persist, "persist", true, "Persist attached disk")
f.BoolVar(&cmd.link, "link", true, "Link specified disk")
f.StringVar(&cmd.controller, "controller", "", "Disk controller")
f.StringVar(&cmd.disk, "disk", "", "Disk path name")
}
开发者ID:vmware,项目名称:vic,代码行数:11,代码来源:attach.go
示例9: Register
func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
ctypes := []string{"usb", "xhci"}
f.StringVar(&cmd.controller, "type", ctypes[0],
fmt.Sprintf("USB controller type (%s)", strings.Join(ctypes, "|")))
f.BoolVar(&cmd.autoConnect, "auto", true, "Enable ability to hot plug devices")
f.BoolVar(&cmd.ehciEnabled, "ehci", true, "Enable enhanced host controller interface (USB 2.0)")
}
开发者ID:vmware,项目名称:vic,代码行数:11,代码来源:add.go
示例10: Register
func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.Int64Var(&cmd.MemoryMB, "m", 0, "Size in MB of memory")
f.Var(flags.NewInt32(&cmd.NumCPUs), "c", "Number of CPUs")
f.StringVar(&cmd.GuestId, "g", "", "Guest OS")
f.StringVar(&cmd.Name, "name", "", "Display name")
f.Var(&cmd.extraConfig, "e", "ExtraConfig. <key>=<value>")
f.Var(flags.NewOptionalBool(&cmd.NestedHVEnabled), "nested-hv-enabled", "Enable nested hardware-assisted virtualization")
}
开发者ID:hmahmood,项目名称:govmomi,代码行数:12,代码来源:change.go
示例11: Register
func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
var ctypes []string
ct := object.SCSIControllerTypes()
for _, t := range ct {
ctypes = append(ctypes, ct.Type(t))
}
f.StringVar(&cmd.controller, "type", ct.Type(ct[0]),
fmt.Sprintf("SCSI controller type (%s)", strings.Join(ctypes, "|")))
f.StringVar(&cmd.sharedBus, "sharing", string(types.VirtualSCSISharingNoSharing), "SCSI sharing")
f.BoolVar(&cmd.hotAddRemove, "hot", false, "Enable hot-add/remove")
}
开发者ID:robvanmieghem,项目名称:machine,代码行数:14,代码来源:add.go
示例12: Register
func (cmd *boot) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.Int64Var(&cmd.BootDelay, "delay", 0, "Delay in ms before starting the boot sequence")
f.StringVar(&cmd.order, "order", "", "Boot device order")
f.Int64Var(&cmd.BootRetryDelay, "retry-delay", 0, "Delay in ms before a boot retry")
cmd.BootRetryEnabled = types.NewBool(false)
f.BoolVar(cmd.BootRetryEnabled, "retry", false, "If true, retry boot after retry-delay")
cmd.EnterBIOSSetup = types.NewBool(false)
f.BoolVar(cmd.EnterBIOSSetup, "setup", false, "If true, enter BIOS setup on next boot")
}
开发者ID:vmware,项目名称:vic,代码行数:14,代码来源:boot.go
示例13: Register
func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) {
cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx)
cmd.DatastoreFlag.Register(ctx, f)
cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx)
cmd.OutputFlag.Register(ctx, f)
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
err := (&cmd.Bytes).Set("10G")
if err != nil {
panic(err)
}
f.StringVar(&cmd.controller, "controller", "", "Disk controller")
f.StringVar(&cmd.Name, "name", "", "Name for new disk")
f.Var(&cmd.Bytes, "size", "Size of new disk")
}
开发者ID:robvanmieghem,项目名称:machine,代码行数:17,代码来源:create.go
示例14: Register
func (cmd *clone) Register(ctx context.Context, f *flag.FlagSet) {
cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
cmd.ClientFlag.Register(ctx, f)
cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx)
cmd.DatacenterFlag.Register(ctx, f)
cmd.DatastoreFlag, ctx = flags.NewDatastoreFlag(ctx)
cmd.DatastoreFlag.Register(ctx, f)
cmd.StoragePodFlag, ctx = flags.NewStoragePodFlag(ctx)
cmd.StoragePodFlag.Register(ctx, f)
cmd.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx)
cmd.ResourcePoolFlag.Register(ctx, f)
cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx)
cmd.HostSystemFlag.Register(ctx, f)
cmd.NetworkFlag, ctx = flags.NewNetworkFlag(ctx)
cmd.NetworkFlag.Register(ctx, f)
cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx)
cmd.FolderFlag.Register(ctx, f)
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.IntVar(&cmd.memory, "m", 0, "Size in MB of memory")
f.IntVar(&cmd.cpus, "c", 0, "Number of CPUs")
f.BoolVar(&cmd.on, "on", true, "Power on VM")
f.BoolVar(&cmd.force, "force", false, "Create VM if vmx already exists")
f.BoolVar(&cmd.template, "template", false, "Create a Template")
f.StringVar(&cmd.customization, "customization", "", "Customization Specification Name")
f.BoolVar(&cmd.waitForIP, "waitip", false, "Wait for VM to acquire IP address")
f.IntVar(&cmd.amount, "amount", 1, "Amount of clones needed")
}
开发者ID:frapposelli,项目名称:govmomi,代码行数:37,代码来源:clone.go
示例15: Register
func (cmd *eject) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.StringVar(&cmd.device, "device", "", "CD-ROM device name")
}
开发者ID:vmware,项目名称:vic,代码行数:6,代码来源:eject.go
示例16: Register
func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.StringVar(&cmd.device, "device", "", "serial port device name")
}
开发者ID:frapposelli,项目名称:govmomi,代码行数:6,代码来源:disconnect.go
示例17: Register
func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.IntVar(&cmd.number, "n", 1, "this is mass create number")
}
开发者ID:frapposelli,项目名称:govmomi,代码行数:6,代码来源:create.go
示例18: Register
func (cmd *remove) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.BoolVar(&cmd.keepFiles, "keep", false, "Keep files in datastore")
}
开发者ID:vmware,项目名称:vic,代码行数:5,代码来源:remove.go
示例19: Register
func (cmd *question) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
f.StringVar(&cmd.answer, "answer", "", "Answer to question")
}
开发者ID:robvanmieghem,项目名称:machine,代码行数:6,代码来源:question.go
示例20: Register
func (cmd *disconnect) Register(ctx context.Context, f *flag.FlagSet) {
cmd.VirtualMachineFlag, ctx = flags.NewVirtualMachineFlag(ctx)
cmd.VirtualMachineFlag.Register(ctx, f)
}
开发者ID:robvanmieghem,项目名称:machine,代码行数:4,代码来源:disconnect.go
注:本文中的github.com/vmware/govmomi/govc/flags.NewVirtualMachineFlag函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论