1.Harbor api版本

2.删除镜像方法

3.查看reference方法
curl -u admin:Harbor12345 -X GET "https://xxxxx/api/v2.0/projects/项目名字/repositories/镜像名字/artifacts?page=1&page_size=1&with_tag=true&with_label=false&with_scan_overview=false&with_signature=false&with_immutable_status=false" | sed 's/,/\n/g' | grep digest | awk -F '"' '{print $4}'
4.执行删除命令
curl  -u "admin:Harbor12345" -X DELETE "https://xxxxx/api/v2.0/projects/项目名字/repositories/镜像名字/artifacts/sha256:4d8a95c65a0646f329c8749ef4ffd58839a60be042feeb3ba9200dce28a1b7d7"
5.获取上传的第一个镜像的tag
curl -L -u admin:Harbor12345 -sS  --max-time 30 --connect-timeout 60 --retry 300 --retry-delay 100  "xxxxx/api/v2.0/projects/项目名字/repositories/镜像名字/artifacts?page=1&page_size=1&with_tag=true&with_label=false&with_scan_overview=false&with_signature=false&with_immutable_status=false" -H  "Expect:" |  sed \'s/,/\\n/g\' |  grep "none" | awk -F \':\' \'{print $2}\' | sed \'s/"//g\'`

Logo

新一代开源开发者平台 GitCode,通过集成代码托管服务、代码仓库以及可信赖的开源组件库,让开发者可以在云端进行代码托管和开发。旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐