def configIgmpHost(self, ipObj, **kwargs): """ Description Create or modify IGMP host. Provide an IPv4|IPv6 obj to create a new IGMP host object. Provide an IGMP host object to modify. Parameters ipObj: : /api/v1/sessions/1/ixnetwork/topology/1/deviceGroup/1/ethernet/1/ipv4/1 igmpObj: : /api/v1/sessions/1/ixnetwork/topology/1/deviceGroup/1/ethernet/1/ipv4/1/igmp/1 Syntax POST: /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id}/igmp PATCH: /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id}/igmp/{id} Example: Return /api/v1/sessions/{id}/ixnetwork/topology/{id}/deviceGroup/{id}/ethernet/{id}/ipv4/{id}/igmp/{id} """ # To create new IGMP object if 'igmp' not in obj: igmpUrl = self.ixnObj.httpHeader+obj+'/igmp' self.ixnObj.logInfo('Create new IGMP V4 host') response = self.ixnObj.post(igmpUrl) # /api/v1/sessions/1/ixnetwork/topology/1/deviceGroup/1/ethernet/1/ipv4/1/igmp/1 igmpObj = response.json()['links'][0]['href'] # To modify OSPF if 'igmp' in obj: igmpObj = obj igmpObjResponse = self.ixnObj.get(self.ixnObj.httpHeader+igmpObj) if 'name' in kwargs: self.ixnObj.patch(self.ixnObj.httpHeader+igmpObj, data={'name': kwargs['name']}) # All of these BGP attributes configures multivalue singleValue. So just loop them to do the same thing. igmpAttributes = ['areaId', 'neighborIp', 'helloInterval', 'areadIdIp', 'networkType', 'deadInterval'] for igmpAttribute in igmpAttributes: if igmpAttribute in kwargs: multiValue = igmpObjResponse.json()[igmpAttribute] self.ixnObj.logInfo('Configuring IGMP host attribute: %s' % igmpAttribute) self.ixnObj.patch(self.ixnObj.httpHeader+multiValue+"/singleValue", data={'value': kwargs[igmpAttribute]}) self.configuredProtocols.append(igmpObj) return igmpObj