curl -s -u xxx:yyy -X GET "https://hub.jundax.com/api/v2.0/projects/houchu/repositories/omt-as/artifacts?page=1&page_size=5&with_tag=true&with_label=false&with_scan_overview=false&with_signature=false&with_immutable_status=false" -H "accept: application/json"|sed 's/,/\n/g'|awk -F ':' '/name/{gsub(/"/,"",$2);print $2}'
其中 -u 后面 xxx为harbor登录用户名,yyy为harbor登录密码,命令打印出最新的5个标签
通过habor 2.0 api删除artifacts(构件)
for i in `latest_image.sh omt-as 1000|tail -n 650`;do curl -s -u user:password-X DELETE "https://hub.jundax.com/api/v2.0/projects/houchu/repositories/omt-as/artifacts/$i" -H "accept: application/json"; done
harbor打印出项目名称
curl -s -u user:password -H "Content-Type: application/json" -X GET https://hub.jundax.com/api/v2.0/projects? -k|grep -Po '(?<="name":).*'|awk '{gsub(/[",]/,"",$0);print}'
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!