mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat(climc): server-list --os-arch (#14465)
This commit is contained in:
@@ -174,15 +174,17 @@ func ListStructToParams(v interface{}) (*jsonutils.JSONDict, error) {
|
||||
return nil, err
|
||||
}
|
||||
{
|
||||
f := rv.FieldByName("BaseListOptions")
|
||||
if f.IsValid() {
|
||||
listOpts, ok := f.Addr().Interface().(*BaseListOptions)
|
||||
if ok {
|
||||
listParams, err := listOpts.Params()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
for _, oName := range []string{"BaseListOptions", "MultiArchListOptions"} {
|
||||
f := rv.FieldByName(oName)
|
||||
if f.IsValid() {
|
||||
listOpts, ok := f.Addr().Interface().(IParamsOptions)
|
||||
if ok {
|
||||
listParams, err := listOpts.Params()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
params.Update(listParams)
|
||||
}
|
||||
params.Update(listParams)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -422,6 +424,14 @@ func (o *ScopedResourceListOptions) Params() (*jsonutils.JSONDict, error) {
|
||||
return optionsStructToParams(o)
|
||||
}
|
||||
|
||||
type MultiArchListOptions struct {
|
||||
OsArch string `help:"Filter resource by arch" choices:"i386|x86|x86_32|x86_64|arm|aarch32|aarch64"`
|
||||
}
|
||||
|
||||
func (o *MultiArchListOptions) Params() (*jsonutils.JSONDict, error) {
|
||||
return optionsStructToParams(o)
|
||||
}
|
||||
|
||||
type BaseUpdateOptions struct {
|
||||
ID string `help:"ID or Name of resource to update"`
|
||||
Name string `help:"Name of resource to update"`
|
||||
|
||||
@@ -68,6 +68,7 @@ type ServerListOptions struct {
|
||||
ScalingGroup string `help:"ScalingGroup's id or name'"`
|
||||
|
||||
options.BaseListOptions
|
||||
options.MultiArchListOptions
|
||||
|
||||
VpcProvider string `help:"filter by vpc's provider" json:"vpc_provider"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user