Harbor api 操作
2021-07-05 19:05
标签:ica load 镜像 data content download http code 操作 通过浏览器访问 http://192.168.0.241/static/vendors/swagger/index.html Harbor api 操作 标签:ica load 镜像 data content download http code 操作 原文地址:https://www.cnblogs.com/klvchen/p/9815073.html为 Harbor 配置 swagger
cd /iba/software/harbor
wget https://raw.githubusercontent.com/goharbor/harbor/master/docs/prepare-swagger.sh https://raw.githubusercontent.com/goharbor/harbor/master/docs/swagger.yaml
vi prepare-swagger.sh
#修改 SERVER_IP
SERVER_IP=192.168.0.241
chmod +x prepare-swagger.sh
./prepare-swagger.sh
vi docker-compose.yml
# 在 - /data/ca_download/:/etc/ui/ca/:z 后添加下面两行
- ../src/ui/static/vendors/swagger-ui-2.1.4/dist:/harbor/static/vendors/swagger
- ../src/ui/static/resources/yaml/swagger.yaml:/harbor/static/resources/yaml/swagger.yaml
docker-compose down -v && docker-compose up -d
# 获取镜像
curl -X GET --header ‘Accept: application/json‘ ‘http://192.168.0.241/api/search?q=library‘
#获取镜像仓库的 tags
curl -X GET --header ‘Accept: application/json‘ ‘http://192.168.0.241/api/repositories/library%2Ftomcat/tags‘
#删除镜像仓库的 tags
curl -X DELETE --header ‘Accept: text/plain‘ ‘http://192.168.0.241/api/repositories/library%2Ftomcat/tags/9-jre11‘