rebase 2.6.0

This commit is contained in:
屈轩
2019-02-16 17:44:40 +08:00
parent f2c16bbc48
commit b388874335
6 changed files with 9 additions and 19 deletions
+5 -7
View File
@@ -10,13 +10,11 @@ import (
func init() {
type SnapshotsListOptions struct {
options.BaseListOptions
Disk string `help:"Disk snapshots" json:"disk_id"`
FakeDeleted bool `help:"Show fake deleted snapshot or not"`
Local *bool `help:"Show local snapshots"`
Share *bool `help:"Show shared snapshots"`
DiskType string `help:"Filter by disk type" choices:"sys|data"`
PublicCloud *bool `help:"Show public cloud snapshots"`
PrivateCloud *bool `help:"Show private cloud snapshots"`
Disk string `help:"Disk snapshots" json:"disk_id"`
FakeDeleted bool `help:"Show fake deleted snapshot or not"`
Local *bool `help:"Show local snapshots"`
Share *bool `help:"Show shared snapshots"`
DiskType string `help:"Filter by disk type" choices:"sys|data"`
}
R(&SnapshotsListOptions{}, "snapshot-list", "Show snapshots", func(s *mcclient.ClientSession, args *SnapshotsListOptions) error {
params, err := options.ListStructToParams(args)
-8
View File
@@ -118,14 +118,6 @@ func (manager *SSnapshotManager) ListItemFilter(ctx context.Context, q *sqlchemy
sqlchemy.In(q.Field("storage_id"), sq)))
}
// if jsonutils.QueryBoolean(query, "public_cloud", false) {
// publicRegionIds := CloudregionManager.GetPublicRegionIds()
// q = q.Filter(sqlchemy.In(q.Field("cloudregion_id"), publicRegionIds))
// } else if jsonutils.QueryBoolean(query, "private_cloud", false) {
// privateRegionIds := CloudregionManager.GetPrivateRegionIds()
// q = q.Filter(sqlchemy.In(q.Field("cloudregion_id"), privateRegionIds))
// }
if diskType, err := query.GetString("disk_type"); err == nil {
diskTbl := DiskManager.Query().SubQuery()
sq := diskTbl.Query(diskTbl.Field("id")).Equals("disk_type", diskType).SubQuery()
+1 -1
View File
@@ -4,9 +4,9 @@ import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/cloudcommon/version"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/compute/models"
"yunion.io/x/onecloud/pkg/util/version"
)
const (
+1 -1
View File
@@ -413,7 +413,7 @@ func (region *SRegion) ChangeConfig(instance *SInstance, flavorId string) error
},
}
_, maxVersion, _ := region.GetVersion("compute")
_, _, err := region.Post("compute", fmt.Sprintf("/servers/%s/action", instanceId), maxVersion, jsonutils.Marshal(params))
_, _, err := region.Post("compute", fmt.Sprintf("/servers/%s/action", instance.ID), maxVersion, jsonutils.Marshal(params))
return err
}
+1 -1
View File
@@ -4,8 +4,8 @@ import (
"fmt"
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/cloudcommon/version"
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/onecloud/pkg/util/version"
"yunion.io/x/pkg/utils"
)
+1 -1
View File
@@ -2,7 +2,7 @@ package openstack
import (
"yunion.io/x/jsonutils"
"yunion.io/x/onecloud/pkg/cloudcommon/version"
"yunion.io/x/onecloud/pkg/util/version"
)
type SQuota struct {