Skip to content

Commit

Permalink
govc: update optional parameter names and docs
Browse files Browse the repository at this point in the history
Signed-off-by: Stoyan Zhelyazkov <[email protected]>
  • Loading branch information
spacegospod committed Apr 8, 2024
1 parent 5614ecc commit 39aaae0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
10 changes: 5 additions & 5 deletions govc/namespace/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ func (cmd *change) Description() string {
Examples:
govc namespace.change -namespace=test-namespace
govc namespace.change -namespace=test-namespace -content-libraries=lib1
govc namespace.change -namespace=test-namespace -content-libraries=lib1,lib2
govc namespace.change -namespace=test-namespace -vm-classes=class1
govc namespace.change -namespace=test-namespace -vm-classes=class1,class2
govc namespace.change -namespace=test-namespace -content-libraries=lib1,lib2 -vm-classes=class1,class2`
govc namespace.change -namespace=test-namespace -content-libraries=dca9cc16-9460-4da0-802c-4aa148ac6cf7
govc namespace.change -namespace=test-namespace -content-libraries=dca9cc16-9460-4da0-802c-4aa148ac6cf7,617a3ee3-a2ff-4311-9a7c-0016ccf958bd
govc namespace.change -namespace=test-namespace -vm-classes=best-effort-2xlarge
govc namespace.change -namespace=test-namespace -vm-classes=best-effort-2xlarge,best-effort-4xlarge
govc namespace.change -namespace=test-namespace -content-libraries=dca9cc16-9460-4da0-802c-4aa148ac6cf7,617a3ee3-a2ff-4311-9a7c-0016ccf958bd -vm-classes=best-effort-2xlarge,best-effort-4xlarge`
}

func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error {
Expand Down
18 changes: 9 additions & 9 deletions govc/namespace/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) {
cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
cmd.ClientFlag.Register(ctx, f)

f.StringVar(&cmd.spec.Cluster, "cluster", "", "The identifier of the Supervisor.")
f.StringVar(&cmd.spec.Cluster, "supervisor", "", "The identifier of the Supervisor.")
f.StringVar(&cmd.spec.Namespace, "namespace", "", "The name of the vSphere Namespace.")
f.StringVar(&cmd.libraries, "content-libraries", "", "The list of content libraries to associate with the vSphere Namespace.")
f.StringVar(&cmd.vmClasses, "vm-classes", "", "The list of virtual machine classes to associate with the vSphere Namespace")
f.StringVar(&cmd.libraries, "content-libraries", "", "The identifiers of the content libraries to associate with the vSphere Namespace.")
f.StringVar(&cmd.vmClasses, "vm-classes", "", "The identifiers of the virtual machine classes to associate with the vSphere Namespace")
}

func (cmd *create) Process(ctx context.Context) error {
Expand All @@ -62,12 +62,12 @@ func (cmd *create) Description() string {
return `Creates a new namespace on a Supervisor.
Examples:
govc namespace.create -cluster=test-cluster -namespace=test-namespace
govc namespace.create -cluster=test-cluster -namespace=test-namespace -content-libraries=lib1
govc namespace.create -cluster=test-cluster -namespace=test-namespace -content-libraries=lib1,lib2
govc namespace.create -cluster=test-cluster -namespace=test-namespace -vm-classes=class1
govc namespace.create -cluster=test-cluster -namespace=test-namespace -vm-classes=class1,class2
govc namespace.create -cluster=test-cluster -namespace=test-namespace -content-libraries=lib1,lib2 -vm-classes=class1,class2`
govc namespace.create -supervisor=domain-c1 -namespace=test-namespace
govc namespace.create -supervisor=domain-c1 -namespace=test-namespace -content-libraries=dca9cc16-9460-4da0-802c-4aa148ac6cf7
govc namespace.create -supervisor=domain-c1 -namespace=test-namespace -content-libraries=dca9cc16-9460-4da0-802c-4aa148ac6cf7,dca9cc16-9460-4da0-802c-4aa148ac6cf7
govc namespace.create -supervisor=domain-c1 -namespace=test-namespace -vm-classes=best-effort-2xlarge
govc namespace.create -supervisor=domain-c1 -namespace=test-namespace -vm-classes=best-effort-2xlarge,best-effort-4xlarge
govc namespace.create -supervisor=domain-c1 -namespace=test-namespace -content-libraries=dca9cc16-9460-4da0-802c-4aa148ac6cf7,dca9cc16-9460-4da0-802c-4aa148ac6cf7 -vm-classes=best-effort-2xlarge,best-effort-4xlarge`
}

func (cmd *create) Run(ctx context.Context, f *flag.FlagSet) error {
Expand Down
10 changes: 8 additions & 2 deletions govc/namespace/vmclass/change.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ func (cmd *change) Register(ctx context.Context, f *flag.FlagSet) {
cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
cmd.ClientFlag.Register(ctx, f)

f.StringVar(&cmd.spec.Id, "id", "", "The identifier of the virtual machine class.")
f.StringVar(&cmd.spec.Id, "id", "", `
Identifier of the virtual machine class. This has DNS_LABEL restrictions
as specified in <a href="https://tools.ietf.org/html/rfc1123"></a>. This
must be an alphanumeric (a-z and 0-9) string and with maximum length
of 63 characters and with the '-' character allowed anywhere except
the first or last character. This name is unique in this vCenter server.
`)
f.Int64Var(&cmd.spec.CpuCount, "cpus", 0, "The number of CPUs.")
f.Int64Var(&cmd.spec.MemoryMb, "memory", 0, "The amount of memory (in MB).")
}
Expand All @@ -52,7 +58,7 @@ func (cmd *change) Description() string {
return `Modifies an existing virtual machine class.
Examples:
govc namespace.vmclass.change -id=test-class-01 -cpus=8 -memory=8192"`
govc namespace.vmclass.change -id=test-class-01 -cpus=8 -memory=8192`
}

func (cmd *change) Run(ctx context.Context, f *flag.FlagSet) error {
Expand Down

0 comments on commit 39aaae0

Please sign in to comment.