mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-11-03 12:52:41 +08:00
23 lines
460 B
Go
23 lines
460 B
Go
package shell
|
|
|
|
import (
|
|
"yunion.io/x/onecloud/pkg/util/shellutils"
|
|
"yunion.io/x/onecloud/pkg/util/zstack"
|
|
)
|
|
|
|
func init() {
|
|
type HostListOptions struct {
|
|
ZoneId string
|
|
HostId string
|
|
}
|
|
shellutils.R(&HostListOptions{}, "host-list", "List hosts", func(cli *zstack.SRegion, args *HostListOptions) error {
|
|
hosts, err := cli.GetHosts(args.ZoneId, args.HostId)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
printList(hosts, 0, 0, 0, []string{})
|
|
return nil
|
|
})
|
|
|
|
}
|