Harbor Api調用


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"


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM