mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
20 lines
415 B
Go
20 lines
415 B
Go
package shell
|
|
|
|
import (
|
|
"yunion.io/x/onecloud/pkg/util/esxi"
|
|
"yunion.io/x/onecloud/pkg/util/shellutils"
|
|
)
|
|
|
|
func init() {
|
|
type DatacenterListOptions struct {
|
|
}
|
|
shellutils.R(&DatacenterListOptions{}, "dc-list", "List all datacenters", func(cli *esxi.SESXiClient, args *DatacenterListOptions) error {
|
|
dcs, err := cli.GetDatacenters()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
printList(dcs, nil)
|
|
return nil
|
|
})
|
|
}
|