Get IPs of servers subscribed for Redfish events

Changes:
 - New method - Get Destination IPs Of Event Subscriptions

Tested:
 - Dummy test

Change-Id: I8c39c05a6cd3bc1221fefa025eb1da8c2d6ac28e
Signed-off-by: Anusha Dathatri <adathatr@in.ibm.com>
diff --git a/lib/event_notification_utils.robot b/lib/event_notification_utils.robot
index cc6eeef..d91f1c5 100644
--- a/lib/event_notification_utils.robot
+++ b/lib/event_notification_utils.robot
@@ -25,3 +25,16 @@
     END
     [Return]  ${subscription_ids}
 
+Get Destination IPs Of Event Subscriptions
+    [Documentation]  Get all subscribed server IPs as a list from event subscriptions.
+
+    ${subscription_ids}=  Get Event Subscription IDs
+
+    ${server_ips}=  Create List
+    FOR  ${id}  IN  @{subscription_ids}
+        ${destination}=  Redfish.Get Attribute  /redfish/v1/EventService/Subscriptions/${id}  Destination
+        # E.g. https://xx.xx.xx.xx:xxxx/redfish/events
+        ${dest_ip}=  Get Regexp Matches  ${destination}  .*://(.*):.*  1
+        ${server_ips}=  Combine Lists  ${server_ips}  ${dest_ip}
+    END
+    [Return]  ${server_ips}