updated with changes to support automated triggering of post-deploymet provisioning
diff --git a/automation/node.go b/automation/node.go
index d364fe0..fe61add 100644
--- a/automation/node.go
+++ b/automation/node.go
@@ -80,6 +80,27 @@
return hn
}
+// IPs get the IP Addresses
+func (n *MaasNode) IPs() []string {
+ ifaceObj, _ := n.GetMap()["interface_set"]
+ ifaces, _ := ifaceObj.GetArray()
+ result := []string{}
+
+ for _, iface := range ifaces {
+ obj, _ := iface.GetMap()
+ linksObj, _ := obj["links"]
+ links, _ := linksObj.GetArray()
+ for _, link := range links {
+ linkObj, _ := link.GetMap()
+ ipObj, _ := linkObj["ip_address"]
+ ip, _ := ipObj.GetString()
+ result = append(result, ip)
+ }
+ }
+
+ return result
+}
+
// MACs get the MAC Addresses
func (n *MaasNode) MACs() []string {
macsObj, _ := n.GetMap()["macaddress_set"]