简体   繁体   中英

jfrog cli retrieve metadata

I have a job which uses the jfrog cli to access artifactory and pull down a resource. eg:

jfrog rt c shared01 --url="xxx" --user=xxx --password=xxx
jfrog rt dl --server-id shared01 --flat true "source/file" "./destfile"

This resource has some properties that I would like to retrieve. I can see from the documentation that you can retrieve where properties match XYZ, but I would just like to retrieve the metadata (we are storing the "product" version here).

Can anyone tell me if this is achievable?

The CLI doesn't have this capability build in. You can use a REST API to get artifact's properties .

Another possibility(which I haven't tried, but seems valid) is to use the CLI Using File Specs . With File Specs you can search using AQL , where you can ask directly for the properties and filter per your needs.

Good Luck!

The Search command seems to return the property metadata, at least on version 1.50.2

jfrog rt s --server-id shared01 "source/file"

outputs something like

[Info] Searching artifacts...
[Info] Found 1 artifact.
[
  {
    "path": "source/file",
    "type": "file",
    "size": 12345,
    "created": "2021-09-08T19:56:21.314Z",
    "modified": "2021-09-08T19:56:21.063Z",
    "sha1": "ffffffffffffffffffffffffffffffffffffffff",
    "md5": "ffffffffffffffffffffffffffffffff",
    "props": {
      "someprop": [
        "value"
      ],
      "anotherprop": [
        "anothervalue"
      ]
    }
  }
]

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