func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) cmd.spec.NumPorts = 128 // default f.Var(flags.NewInt32(&cmd.spec.NumPorts), "ports", "Number of ports") f.Var(flags.NewInt32(&cmd.spec.Mtu), "mtu", "MTU") f.StringVar(&cmd.nic, "nic", "", "Bridge nic device") }
func (cmd *configure) Register(ctx context.Context, f *flag.FlagSet) { cmd.AutostartFlag, ctx = newAutostartFlag(ctx) cmd.AutostartFlag.Register(ctx, f) f.Var(flags.NewOptionalBool(&cmd.Enabled), "enabled", "") f.Var(flags.NewInt32(&cmd.StartDelay), "start-delay", "") f.StringVar(&cmd.StopAction, "stop-action", "", "") f.Var(flags.NewInt32(&cmd.StopDelay), "stop-delay", "") f.Var(flags.NewOptionalBool(&cmd.WaitForHeartbeat), "wait-for-heartbeat", "") }
func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) f.StringVar(&cmd.spec.VswitchName, "vswitch", "", "vSwitch Name") f.Var(flags.NewInt32(&cmd.spec.VlanId), "vlan", "VLAN ID") }
func (cmd *enter) Register(ctx context.Context, f *flag.FlagSet) { cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) f.Var(flags.NewInt32(&cmd.timeout), "timeout", "Timeout") f.BoolVar(&cmd.evacuate, "evacuate", false, "Evacuate powered off VMs") }
func (cmd *logs) Register(ctx context.Context, f *flag.FlagSet) { cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) cmd.Max = 25 // default f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N logs") f.StringVar(&cmd.Key, "log", "", "Log file key") }
func (cmd *events) Register(ctx context.Context, f *flag.FlagSet) { cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) cmd.DatacenterFlag.Register(ctx, f) cmd.Max = 25 // default f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N events") f.BoolVar(&cmd.Tail, "f", false, "Tail event stream") f.BoolVar(&cmd.Force, "force", false, "Force event collection: use with CAUTION ") }
func (cmd *events) Register(ctx context.Context, f *flag.FlagSet) { cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) cmd.DatacenterFlag.Register(ctx, f) cmd.Max = 25 // default f.Var(flags.NewInt32(&cmd.Max), "n", "Output the last N events") f.BoolVar(&cmd.Tail, "f", false, "Follow event stream") f.BoolVar(&cmd.Force, "force", false, "Disable number objects to monitor limit") }
func (spec *DVPortgroupConfigSpec) Register(ctx context.Context, f *flag.FlagSet) { ptypes := []string{ string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), string(types.DistributedVirtualPortgroupPortgroupTypeLateBinding), string(types.DistributedVirtualPortgroupPortgroupTypeEphemeral), } f.StringVar(&spec.Type, "type", ptypes[0], fmt.Sprintf("Portgroup type (%s)", strings.Join(ptypes, "|"))) f.Var(flags.NewInt32(&spec.NumPorts), "nports", "Number of ports") config := new(types.VMwareDVSPortSetting) vlan := new(types.VmwareDistributedVirtualSwitchVlanIdSpec) spec.DefaultPortConfig = config config.Vlan = vlan f.Var(flags.NewInt32(&vlan.VlanId), "vlan", "VLAN ID") }
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") }
func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) cmd.VlanId = -1 f.Var(flags.NewInt32(&cmd.VlanId), "vlan-id", "VLAN ID") f.StringVar(&cmd.Name, "name", "", "Portgroup name") f.StringVar(&cmd.VswitchName, "vswitch-name", "", "vSwitch name") f.Var(flags.NewOptionalBool(&cmd.AllowPromiscuous), "allow-promiscuous", "Allow promiscuous mode") f.Var(flags.NewOptionalBool(&cmd.ForgedTransmits), "forged-transmits", "Allow forged transmits") f.Var(flags.NewOptionalBool(&cmd.MacChanges), "mac-changes", "Allow MAC changes") }
func (cmd *find) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) cmd.OutputFlag.Register(ctx, f) cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) f.BoolVar(&cmd.check, "c", true, "Check if esx firewall is enabled") f.BoolVar(&cmd.enabled, "enabled", true, "Find enabled rule sets if true, disabled if false") f.StringVar((*string)(&cmd.Direction), "direction", string(types.HostFirewallRuleDirectionOutbound), "Direction") f.StringVar((*string)(&cmd.PortType), "type", string(types.HostFirewallRulePortTypeDst), "Port type") f.StringVar((*string)(&cmd.Protocol), "proto", string(types.HostFirewallRuleProtocolTcp), "Protocol") f.Var(flags.NewInt32(&cmd.Port), "port", "Port") }
func (cmd *add) Register(ctx context.Context, f *flag.FlagSet) { cmd.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) cmd.DatacenterFlag.Register(ctx, f) f.StringVar(&cmd.path, "dvs", "", "DVS path") ptypes := []string{ string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), string(types.DistributedVirtualPortgroupPortgroupTypeLateBinding), string(types.DistributedVirtualPortgroupPortgroupTypeEphemeral), } f.StringVar(&cmd.DVPortgroupConfigSpec.Type, "type", ptypes[0], fmt.Sprintf("Portgroup type (%s)", strings.Join(ptypes, "|"))) cmd.DVPortgroupConfigSpec.NumPorts = 128 // default f.Var(flags.NewInt32(&cmd.DVPortgroupConfigSpec.NumPorts), "nports", "Number of ports") }
func (flag *FileAttrFlag) Register(ctx context.Context, f *flag.FlagSet) { f.Var(flags.NewInt32(&flag.OwnerId), "uid", "User ID") f.Var(flags.NewInt32(&flag.GroupId), "gid", "Group ID") f.Int64Var(&flag.Permissions, "perm", 0, "File permissions") }
func (cmd *exit) Register(ctx context.Context, f *flag.FlagSet) { cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) f.Var(flags.NewInt32(&cmd.timeout), "timeout", "Timeout") }