func (cmd *set) 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) }
func (cmd *remove) 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) }
func (cmd *create) 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.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) f.IntVar(&cmd.memory, "m", 1024, "Size in MB of memory") f.IntVar(&cmd.cpus, "c", 1, "Number of CPUs") f.StringVar(&cmd.guestID, "g", "otherGuest", "Guest OS") f.BoolVar(&cmd.link, "link", true, "Link specified disk") f.BoolVar(&cmd.on, "on", true, "Power on VM. Default is true if -disk argument is given.") f.BoolVar(&cmd.force, "force", false, "Create VM if vmx already exists") f.StringVar(&cmd.controller, "disk.controller", "scsi", "Disk controller type") f.StringVar(&cmd.iso, "iso", "", "ISO path") cmd.isoDatastoreFlag, ctx = flags.NewCustomDatastoreFlag(ctx) f.StringVar(&cmd.isoDatastoreFlag.Name, "iso-datastore", "", "Datastore for ISO file") f.StringVar(&cmd.disk, "disk", "", "Disk path") cmd.diskDatastoreFlag, ctx = flags.NewCustomDatastoreFlag(ctx) f.StringVar(&cmd.diskDatastoreFlag.Name, "disk-datastore", "", "Datastore for disk file") }
func newAutostartFlag(ctx context.Context) (*AutostartFlag, context.Context) { f := &AutostartFlag{} f.ClientFlag, ctx = flags.NewClientFlag(ctx) f.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) f.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) return f, ctx }
func (cmd *unregister) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) cmd.SearchFlag.Register(ctx, f) }
func (cmd *setcert) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) f.StringVar(&cmd.cert, "cert-pem", "-", "PEM encoded certificate") f.StringVar(&cmd.org, "org", "VMware", "Organization for generated certificate") }
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 }
func (cmd *rename) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) cmd.FolderFlag.Register(ctx, f) }
func (cmd *markasvm) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) cmd.SearchFlag.Register(ctx, f) cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) }
func (cmd *about) 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) f.BoolVar(&cmd.Long, "l", false, "Include service content") }
func (cmd *assigned) 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) f.StringVar(&cmd.id, "id", "", "Entity ID") }
func (cmd *env) Register(ctx context.Context, f *flag.FlagSet) { cmd.OutputFlag, ctx = flags.NewOutputFlag(ctx) cmd.OutputFlag.Register(ctx, f) cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) f.BoolVar(&cmd.extra, "x", false, "Output variables for each GOVC_URL component") }
func (cmd *list) 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) f.StringVar(&cmd.feature, "feature", "", featureUsage) }
func (cmd *cert) 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) f.BoolVar(&cmd.show, "show", false, "Show PEM encoded server certificate only") f.BoolVar(&cmd.thumbprint, "thumbprint", false, "Output host hash and thumbprint only") }
func (cmd *info) 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.DatacenterFlag, ctx = flags.NewDatacenterFlag(ctx) cmd.DatacenterFlag.Register(ctx, f) }
func (cmd *add) 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.HostConnectFlag, ctx = flags.NewHostConnectFlag(ctx) cmd.HostConnectFlag.Register(ctx, f) f.StringVar(&cmd.parent, "parent", "", "Path to folder to add the host to") f.BoolVar(&cmd.connect, "connect", true, "Immediately connect to host") }
func (cmd *assign) 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.StringVar(&cmd.name, "name", "", "Display name") f.BoolVar(&cmd.remove, "remove", false, "Remove assignment") }
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 *power) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) cmd.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) cmd.SearchFlag.Register(ctx, f) f.BoolVar(&cmd.On, "on", false, "Power on") f.BoolVar(&cmd.Off, "off", false, "Power off") f.BoolVar(&cmd.Reset, "reset", false, "Power reset") f.BoolVar(&cmd.Suspend, "suspend", false, "Power suspend") f.BoolVar(&cmd.Reboot, "r", false, "Reboot guest") f.BoolVar(&cmd.Shutdown, "s", false, "Shutdown guest") f.BoolVar(&cmd.Force, "force", false, "Force (ignore state error and hard shutdown/reboot if tools unavailable)") }
func (cmd *info) 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.SearchFlag, ctx = flags.NewSearchFlag(ctx, flags.SearchVirtualMachines) cmd.SearchFlag.Register(ctx, f) f.BoolVar(&cmd.WaitForIP, "waitip", false, "Wait for VM to acquire IP address") f.BoolVar(&cmd.General, "g", true, "Show general summary") f.BoolVar(&cmd.ExtraConfig, "e", false, "Show ExtraConfig") f.BoolVar(&cmd.Resources, "r", false, "Show resource summary") }
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 *register) 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.ResourcePoolFlag, ctx = flags.NewResourcePoolFlag(ctx) cmd.ResourcePoolFlag.Register(ctx, f) cmd.HostSystemFlag, ctx = flags.NewHostSystemFlag(ctx) cmd.HostSystemFlag.Register(ctx, f) cmd.FolderFlag, ctx = flags.NewFolderFlag(ctx) cmd.FolderFlag.Register(ctx, f) f.StringVar(&cmd.name, "name", "", "Name of the VM") f.BoolVar(&cmd.template, "as-template", false, "Mark VM as template") }
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") }
func (cmd *register) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) f.BoolVar(&cmd.update, "update", false, "Update extension") }
func (cmd *destroy) Register(ctx context.Context, f *flag.FlagSet) { cmd.ClientFlag, ctx = flags.NewClientFlag(ctx) cmd.ClientFlag.Register(ctx, f) }