This archive is retained to ensure existing URLs remain functional. It will not contain any emails sent to this mailing list after July 1, 2024. For all messages, including those sent before and after this date, please visit the new location of the archive at https://mailman.ripe.net/archives/list/[email protected]/
[atlas] Sagan: 'Response' object has no attribute 'edns0'
- Previous message (by thread): [atlas] problems creating measurements with old web interface
- Next message (by thread): [atlas] some probes not returning NSID
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Paul Vlaar
pvlaar at afilias.info
Thu Feb 19 00:47:50 CET 2015
Hi all, I'm trying to do some basic DNS UDM result parsing using Sagan. I'd like to have an easy way to extract the NSID. I followed the instruction found here: https://www.ripe.net/ripe/mail/archives/ripe-atlas/2014-May/001475.html 'from ripe.atlas.sagan import Result result = Result("your-JSON-result-blob-here") print(result.responses[0].edns0.options[0].nsid)' That didn't work, as I get: AttributeError: 'Result' object has no attribute 'responses' So I figured I need to use a DnsResult, instead. I then have the following Python code: from ripe.atlas.sagan import DnsResult import json url = "https://atlas.ripe.net/api/v1/measurement-latest/1873691/" results = json.load(urllib.urlopen(url)) for probe in results: sagan_result = DnsResult(results[probe][0]) print(sagan_result.responses[0].edns0.options[0].nsid) This gives me: print(sagan_result.responses[0].edns0.options[0].nsid) AttributeError: 'Response' object has no attribute 'edns0' After some digging through the Sagan documentation, I found out that the way to do this should be: print(sagan_result.responses[0].abuf.edns0.options[0].nsid) This might be of help to others. ~paul
- Previous message (by thread): [atlas] problems creating measurements with old web interface
- Next message (by thread): [atlas] some probes not returning NSID
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]