-
Type:
Improvement
-
Status: Closed
-
Resolution: Deferred
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: AQL
-
Labels:None
-
Location:External
Description:
Customer would like to know the top 10 docker images which have been downloaded from the Artifactory instance.
For instance, if we execute the below AQL, we will be getting the results along with the “stats” details. However, at this moment, we will not be able to able to sort the AQL results based on the stats.downloads data.
curl -s -k -XPOST "https://test.jfrog.com/artifactory/api/search/aql" -d 'items.find({"repo":"madhan-docker-docker-local"},{"name": {"$match" : "*manifest.*"}}).include("stat")' -H "Content-Type: text/plain"
{ "results" : [ { "repo" : "docker-docker-local", "path" : "docker.elastic.co/logstash/logstash-oss/7.17.0", "name" : "manifest.json", "type" : "file", "size" : 2823, "created" : "2022-02-17T08:19:39.623Z", "created_by" : "admin", "modified" : "2022-02-17T08:19:39.542Z", "modified_by" : "admin", "updated" : "2022-02-17T08:19:39.625Z", "stats" : [ { "downloaded" : "2022-04-28T17:48:29.425Z", "downloaded_by" : "admin", "downloads" : 1, "remote_downloads" : 0 } ] },{ "repo" : "docker-docker-local", "path" : "docker.elastic.co/logstash/logstash-oss/7.16.2", "name" : "manifest.json", "type" : "file", "size" : 2823, "created" : "2022-02-17T08:23:14.483Z", "created_by" : "admin", "modified" : "2022-02-17T08:23:14.331Z", "modified_by" : "admin", "updated" : "2022-02-17T08:23:14.485Z", "stats" : [ { "downloaded" : "2022-04-26T14:36:16.004Z", "downloaded_by" : "admin", "downloads" : 2, "remote_downloads" : 0 } ] } ], "range" : { "start_pos" : 0, "end_pos" : 2, "total" : 2 } }
It would be a great improvement in the AQL functionality as we have multiple customers who would like to know about the top downloaded docker images / artifacts.
What is the expected behavior?
Need to improve this behavior by sorting the AQL results based on the stat.downloads value.
For example, if we execute the AQL as below, it should display the output in the sorted order based on the most downloaded docker images.
curl -s -k -XPOST "https://test.jfrog.com/artifactory/api/search/aql" -d 'items.find({"repo":"docker-docker-local"},{"name": {"$match" : "*manifest.*"}}).include("stat").sort({"$desc" : ["stat.downloads"]})' -H "Content-Type: text/plain"
Possible workaround: No