def configVxlanNgpf(self, obj=None, routerId=None, port=None, portName=None, ngpfEndpointName=None, hostIp=None, **kwargs): """ Description Create or modify a VXLAN. If creating a new VXLAN header, provide an IPv4 object handle. If creating a new VxLAN object, provide an IPv4 object handle. If modifying a OSPF, there are five options. 2-6 will query for the OSPF object handle. 1> Provide the OSPF object handle using the obj parameter. 2> Set routerId. 3> Set port: The physical port. 4> Set portName: The vport port name. 5> Set NGPF OSPF name that you configured. 6> Set hostIp: The src IP. Parameters obj: : IPv4 Obj example: /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id} VxLAN Obj example: /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id}/vxlan/{id} Syntax POST: /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id}/vxlan PATCH: /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id}/vxlan/{id} Example: createVxlanNgpf(ipv4Object='/api/v1/sessions/1/ixnetwork/topology/1/deviceGroup/1/ethernet/1/ipv4/1', vtepName='vtep_1', vtepVni={'start':2008, 'step':2, 'direction':'increment'}, vtepIpv4Multicast={'start':'225.8.0.1', 'step':'0.0.0.1', 'direction':'increment'}) start = The starting value step = 0 means don't increment or decrement. For IP step = 0.0.0.1. Increment on the last octet. 0.0.1.0. Increment on the third octet. direction = increment or decrement the starting value. Return /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id}/vxlan/{id} """ if obj != None: if 'vxlan' not in obj: self.ixnObj.logInfo('Create new VxLAN in NGPF') response = self.ixnObj.post(self.ixnObj.httpHeader+obj+'/vxlan') vxlanId = response.json()['links'][0]['href'] self.ixnObj.logInfo('createVxlanNgpf: %s' % vxlanId) if 'vxlan' in obj: vxlanId = obj # To modify if ngpfEndpointName: vxlanId = self.getNgpfObjectHandleByName(ngpfEndpointName=ngpfEndpointName, ngpfEndpointObject='vxlan') # To modify if port: x = self.getProtocolListByPortNgpf(port=port) vxlanId = self.getProtocolObjFromProtocolList(x['deviceGroup'], 'vxlan')[0] # To modify if portName: x = self.getProtocolListByPortNgpf(portName=portName) vxlanId = self.getProtocolObjFromProtocolList(x['deviceGroup'], 'vxlan')[0] # To modify if routerId: vxlanId = self.getNgpfObjectHandleByRouterId(routerId=routerId, ngpfEndpointObject='vxlan') # To modify if hostIp: x = self.getProtocolListByHostIpNgpf(hostIp) vxlanId = self.getProtocolObjFromHostIp(x, protocol='vxlan') # Get VxLAN metadatas vxlanResponse = self.ixnObj.get(self.ixnObj.httpHeader+vxlanId) for key,value in kwargs.items(): if key == 'vtepName': self.ixnObj.patch(self.ixnObj.httpHeader+vxlanId, data={'name': value}) if key == 'vtepVni': multivalue = vxlanResponse.json()['vni'] self.ixnObj.logInfo('Configuring VxLAN attribute: %s: %s' % (key, value)) data={'start':kwargs['vtepVni']['start'], 'step':kwargs['vtepVni']['step'], 'direction':kwargs['vtepVni']['direction']} self.configMultivalue(multivalue, 'counter', data=data) if key == 'vtepIpv4Multicast': self.ixnObj.logInfo('Configuring VxLAN IPv4 multicast') multivalue = vxlanResponse.json()['ipv4_multicast'] data={'start':kwargs['vtepIpv4Multicast']['start'], 'step':kwargs['vtepIpv4Multicast']['step'], 'direction':kwargs['vtepIpv4Multicast']['direction']} self.configMultivalue(multivalue, 'counter', data=data) self.configuredProtocols.append(vxlanId) return vxlanId