Harbor API調用
1、獲取鏡像倉庫名字
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://10.0.0.14/api/search?" --insecure
2、獲取鏡像標簽
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://10.0.0.14/api/repositories/tags?repo_name=library%2Fmysql"
3、對鏡像標簽進行排序,並補充完整鏡像名稱
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "http://10.0.0.14/api/repositories/tags?repo_name=library%front-end"|sort -n -t _ -k 2 |sed 's#"##g'|sed 's#,##g'|sed 's# ##g'|awk '{print "library/sephora-mp-backend:"$1}'
4、刪除鏡像標簽
curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "http://10.0.0.14/api/repositories?repo_name=library%2Fblackicebird-2048&tag=v2"