artifactory - 从 repo 获取文件日期创建和修改

artifactory - get file date creation and modification from repo

我尝试 google 并没有真正得到我想要的结果。想知道有谁知道如何从 artifactory 获取工件的创建日期和修改日期吗?

谢谢

有几个选项,这里有两个-

要获取有关 Artifactory 中特定文件的信息,您可以使用 File Info REST API:

GET https://artifacotry.my.org/artifactory/api/storage/my-repo/path/to/some-file.txt

200
{
  "repo": "my-repo",
  "path": "path/to/some-file.txt",
  "created": ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ),
  "lastModified": ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ),
  ...
{

要执行查询(可能很复杂)以查找您可以使用的文件 AQL (Artifactory Query Language),只需确保在结果中包含相关字段,例如:

POST https://artifacotry.my.org/artifactory/api/search/aql
items.find(
    {
        "repo":"my-repo"
    }
).include(
    "item.repo",
    "item.path",
    "item.name",
    "item.created",
    "item.updated"
)

200
{
  "results" : [
    {
      "repo" : "my-repo",
      "path" : "path/to",
      "name" : "some-file.txt",
      "created" : "2015-01-01T10:10:52.383+02:00",
      "updated" : "2015-01-01T10:12:25.182+02:00"
    }, 
    ...
  ], 
  ...
}