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 badges1 Answer
Reset to default 0The 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