+
+ # Get all network interfaces
+ interface_ids = []
+ for node in nodes:
+ interface_ids.extend(node['nodenetwork_ids'])
+ interfaces = self.shell.GetNodeNetworks(self.auth, interface_ids)
+ interface_dict = {}
+ for interface in interfaces:
+ interface_dict[interface['nodenetwork_id']] = interface
+
+ # join nodes with thier interfaces
+ for node in nodes:
+ node['interfaces'] = []
+ for nodenetwork_id in node['nodenetwork_ids']:
+ node['interfaces'].append(interface_dict[nodenetwork_id])
+
+ # convert and threshold to ints
+ timestamp = self.timestamp['timestamp']
+ start_time = int(self.timestamp['timestamp'].strftime("%s"))
+ end_time = int(self.duration.strftime("%s"))
+ duration = end_time - start_time
+
+ # create the plc dict
+ networks = {'nodes': nodes, 'name': self.hrn, 'start_time': start_time, 'duration': duration}
+ resources = {'networks': networks, 'start_time': start_time, 'duration': duration}
+
+ # convert the plc dict to an rspec dict
+ resouceDict = RspecDict(resources)
+
+ # convert the rspec dict to xml
+ rspec = Rspec()
+ rspec.parseDict(resourceDict)
+ return rspec.toxml()