mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
rebase 2.6.0
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user