From 70a00a0e4c248bcba8839b941e3ff1663f51622e Mon Sep 17 00:00:00 2001 From: TangBin Date: Wed, 24 Oct 2018 18:02:48 +0800 Subject: [PATCH] add more instance filed --- pkg/util/aws/instance.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pkg/util/aws/instance.go b/pkg/util/aws/instance.go index 382bf8b1bb..77f798bb1b 100644 --- a/pkg/util/aws/instance.go +++ b/pkg/util/aws/instance.go @@ -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 {