mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
35 lines
921 B
Go
35 lines
921 B
Go
package shell
|
|
|
|
import (
|
|
"github.com/yunionio/mcclient"
|
|
"github.com/yunionio/mcclient/modules"
|
|
)
|
|
|
|
func init() {
|
|
type StoragecacheListOptions struct {
|
|
BaseListOptions
|
|
}
|
|
R(&StoragecacheListOptions{}, "storage-cache-list", "List storage caches", func(s *mcclient.ClientSession, args *StoragecacheListOptions) error {
|
|
params := FetchPagingParams(args.BaseListOptions)
|
|
result, err := modules.Storagecaches.List(s, params)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
printList(result, modules.Storagecaches.GetColumns(s))
|
|
return nil
|
|
})
|
|
|
|
type StoragecacheShowptions struct {
|
|
ID string `help:"ID or Name of storagecache"`
|
|
}
|
|
R(&StoragecacheShowptions{}, "storage-cache-show", "Show details of storage caches", func(s *mcclient.ClientSession, args *StoragecacheShowptions) error {
|
|
result, err := modules.Storagecaches.Get(s, args.ID, nil)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
printObject(result)
|
|
return nil
|
|
})
|
|
|
|
}
|