diff --git a/c_network_interface.go b/c_network_interface.go index 5a48957..111f2d6 100644 --- a/c_network_interface.go +++ b/c_network_interface.go @@ -4,7 +4,9 @@ package main -import "strings" +import ( + "strings" +) // NetworkInterface : ... type NetworkInterface struct { @@ -28,6 +30,7 @@ func (n *NetworkInterface) Handle(subject string, c component, lines []Message) } func (n *NetworkInterface) getSingleDetail(c component, prefix string) (lines []Message) { + ip, _ := c["private_ip_address"].(string) name, _ := c["name"].(string) if prefix != "" { name = prefix + " " + name @@ -41,6 +44,7 @@ func (n *NetworkInterface) getSingleDetail(c component, prefix string) (lines [] return lines } lines = append(lines, Message{Body: " " + name, Level: level}) + lines = append(lines, Message{Body: " IP : " + ip, Level: ""}) id, _ := c["id"].(string) if id != "" { lines = append(lines, Message{Body: " ID : " + id, Level: ""}) diff --git a/c_virtual_network.go b/c_virtual_network.go index 5ab4aab..7745fd4 100644 --- a/c_virtual_network.go +++ b/c_virtual_network.go @@ -4,7 +4,9 @@ package main -import "strings" +import ( + "strings" +) // VirtualNetwork : ... type VirtualNetwork struct { @@ -28,7 +30,12 @@ func (n *VirtualNetwork) Handle(subject string, c component, lines []Message) [] } func (n *VirtualNetwork) getSingleDetail(c component, prefix string) (lines []Message) { - ip, _ := c["address_space"].(string) + addressSpace := c["address_space"].([]interface{}) + var netlist []string + for _, a := range addressSpace { + netlist = append(netlist, a.(string)) + } + networks := strings.Join(netlist, ", ") name, _ := c["name"].(string) if prefix != "" { name = prefix + " " + name @@ -42,7 +49,7 @@ func (n *VirtualNetwork) getSingleDetail(c component, prefix string) (lines []Me return lines } lines = append(lines, Message{Body: " " + name, Level: level}) - lines = append(lines, Message{Body: " Address Space : " + ip, Level: ""}) + lines = append(lines, Message{Body: " Address Space : " + networks, Level: ""}) id, _ := c["id"].(string) if id != "" { lines = append(lines, Message{Body: " ID : " + id, Level: ""})