简体   繁体   English

REST API和Artifactory

[英]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 我正在使用带有人工制品的Rest API,我正在尝试在人工制品中的某个仓库中抓取所有文件,而我正在使用的其余API

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. 我不确定我是否100%理解您,因此我将介绍两种情况:1.如果您尝试下载所有工件,则将使用的REST API用于搜索,因为您可以在URL中看到:'/ api / search /'当前,没有REST可以根据特定的创建日期下载所有工件。 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. 为了实现这一点,您可以编写一个简单的脚本,从上述REST API获取结果,然后下载该列表上可用的所有工件。 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 2.如果您只想获取工件列表而不下载它们-我已经在计算机上尝试过,它似乎可以正常工作:curl -iuadmin:password“ http:// localhost:8081 / artifactory / api / search / creation?from = 1476341107000&to = 1476427507000&repos = ext-release-local “ HTTP / 1.1 200 OK服务器:Artifactory / 4.13.0 X-Artifactory-Id:4e650fb6a9d3c7c6:6d70a648:157e0d5c020:-8000内容类型:应用程序/vnd.org.jfrog.artifactory.search.ArtifactCreationResult+json传输编码:分块日期:2016年10月20日,星期四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" } ] } {“ results”:[{“ uri”:“ http:// localhost:8081 / artifactory / api / storage / ext-release-local / multi1 / multi1 / 3.5 / multi1-3.5-sources.jar ”,“已创建” :“” 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 “,”创建“:” 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? 您能否像REST所期望的那样再次检查您的“ long”是否在Millisec中?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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