add more instance filed

This commit is contained in:
TangBin
2018-10-24 18:02:48 +08:00
parent f30f561477
commit 70a00a0e4c
+12 -2
View File
@@ -415,6 +415,16 @@ func (self *SRegion) GetInstances(zoneId string, ids []string, offset int, limit
} }
} }
var networkInterfaces SNetworkInterfaces
for _, n := range instance.NetworkInterfaces {
i := SNetworkInterface{
MacAddress: StrVal(n.MacAddress),
NetworkInterfaceId: StrVal(n.NetworkInterfaceId),
PrimaryIpAddress: StrVal(n.PrivateIpAddress),
}
networkInterfaces.NetworkInterface = append(networkInterfaces.NetworkInterface, i)
}
sinstance := SInstance{ sinstance := SInstance{
RegionId: self.RegionId, RegionId: self.RegionId,
ZoneId: *instance.Placement.AvailabilityZone, ZoneId: *instance.Placement.AvailabilityZone,
@@ -434,13 +444,13 @@ func (self *SRegion) GetInstances(zoneId string, ids []string, offset int, limit
Status: *instance.State.Name, Status: *instance.State.Name,
Disks: disks, Disks: disks,
SecurityGroupIds: secgroups, SecurityGroupIds: secgroups,
NetworkInterfaces: networkInterfaces,
// EipAddress: // EipAddress:
// VlanId: // VlanId:
// VpcAttributes: // VpcAttributes:
// NetworkInterfaces:
// OSName: // OSName:
// OSType: // OSType:
// Description: Description: tagspec.GetDescTag(),
} }
if instance.PrivateIpAddress != nil { if instance.PrivateIpAddress != nil {