We have created an example of a new layout, according to an RPM package, and changed the layout of the repository to the new one:
[orgPath]/[module]-[baseRev](-[fileItegRev])-[classifier].[ext]
Then, we deployed an RPM package to Artifactory (to the repository ‘rpm-local’) with the following path:
rpm-local/centos/7/x86_64/cloudmunch-def-plugin-87-1.x86_64.rpm
As can be seen below, Artifactory identifies the version of the package according to the BaseRev we deployed:
Once the layout matches, you should be able to use the mentioned API to find the latest version. For example:
$ curl ARTIFACTORY_URL/api/search/latestVersion?g=centos.7&a=x86_64&repos=rpm-local
99
The latest artifact version based on layout in repository ‘rpm-local’, is 99 (as can be seen in the screenshot below).
In addition, you may also use AQL to query Artifactory for almost anything you want.
AQL is a dedicated query language which can be used to retrieve essential outputs according to your requirements.