问题描述
我正在使用 Xray post API 进行工件扫描
https://artifacts.org/xray/api/v1/scanArtifact
作为回应,我得到以下
{
"info": "Scan of artifact is in progress"
}
我如何获得此扫描的结果,是否有用于此的 API?
解决方法
您可以使用下面的 api 来获取 am artifact 的 Xray Scan 结果:
https://artifacts-company.org/artifactory/ui/artifactxray?path=hello-world/v1/manifest.json&repoKey=my-local-repository
这将返回以下响应:
{
"xrayIndexStatus": "High","xrayIndexStatusLastUpdatedTimestamp": "15-01-21 08:24:23 +00:00","xrayBlocked": false,"xrayBlockReason": "","detailsUrl": "https://artifacts-company.org/web/#/component/details/docker:~2F~2Fhello-world"
}
然后您可以使用字段 xrayIndexStatus 获取扫描状态作为结果。