diff --git a/cli/cmd/vm_create.go b/cli/cmd/vm_create.go index afc4cd88c..3d378d69c 100644 --- a/cli/cmd/vm_create.go +++ b/cli/cmd/vm_create.go @@ -37,7 +37,7 @@ func (r *runners) InitVMCreate(parent *cobra.Command) *cobra.Command { cmd.Flags().StringVar(&r.args.createClusterTTL, "ttl", "", "VM TTL (duration, max 48h)") cmd.Flags().DurationVar(&r.args.createClusterWaitDuration, "wait", time.Second*0, "Wait duration for VM to be ready (leave empty to not wait)") cmd.Flags().StringVar(&r.args.createClusterInstanceType, "instance-type", "", "The type of instance to use (e.g. r1.medium)") - cmd.Flags().StringArrayVar(&r.args.createClusterNodeGroups, "nodegroup", []string{}, "Node group to create (name=?,instance-type=?,nodes=?,disk=? format, can be specified multiple times). For each nodegroup, one of the following flags must be specified: name, instance-type, nodes or disk.") + cmd.Flags().StringArrayVar(&r.args.createClusterNodeGroups, "group", []string{}, "Group to create (name=?,instance-type=?,nodes=?,disk=? format, can be specified multiple times). For each group, one of the following flags must be specified: name, instance-type, nodes or disk.") cmd.Flags().StringArrayVar(&r.args.createClusterTags, "tag", []string{}, "Tag to apply to the VM (key=value format, can be specified multiple times)") diff --git a/cli/cmd/vm_group_ls.go b/cli/cmd/vm_group_ls.go index 177485dad..6617d6f47 100644 --- a/cli/cmd/vm_group_ls.go +++ b/cli/cmd/vm_group_ls.go @@ -13,7 +13,7 @@ func (r *runners) InitVMGroupList(parent *cobra.Command) *cobra.Command { Short: "List groups for a vm", Long: `List groups for a vm`, Args: cobra.ExactArgs(1), - RunE: r.listVMNodeGroups, + RunE: r.listVMGroups, ValidArgsFunction: r.completeVMIDs, } parent.AddCommand(cmd) @@ -23,7 +23,7 @@ func (r *runners) InitVMGroupList(parent *cobra.Command) *cobra.Command { return cmd } -func (r *runners) listVMNodeGroups(cmd *cobra.Command, args []string) error { +func (r *runners) listVMGroups(cmd *cobra.Command, args []string) error { if len(args) < 1 { return errors.New("vm id is required") } diff --git a/pkg/kotsclient/vm_create.go b/pkg/kotsclient/vm_create.go index 31a161658..5ad4c9779 100644 --- a/pkg/kotsclient/vm_create.go +++ b/pkg/kotsclient/vm_create.go @@ -19,7 +19,7 @@ type CreateVMRequest struct { NodeCount int `json:"node_count"` DiskGiB int64 `json:"disk_gib"` TTL string `json:"ttl"` - NodeGroups []VMNodeGroup `json:"node_groups"` + NodeGroups []VMNodeGroup `json:"groups"` InstanceType string `json:"instance_type"` Tags []types.Tag `json:"tags"` } diff --git a/pkg/types/cluster.go b/pkg/types/cluster.go index 183c38846..ba94cf35e 100644 --- a/pkg/types/cluster.go +++ b/pkg/types/cluster.go @@ -58,6 +58,15 @@ type NodeGroup struct { TotalCredits int64 `json:"total_credits,omitempty"` // this is only present after the cluster is stopped MinutesBilled int64 `json:"minutes_billed"` + + Nodes []*Node `json:"nodes"` +} + +type Node struct { + Index int `json:"node_index"` + + SSHPort int64 `json:"ssh_port,omitempty"` + SSHEndpoint string `json:"ssh_endpoint,omitempty"` } type ClusterDistributionStatus struct {