针对harbor 2.0版本
1.获取project
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://harbor-wchscu.xxx.cn/api/v2.0/projects/"
2.创建project
curl -u "admin:Harbor12345" -X POST -H "Content-Type: application/json" "https://harbor-wchscu.xxx.cn/api/v2.0/projects/" -d {"project_name": "kube"}
curl -u "admin:Harbor12345" -X POST -H "Content-Type: application/json" "https://harbor-wchscu.xxx.cn/api/v2.0/projects/" -d@createrepo.json
cat createrepo.json
{
"project_name": "kube"
}
3.获取project
curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://harbor-wchscu.xxx.cn/api/v2.0/projects/{project_id}"