Help with Artifactory APIs

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Help with Artifactory APIs

omeshp
Hi,

I am trying to integrate with Artifactory using rest APIs and to do that need to be able to do the following:
1. Give a filter list of repositories based on tool type e.g I will like to only get repositories which are either nuget or npm based. I tried using https://user.jfrog.io/user/api/repositories but it doesn't return the type of repository so i cannot filter the list.  I see that https://user.jfrog.io/user/api/storageinfo returns repositoriesSummaryList which includes the package type of repositories. Is it ok to use this APIs for getting the list of repositories and filtering?

2. Given a repository I want to get list of packages in that repository. The only way i could find out for this was making a POST call to https://user.jfrog.io/user/api/search/aql with the body
items.find(
    {
        "repo":{"$eq":"myawesome-remotenugetrepo-cache"}
    }
)

Is there any way to get this information using a GET call instead of POST?

3. In Artifactory different versions of same package are treated as different packages For example: For the Query in 2 the result is something like this:
[
           {
            "repo": "myawesome-remotenugetrepo-cache",
            "path": ".",
            "name": "bootstrap.3.3.2.nupkg",
            "type": "file",
            "size": 264693,
            "created": "2016-05-27T16:07:12.138Z",
            "created_by": "admin",
            "modified": "2015-12-03T12:57:47.000Z",
            "modified_by": "admin",
            "updated": "2016-05-27T16:07:12.166Z"
        },
        {
            "repo": "myawesome-remotenugetrepo-cache",
            "path": ".",
            "name": "bootstrap.3.3.6.nupkg",
            "type": "file",
            "size": 290372,
            "created": "2016-05-27T10:55:47.576Z",
            "created_by": "admin",
            "modified": "2015-12-03T12:57:48.000Z",
            "modified_by": "admin",
            "updated": "2016-05-27T10:55:47.613Z"
        },
        {
            "repo": "myawesome-remotenugetrepo-cache",
            "path": ".",
            "name": "jQuery.1.9.1.nupkg",
            "type": "file",
            "size": 240271,
            "created": "2016-05-27T10:55:43.895Z",
            "created_by": "admin",
            "modified": "2015-12-07T15:58:51.000Z",
            "modified_by": "admin",
            "updated": "2016-05-27T10:55:43.930Z"
        }
]

As you can see the result includes entries for both versions of bootstrap 3.3.2 and 3.3.6. What I hoped was that the list of packages will just include bootstrap and jquery, Is there anyway to get this list?
Also give the package bootstrap is there any way to query for different versions of it?

Regards,
Omesh