def getPacketHeaderAttributesAndValues(self, streamObj, packetHeaderName, fieldName): """ Parameters streamObj: : configElementObj|highLevelStreamObj Ex: /api/v1/sessions/{id}/ixnetwork/traffic/trafficItem/{1}/configElement/{id} or /api/v1/sessions/{id}/ixnetwork/traffic/trafficItem/{1}/highLevelStream/{id} packetHeaderName: : Display Name of the stack. Example: Ethernet II, VLAN, IPv4, TCP, etc. fieldName: : Display Name of the field. Example: If packetHeaderName is Ethernet II, field names could be Destination MAC Address, Source MAC Address, Ethernet-Type and PFC Queue. You will have to know these field names. To view them, make your configurations and then go on the API browser and go to: /api/v1/sessions/{id}/ixnetwork/traffic/trafficItem/{1}/configElement/{id}/stack/{id}/field Example: streamObj = '/api/v1/sessions/{id}/ixnetwork/traffic/trafficItem/{id}/configElement/{id}' data= trafficObj.getPacketHeaderAttributesAndValues(streamObj, 'Ethernet II', 'Source MAC Address') data['singleValue'] = For single value. data['startValue'] = If it is configured to increment. Returns All the attributes and values in JSON format. """ response = self.ixnObj.get(self.ixnObj.httpHeader+streamObj+'/stack') for eachStack in response.json(): stackHref = eachStack['links'][0]['href'] response = self.ixnObj.get(self.ixnObj.httpHeader+stackHref) # need to do strip() to response.json()['displayName'] because some displayName has trailing spaces. # for example: "IPv4 " if packetHeaderName == response.json()['displayName'].strip(): response = self.ixnObj.get(self.ixnObj.httpHeader+stackHref+'/field') for eachField in response.json(): if fieldName == eachField['displayName']: return eachField