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:
Zexi Li
2019-11-15 18:41:30 +08:00
committed by GitHub
9 changed files with 235 additions and 2 deletions
+13 -1
View File
@@ -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
})
}
+9
View File
@@ -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
})
}