Search code examples
artifactoryjfrog-cli

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?


Solution

  • 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"
          ]
        }
      }
    ]