Historically NGCP supported Firmware tags for endpoint 'latest' only: > http://<ngcp_fqdn>:<bootstrap_port>/device/autoprov/firmware/<mac>/from/<current_firmware_version>/latest/<tag> For example: NGCP has 7 firmwares configured for SNOM D715 with MAC 0004138aa403. For the simplicity let's call firmwares versions: 1, 2, 3, 4, 5, 6, 7. the firmwares '4' and '6' has the same tag 'mytag'. The latest firmware is firmware with id '7' and it has no tag set. The endpoint 'latest' gives access to firmware '6' only: >> curl http://myserver.com:1445/device/autoprov/firmware/0004138aa403/from/0/latest > firmware 7 >> curl http://myserver.com:1445/device/autoprov/firmware/0004138aa403/from/0/latest/mytag > firmware 6 This commit adds 'tags' support for enpoint 'next'. It allows to address the complete chain of firmwares using tags: >> curl http://myserver.com:1445/device/autoprov/firmware/0004138aa403/from/0/next > firmware 1 # the next firmware after version '0' is firmware '1' >> curl http://myserver.com:1445/device/autoprov/firmware/0004138aa403/from/0/next/mytag > firmware 4 # the next firmware after version '0' with tag 'mytag' is firmware '4' >> curl http://myserver.com:1445/device/autoprov/firmware/0004138aa403/from/2/next/mytag > firmware 4 # the same as above, the firmware after version '2' with tag 'mytag' is firmware '4' >> curl http://myserver.com:1445/device/autoprov/firmware/0004138aa403/from/4/next/mytag > firmware 6 # the next firmware after version '4' with tag 'mytag' is firmware '6' P.S. $tmp variable was not in use, removed. Also improve the 404 output for the 'tag' case. Change-Id: Ifb896e1aef7b57328ab6492236768bc15ca8cc9emr10.1
parent
b106891f68
commit
31d954dfa8
Loading…
Reference in new issue