REST API Versioning
See original GitHub issueIssue
Currently there is no way to identify the Floodlight software version via the REST API. This can be an issue when trying to process Floodlight REST messages. For example, Static Flow Pusher in Floodlight v1.2 is changing to Static Entry Pusher in (upcoming) Floodlight v1.3. It would be helpful if an application could ask Floodlight for its API version before issuing commands.
Potential Solution(s)
Referencing this stackoverflow question, we see the following ant instructions will put version information in the jar’s manifest:
<jar destfile="${floodlight-jar}" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
<attribute name="Class-Path" value="."/>
<attribute name="Implementation-Version" value="${version}.${build.number}"/>
</manifest>
...
Then, the version can be read in the code as follows:
String ver = MyClass.class.getPackage().getImplementationVersion();
A resource could be attached to CoreWebRoutable
that reports software version information, or maybe software version information could be provided as part of the health/json
resource.
I also see some discussion of a “schema” API being added in the revision log, but I don’t know the details.
Wondering your thoughts/plans on API and/or version reporting?
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top GitHub Comments
@rsharo figured out the maven issue after some debugging. The version REST API you’ve requested works now using (1) Eclipse to run… must parse pom.xml manually, (2) the jar in the build environment… read from manifest, (3) the jar on another machine… read from manifest.
@rizard Wow! Very nice work!
I’m not in a position to actually try this code yet but it all looks good by inspection.
Thanks for the very quick turnaround!