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