add network

This commit is contained in:
TangBin
2018-10-13 10:30:39 +08:00
parent e74ef21266
commit 7e580a3071
2 changed files with 18 additions and 12 deletions
-2
View File
@@ -1,2 +0,0 @@
package aws
+18 -10
View File
@@ -3,6 +3,7 @@ package aws
import (
"yunion.io/x/onecloud/pkg/cloudprovider"
"yunion.io/x/jsonutils"
"fmt"
)
type SWire struct {
@@ -13,43 +14,50 @@ type SWire struct {
}
func (self *SWire) GetId() string {
panic("implement me")
return fmt.Sprintf("%s-%s", self.vpc.GetId(), self.zone.GetId())
}
func (self *SWire) GetName() string {
panic("implement me")
return self.GetId()
}
func (self *SWire) GetGlobalId() string {
panic("implement me")
return fmt.Sprintf("%s-%s", self.vpc.GetGlobalId(), self.zone.GetGlobalId())
}
func (self *SWire) GetStatus() string {
panic("implement me")
return "available"
}
func (self *SWire) Refresh() error {
panic("implement me")
return nil
}
func (self *SWire) IsEmulated() bool {
panic("implement me")
return true
}
func (self *SWire) GetMetadata() *jsonutils.JSONDict {
panic("implement me")
return nil
}
func (self *SWire) GetIVpc() cloudprovider.ICloudVpc {
panic("implement me")
return self.vpc
}
func (self *SWire) GetIZone() cloudprovider.ICloudZone {
panic("implement me")
return self.zone
}
func (self *SWire) GetINetworks() ([]cloudprovider.ICloudNetwork, error) {
panic("implement me")
if self.inetworks == nil {
// todo: vpc.fetchVSwitches()
// err := self.vpc.fetchVSwitches()
// if err != nil {
return nil, nil
// }
}
return self.inetworks, nil
}
func (self *SWire) GetBandwidth() int {