# set interfaces
# just get first interface of the first node
if1_xrn = PlXrn(auth=self.api.hrn, interface='node%s:eth0' % (node1['node_id']))
+ if1_ipv4 = self.interfaces[node1['interface_ids'][0]]['ip']
if2_xrn = PlXrn(auth=self.api.hrn, interface='node%s:eth0' % (node2['node_id']))
+ if2_ipv4 = self.interfaces[node2['interface_ids'][0]]['ip']
- if1 = Interface({'component_id': if1_xrn.urn} )
- if2 = Interface({'component_id': if2_xrn.urn} )
+ if1 = Interface({'component_id': if1_xrn.urn, 'ipv4': if1_ipv4} )
+ if2 = Interface({'component_id': if2_xrn.urn, 'ipv4': if2_ipv4} )
# set link
link = Link({'capacity': '1000000', 'latency': '0', 'packet_loss': '0', 'type': 'ipv4'})
slices = self.api.plshell.GetSlices(self.api.plauth, slice_name)
if slices:
slice = slices[0]
+ self.prepare(slice=slice)
else:
self.prepare()
latency=link['latency'], packet_loss=link['packet_loss'])
if 'type' in link and link['type']:
type_elem = etree.SubElement(link_elem, 'link_type', name=link['type'])
-
@staticmethod
def get_links(xml):
links = []
if 'bwlimit' in interface and interface['bwlimit']:
bwlimit = etree.SubElement(node_tag, 'bw_limit', units='kbps').text = str(interface['bwlimit']/1000)
comp_id = PlXrn(auth=network, interface='node%s:eth%s' % (node['node_id'], i)).get_urn()
- interface_tag = etree.SubElement(node_tag, 'interface', component_id=comp_id)
+ ipaddr = interface['ip']
+ interface_tag = etree.SubElement(node_tag, 'interface', component_id=comp_id, ipv4=ipaddr)
i+=1
if 'bw_unallocated' in node:
bw_unallocated = etree.SubElement(node_tag, 'bw_unallocated', units='kbps').text = str(node['bw_unallocated']/1000)