I have implemented an API for accessing the Portal data programatically, if you login and select “API” from the menu there is some info there about it.
So far I have only implemented one function: the ability to retrieve the encap routes.
I would appreciated comments / feedback / suggestions as well as any bug reports.
Thanks, Chris
On Wed, Nov 19, 2014 at 12:21 PM, Chris chris@g1fef.co.uk wrote:
(Please trim inclusions from previous messages) _______________________________________________ I have implemented an API for accessing the Portal data programatically, if you login and select “API” from the menu there is some info there about it.
So far I have only implemented one function: the ability to retrieve the encap routes.
I would appreciated comments / feedback / suggestions as well as any bug reports.
Thanks Chris, this is neat. Where can I find the API specification? (the available commands, and what structure to expect replies)
Tom KD7LXL
On 19 Nov 2014, at 20:46, Tom Hayward esarfl@gmail.com wrote:
(Please trim inclusions from previous messages) _______________________________________________
On Wed, Nov 19, 2014 at 12:21 PM, Chris chris@g1fef.co.uk wrote: (Please trim inclusions from previous messages) _______________________________________________ I have implemented an API for accessing the Portal data programatically, if you login and select “API” from the menu there is some info there about it.
So far I have only implemented one function: the ability to retrieve the encap routes.
I would appreciated comments / feedback / suggestions as well as any bug reports.
Thanks Chris, this is neat. Where can I find the API specification?
If you login and select “API” from the menu there is some info there about it.
Regards, Chris
On Wed, Nov 19, 2014 at 1:13 PM, G1FEF chris@g1fef.co.uk wrote:
Thanks Chris, this is neat. Where can I find the API specification?
If you login and select “API” from the menu there is some info there about it.
You seem to have misunderstood what I meant by a specification. I poked around the service and think I sussed out the details I asked for. Here they are (feel free to paste this into your documentation page):
Endpoints
encap
Arguments: None
Returns: A list containing a dictionary for each encap route. The dictionaries will contain the following keys: encapType, gatewayIP, netmask, network, owner, title, and updated. The dictionary values will all be strings. "updated" is a datetime string in the format YYYY-MM-DD HH:MM:SS (similar to ISO 8601, but lacking a timezone).
Example request:
GET /api/v1/encap HTTP/1.1 Authorization: Basic xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Host: portal.ampr.org
Example Response: [ { u'encapType': u'IPIP', u'gatewayIP': u'219.94.234.244', u'netmask': u'24', u'network': u'44.129.128.0', u'owner': u'JH1VBB', u'title': u'JH1VBB', u'updated': u'2014-08-13 09:25:34'}, { u'encapType': u'IPIP', u'gatewayIP': u'220.245.50.125', u'netmask': u'32', u'network': u'44.135.103.130', u'owner': u'VK2DOT', u'title': u'Central Coast, NSW, Australia', u'updated': u'2014-09-20 02:38:31'}, { u'encapType': u'IPIP', u'gatewayIP': u'220.245.50.125', u'netmask': u'24', u'network': u'44.136.16.0', u'owner': u'VK2DOT', u'title': u'Central Coast, NSW, Australia', u'updated': u'2014-09-20 02:38:31'}]
Tom KD7LXL
On Wed, Nov 19, 2014 at 12:21 PM, Chris chris@g1fef.co.uk wrote:
I have implemented an API for accessing the Portal data programatically, if you login and select “API” from the menu there is some info there about it.
So far I have only implemented one function: the ability to retrieve the encap routes.
I would appreciated comments / feedback / suggestions as well as any bug reports.
I've written Python bindings for the new AMPR portal API. It abstracts the API calls through a standard Python object and parses the resulting JSON into Python objects.
https://github.com/kd7lxl/python-amprapi
I've updated my script that writes encap routes to Mikrotik devices to use the new API and Python bindings:
https://github.com/kd7lxl/python-amprapi/blob/master/updateros.py
This deprecates the old version found at https://github.com/HamWAN/hamwan_scripts/tree/master/amprupdate
Tom KD7LXL
On Wed, 19 Nov 2014, Chris wrote:
I have implemented an API for accessing the Portal data programatically, if you login and select “API” from the menu there is some info there about it.
So far I have only implemented one function: the ability to retrieve the encap routes.
I would appreciated comments / feedback / suggestions as well as any bug reports.
This is good stuff. One suggestion is to rename netmask to either masklen or prefixlen.
I've modified encapconvertnew.pl script to use the API and renamed it to amprroutes.pl (encapconvertnew.pl is still available). I've also added VyOS (Vyatta) as another possible router config.
http://ah6bw.ampr.org/amprroutes.pl
YMMV. BTW, if anybody knows how to apply policy routing to interface addresses in VyOS I'd like to hear from you. As always feedback/comments welcome. Enjoy.
Antonio Querubin e-mail: tony@lavanauts.org xmpp: antonioquerubin@gmail.com
On 22 Nov 2014, at 23:29, Antonio Querubin tony@lavanauts.org wrote:
(Please trim inclusions from previous messages) _______________________________________________ On Wed, 19 Nov 2014, Chris wrote:
I have implemented an API for accessing the Portal data programatically, if you login and select “API” from the menu there is some info there about it.
So far I have only implemented one function: the ability to retrieve the encap routes.
I would appreciated comments / feedback / suggestions as well as any bug reports.
This is good stuff. One suggestion is to rename netmask to either masklen or prefixlen.
Fair point, it is a CIDR prefix length really, not a netmask.
I will add another field “maskLength” then remove the “netmask” after a few days to allow any scripts already written to adjust.
Chris
I've modified encapconvertnew.pl script to use the API and renamed it to amprroutes.pl (encapconvertnew.pl is still available). I've also added VyOS (Vyatta) as another possible router config.
http://ah6bw.ampr.org/amprroutes.pl
YMMV. BTW, if anybody knows how to apply policy routing to interface addresses in VyOS I'd like to hear from you. As always feedback/comments welcome. Enjoy.
Antonio Querubin e-mail: tony@lavanauts.org xmpp: antonioquerubin@gmail.com _________________________________________ 44Net mailing list 44Net@hamradio.ucsd.edu http://hamradio.ucsd.edu/mailman/listinfo/44net
On Sun, Nov 23, 2014 at 3:58 AM, Chris chris@g1fef.co.uk wrote:
I will add another field “maskLength” then remove the “netmask” after a few days to allow any scripts already written to adjust.
Please make sure to bump the API version number any time you remove or dramatically change something. This will keep existing scripts from breaking. (And I think you knew this when you designed it with a version number.)
Tom KD7LXL
Hi Tom,
I will add another field “maskLength” then remove the “netmask” after a few days to allow any scripts already written to adjust.
Please make sure to bump the API version number any time you remove or dramatically change something. This will keep existing scripts from breaking. (And I think you knew this when you designed it with a version number.)
The version in the URL will not change except on a major change to the structure of the API, e.g. if we ever go from the current RESTful API returning json encoded data to something completely different. In which case the old API will remain under ‘/api/v1/‘ for a period of time to allow scripts to be updated etc and the new version would be accessed as ‘/api/v2’.
If you want to track changes you can use these two methods:
GET version GET changeLog
The first will return the current version of the API (1.03 at the time of writing this email). So you could use this to trigger an alert to the author of the client software that something has changed.
The second will send you a complete history of versions and what changed.
If anyone has any requests for new methods for the API, please let me know.
Thanks, Chris
Is the gateway@ampr.org Broken?
As not getting any emails in response to my requests yet it has deleted my gateway. Now have had 4 attempts to update my gateway and failed in the past 14 hours.
Now cut off from the amprnet and very lonely.
Also I noted yesterday, that 'we' are not allowed to add a non managed subnet (requested by another sysop) to my gateway list of routes when using the portal manual update.
Hence using the gateway Robot. Paul G4APL GB7CIP Caterham GBR gateway
Hello Paul.
Could be that Chris is working with portal code. That's why such uncomfortable situation.
Best regards. Tom - SP2L (ex sp2lob)
Paul.
But first of all, address should be:
gateways@ampr.org
Best regards. Tom - SP2L (ex sp2lob)
Yep, that is what I have been using typo in my previous message
gateways@ampr.org Paul In message ED535090CB7B4D8DB6442219E4CE4EAF@Sibro, SP2L SP2L@wp.pl writes
(Please trim inclusions from previous messages) _______________________________________________ Paul.
But first of all, address should be:
gateways@ampr.org
Best regards. Tom - SP2L (ex sp2lob)
44Net mailing list 44Net@hamradio.ucsd.edu http://hamradio.ucsd.edu/mailman/listinfo/44net
I had disabled the reply temporarily - they all came to me so I could test it properly. I’ve re-enabled the reply now, so you can try again.
We now have v6 of the gateway robot which is more or less backwards compatible with v5, there are a few differences:
- It will now process multiple commands in one email; - Each “Command block” is a series of lines without blank lines in between; - A blank line instructs the robot to stop processing this command block and start a new one; - The username field is now mandatory for “New entry” commands;
Regards, Chris
Hello Chris many thanks for the update re version6
Have reformatted my request as a test of the new system. It failed to add the first three lines of subnets space separated. Accepted the last Subnet: line entry Though all 'listed in the 'This is what I found:
What have I done wrong? Having followed the online V6 Robot help. Paul G4APL caterhamip
Hi Paul,
As per the docs: "One line containing a space separated list of subnets served by your gateway.” If you put more than one in, subsequent ones will overwrite the previous ones, so only the last one found will be actioned.
The only field to accept multiple lines at this time is the new “Notes:” field.
If you think having the ability to specify multiple Subnet: lines per command block would be useful, it should be quite easy to add that capability?
Regards, Chris
On 25 Nov 2014, at 13:41, Paul Lewis paul@skywaves.demon.co.uk wrote:
(Please trim inclusions from previous messages) _______________________________________________ Hello Chris many thanks for the update re version6
Have reformatted my request as a test of the new system. It failed to add the first three lines of subnets space separated. Accepted the last Subnet: line entry Though all 'listed in the 'This is what I found:
What have I done wrong? Having followed the online V6 Robot help. Paul G4APL caterhamip
44Net mailing list 44Net@hamradio.ucsd.edu http://hamradio.ucsd.edu/mailman/listinfo/44net
Hello Chris
Ok on your comments Chrs, The introduction example in the Robots V6 disagrees with your comments as it shows two subnet: statements
in the mandatory fields Subnets: I read it as one line, though the example there showed three Subnets: ###.###.###.### in a block.
Yes Please. IMHO Multiple Subnets: is a requirement. Version 5 was amended to allow that earlier this year. As I had a lot separate subnets. that I had an issue with line lengths and word wrap.
I'll wait for the change, then will delete the gateway again, and resubmit Paul G4APL GB7CIP
Hello Chris
Thanks for making the Change. GB7CIP updated. Online portal Gateway entry all looks good.
As my Head Mistress use to say "Carry on London" Paul G4APL
No problem, it was a trivial task to add multiple Subnet: lines, I’ve updated the docs to make it unambiguous now, the previous version wasn’t really very clear.
Regards, Chris
On 25 Nov 2014, at 16:14, Paul Lewis paul@skywaves.demon.co.uk wrote:
(Please trim inclusions from previous messages) _______________________________________________ Hello Chris
Thanks for making the Change. GB7CIP updated. Online portal Gateway entry all looks good.
As my Head Mistress use to say "Carry on London" Paul G4APL
-- paul@skywaves.demon.co.uk _________________________________________ 44Net mailing list 44Net@hamradio.ucsd.edu http://hamradio.ucsd.edu/mailman/listinfo/44net
Hello Chris
I am currently talking Ken G7VJA the Co-ordinator North Devon how to assign subnets. 44.131.210.0/24
He does not have the Coordinator option Only has Home Gateway DNS Logout
Would you please add the Coodinator option
So we can make progress
73 de Paul G4APL
Hello UK Packet Radio SysOps on this group Some of you may not have seen this.
Having had my attention a few weeks ago drawn to the following announcement URL listed below.
I have not seen many others that are active on the UK packet networks that have systems connected via the Internet handling 3rd party messages, or have an Old GB7 NOV (Notice of Variation) to your main Amateur Radio Licence. Appear on the http://www.ukrepeater.net/index.html website.
UK Packet radio systems and beacons: replacing RSGB 'Letters of Authority'
http://licensing.ofcom.org.uk/radiocommunication-licences/amateur-radio/l icensing-updates/rsgb-letters
Paul G4APL