最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Artifactory-Xray Trigger a file rescan - Stack Overflow

programmeradmin1浏览0评论

I'm trying to figure out a way via api/cli to trigger an xray rescan of a Artifactory element. i.e. I want to trigger the exact behavior I see when, via the gui, I navigate to a file, click on the xray tab, and then select "Scan for Violations".

I've got this working via the cli when the content has an associated build using the "jf rt bs" but I have some elements that aren't "attached" to builds.

I've tried using this, but something isn't right with my syntax

curl -X POST "https://XXXXX/xray/api/v1/scanArtifact" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${PASSWD}" \
-d '{
      "repo_key": "my-repo",
      "path": "file/i/want-to-scan"
    }'

I've also tried using "repo-path": "my-repo/file/i/want-to-scan"

Anyone have tips or an example of how to pull this off? There must be a way to trigger this exact behavior.

xray version 3.91.3 Artifactory 7.90.10

I'm trying to figure out a way via api/cli to trigger an xray rescan of a Artifactory element. i.e. I want to trigger the exact behavior I see when, via the gui, I navigate to a file, click on the xray tab, and then select "Scan for Violations".

I've got this working via the cli when the content has an associated build using the "jf rt bs" but I have some elements that aren't "attached" to builds.

I've tried using this, but something isn't right with my syntax

curl -X POST "https://XXXXX/xray/api/v1/scanArtifact" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${PASSWD}" \
-d '{
      "repo_key": "my-repo",
      "path": "file/i/want-to-scan"
    }'

I've also tried using "repo-path": "my-repo/file/i/want-to-scan"

Anyone have tips or an example of how to pull this off? There must be a way to trigger this exact behavior.

xray version 3.91.3 Artifactory 7.90.10

Share Improve this question edited 2 days ago Gennadiy Litvinyuk 1,56012 silver badges23 bronze badges asked Feb 5 at 12:57 MattMatt 263 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

The easiest method to pull this off is to use the "componentID" with that api call.

For help figuring out what your component id is, use this link: https://jfrog.com/help/r/xray-rest-apis/component-identifiers

发布评论

评论列表(0)

  1. 暂无评论