简体   繁体   中英

Rest API and Artifactory

I'm working with rest apis with artifactory I am trying to grab all the files in a certain repo within artifactory the rest api I am using is

http://artifactory/artifactory/webapp/browserepo.html/api/search/creation?0from=long&to=long&repos=integration 

But it is not returning the info I need, the usage artifactory suggests is

/api/search/creation?from=javaEpochMillis[&to=javaEpochMillis][&repos=x[,y]]

I'm trying to grab every thing within the integration repo but am have no luck.

I'm not sure that I understood you 100% so I'll cover both cases that came to my head: 1. If you are trying to download all of the artifacts - The REST API that you are using is used for search, as you can see in the URL: '/api/search/' Currently, there is no REST to download all of the artifacts based on specific creation date. In order to achieve that you can write a simple script that is getting the results from the above REST API and download every artifact that is available on that list. 2. In case that you are only trying to get a list of artifacts and not download them - I've tried it on my computer and it seems to work perfectly: curl -iuadmin:password " http://localhost:8081/artifactory/api/search/creation?from=1476341107000&to=1476427507000&repos=ext-release-local " HTTP/1.1 200 OK Server: Artifactory/4.13.0 X-Artifactory-Id: 4e650fb6a9d3c7c6:6d70a648:157e0d5c020:-8000 Content-Type: application/vnd.org.jfrog.artifactory.search.ArtifactCreationResult+json Transfer-Encoding: chunked Date: Thu, 20 Oct 2016 06:50:58 GMT

{ "results" : [ { "uri" : " http://localhost:8081/artifactory/api/storage/ext-release-local/multi1/multi1/3.5/multi1-3.5-sources.jar ", "created" : "2016-10-13T10:55:06.781+02:00" }, { "uri" : " http://localhost:8081/artifactory/api/storage/ext-release-local/multi1/multi1/3.5/multi1-3.5-sources.pom ", "created" : "2016-10-13T10:58:42.506+02:00" }, { "uri" : " http://localhost:8081/artifactory/api/storage/ext-release-local/multi1/multi1/3.5/multi1-3.5-tests.jar ", "created" : "2016-10-13T10:56:16.655+02:00" }, { "uri" : " http://localhost:8081/artifactory/api/storage/ext-release-local/multi1/multi1/3.5/multi1-3.5-tests.pom ", "created" : "2016-10-13T10:58:42.513+02:00" }, { "uri" : " http://localhost:8081/artifactory/api/storage/ext-release-local/multi1/multi1/3.5/multi1-3.5.jar ", "created" : "2016-10-13T10:52:23.166+02:00" }, { "uri" : " http://localhost:8081/artifactory/api/storage/ext-release-local/multi1/multi1/3.5/multi1-3.5.pom ", "created" : "2016-10-13T10:56:41.267+02:00" } ] }

Can you double check that your 'long' is in Millisec as the REST expects it to be?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM