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{
RegionId: self.RegionId,
ZoneId: *instance.Placement.AvailabilityZone,
@@ -434,13 +444,13 @@ func (self *SRegion) GetInstances(zoneId string, ids []string, offset int, limit
Status: *instance.State.Name,
Disks: disks,
SecurityGroupIds: secgroups,
NetworkInterfaces: networkInterfaces,
// EipAddress:
// VlanId:
// VpcAttributes:
// NetworkInterfaces:
// OSName:
// OSType:
// Description:
Description: tagspec.GetDescTag(),
}
if instance.PrivateIpAddress != nil {