mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #3696 from swordqiu/hotfix/qj-aliyun-delete-network-failed
fix: network-delete may fail immidiately after deleting vm
This commit is contained in:
@@ -418,7 +418,7 @@ func init() {
|
||||
})
|
||||
|
||||
type NetworkAddressOptions struct {
|
||||
NETWORK string `help:"if of network to query"`
|
||||
NETWORK string `help:"id or name of network to query"`
|
||||
}
|
||||
R(&NetworkAddressOptions{}, "network-addresses", "Query used addresses of network", func(s *mcclient.ClientSession, args *NetworkAddressOptions) error {
|
||||
result, err := modules.Networks.GetSpecific(s, args.NETWORK, "addresses", nil)
|
||||
@@ -433,4 +433,16 @@ func init() {
|
||||
printList(&listResult, nil)
|
||||
return nil
|
||||
})
|
||||
|
||||
type NetworkSyncOptions struct {
|
||||
NETWORK string `help:"id or name of network to sync"`
|
||||
}
|
||||
R(&NetworkSyncOptions{}, "network-sync", "Sync network status", func(s *mcclient.ClientSession, args *NetworkSyncOptions) error {
|
||||
result, err := modules.Networks.PerformAction(s, args.NETWORK, "sync", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
@@ -158,4 +158,13 @@ func init() {
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
|
||||
R(&VpcUpdateStatusOptions{}, "vpc-sync", "Synchronize the status of a vpc", func(s *mcclient.ClientSession, args *VpcUpdateStatusOptions) error {
|
||||
result, err := modules.Vpcs.PerformAction(s, args.ID, "sync", nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
printObject(result)
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user