项目管理
查看仓库中项目详细信息
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/projects/{project_id}" |
搜索镜像
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/search?q=nginx" |
删除项目
1 | curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "https://192.168.183.129/api/projects/{project_id}" |
创建项目
1 | curl -u "admin:Harbor12345" -X POST -H "Content-Type: application/json" "https://192.168.183.129/api/projects" -d @createproject.json |
查看项目日志
1 | curl -u "admin:Harbor12345" -X POST -H "Content-Type: application/json" "https://192.168.183.129/api/projects/{project_id}/logs/filter" -d @log.json |
账号管理
创建账号
1 | curl -u "admin:Harbor12345" -X POST -H "Content-Type: application/json" "https://192.168.183.129/api/users" -d @user.json |
获取用户信息
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/users" |
获取当前用户信息
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/users/current" |
删除用户
1 | curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "https://192.168.183.129/api/users/{user_id}" |
修改用户密码
1 | curl -u "admin:Harbor12345" -X PUT -H "Content-Type: application/json" "https://192.168.183.129/api/users/{user_id}/password" -d @uppwd.json |
用户权限管理
查看项目相关角色
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/projects/{project_id}/members/" |
项目添加角色
1 | curl -u "jaymarco:Harbor123456" -X POST -H "Content-Type: application/json" "https://192.168.183.129/api/projects/{project_id}/members/" -d @role.json |
用jaymarco用户创建一个snc_dcos项目,并对snc_dcos加一个权限1
curl -u "jaymarco:Harbor123456" -X POST -H "Content-Type: application/json" "https://192.168.183.129/api/projects" -d @createproject.json
删除项目中用户权限
1 | curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "https://192.168.183.129/api/projects/{project_id}/members/{user_id}" |
获取与用户相关的项目编号和存储库编号
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/statistics" |
修改当前用户角色
1 | has_admin_role :0 普通用户 |
镜像管理
查询镜像
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/repositories?project_id={project_id}&q=dcos%2Fcentos" |
删除镜像
1 | curl -u "admin:Harbor12345" -X DELETE -H "Content-Type: application/json" "https://192.168.183.129/api/repositories?repo_name=dcos%2Fetcd " |
获取镜像标签
1 | curl -u "admin:Harbor12345" -X GET -H "Content-Type: application/json" "https://192.168.183.129/api/repositories/tags?repo_name=dcos%2Fcentos" |