(二十)VMware Harbor - API
可以用swagger在线解析
http://editor.swagger.io/
将swagger.yaml中的内容拷贝到里面即可。
官方文档说明链接如下:
https://github.com/vmware/harbor/blob/master/docs/configure_swagger.md
1. 健康检查
curl -X GET "http://172.25.65.126:8000/api/health" -H "accept: application/json"
2. 根据项目名查询
curl -X GET "http://172.25.65.126:8000/api/search?q=sx628" -H "accept: application/json"
3. 根据拥有者,是否公开查询项目
curl -X GET "http://172.25.65.126:8000/api/projects?name=sx628&public=true&owner=test01" -H "accept: application/json"
4. 查询项目名是否存在
curl -X HEAD "http://172.25.65.126:8000/api/projects?project_name=sx62811" -H "accept: application/json"
5. 新建一个项目
curl -X POST "http://172.25.65.126:8000/api/projects" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"project_name\": \"test073\", \"metadata\": { \"public\": \"true\", \"enable_content_trust\": \"string\", \"prevent_vul\": \"string\", \"severity\": \"string\", \"auto_scan\": \"string\" }}"
6. 获取当前用户
curl -X GET "http://172.25.65.126:8000/api/users/current" -H "accept: application/json"
7. 获取镜像
curl -X GET "http://172.25.65.126:8000/api/search?q=sx628" -H "accept: application/json"
{
"project": [
{
"project_id": 3,
"owner_id": 3,
"name": "sx628",
"creation_time": "2019-06-28T08:36:40Z",
"update_time": "2019-06-28T08:36:40Z",
"deleted": false,
"owner_name": "",
"togglable": true,
"current_user_role_id": 0,
"repo_count": 2,
"chart_count": 0,
"metadata": {
"auto_scan": "false",
"enable_content_trust": "false",
"prevent_vul": "false",
"public": "false",
"severity": "low"
}
}
],
"repository": [
{
"project_id": 3,
"project_name": "sx628",
"project_public": false,
"pull_count": 18,
"repository_name": "sx628/harbor",
"tags_count": 1
},
{
"project_id": 3,
"project_name": "sx628",
"project_public": false,
"pull_count": 6,
"repository_name": "sx628/nginx",
"tags_count": 1
}
]
}
8. 根据用户名,用户邮箱获取
curl -X GET "http://172.25.65.126:8000/api/users/search?username=test02&email=test02%40163.com" -H "accept: application/json"
9. 根据用户id 获取用户的详细信息
curl -X GET "http://172.25.65.126:8000/api/users/3" -H "accept: application/json"
10. 查询用户拥有的项目
curl -X GET "http://172.25.65.126:8000/api/projects?owner=test01" -H "accept: application/json"
[
{
"project_id": 2,
"owner_id": 3,
"name": "test01",
"creation_time": "2019-06-28T05:58:47Z",
"update_time": "2019-06-28T05:58:47Z",
"deleted": false,
"owner_name": "",
"togglable": true,
"current_user_role_id": 0,
"repo_count": 0,
"chart_count": 0,
"metadata": {
"public": "false"
}
},
{
"project_id": 3,
"owner_id": 3,
"name": "sx628",
"creation_time": "2019-06-28T08:36:40Z",
"update_time": "2019-06-28T08:36:40Z",
"deleted": false,
"owner_name": "",
"togglable": true,
"current_user_role_id": 0,
"repo_count": 2,
"chart_count": 0,
"metadata": {
"auto_scan": "false",
"enable_content_trust": "false",
"prevent_vul": "false",
"public": "false",
"severity": "low"
}
}
]
11 . 根据项目ID,查询成员信息
curl -X GET "http://172.25.65.126:8000/api/projects/3/members" -H "accept: application/json"
[
{
"id": 4,
"project_id": 3,
"entity_name": "test01",
"role_name": "projectAdmin",
"role_id": 1,
"entity_id": 3,
"entity_type": "u"
},
{
"id": 8,
"project_id": 3,
"entity_name": "test02",
"role_name": "developer",
"role_id": 2,
"entity_id": 4,
"entity_type": "u"
},
{
"id": 6,
"project_id": 3,
"entity_name": "test04",
"role_name": "guest",
"role_id": 3,
"entity_id": 5,
"entity_type": "u"
}
]
12. 获取仓库
curl -X GET "http://172.25.65.126:8000/api/registries" -H "accept: application/json"
[
{
"id": 1,
"name": "kuai-test",
"description": "test",
"type": "harbor",
"url": "http://172.25.58.1:8000",
"token_service_url": "",
"credential": {
"type": "basic",
"access_key": "admin",
"access_secret": "*****"
},
"insecure": false,
"status": "healthy",
"creation_time": "2019-06-28T02:45:51.89703Z",
"update_time": "2019-07-03T08:33:17.570053Z"
}
]
13. 查询标签:全局:G,项目:P
curl -X GET "http://172.25.65.126:8000/api/labels?scope=g" -H "accept: application/json"
[
{
"id": 4,
"name": "dev",
"description": "开发环境",
"color": "#0065AB",
"scope": "g",
"project_id": 0,
"creation_time": "2019-07-01T01:57:04.194757Z",
"update_time": "2019-07-01T01:57:04.194757Z",
"deleted": false
},
{
"id": 5,
"name": "pro",
"description": "生产环境",
"color": "#C92100",
"scope": "g",
"project_id": 0,
"creation_time": "2019-07-01T02:14:33.467617Z",
"update_time": "2019-07-01T02:14:33.467617Z",
"deleted": false
},
{
"id": 3,
"name": "test",
"description": "测试环境",
"color": "#781DA0",
"scope": "g",
"project_id": 0,
"creation_time": "2019-07-01T01:56:46.204878Z",
"update_time": "2019-07-01T01:56:46.204878Z",
"deleted": false
}
]
14. 查询LDAP分组
curl -X GET "http://172.25.65.126:8000/api/ldap/groups/search" -H "accept: application/json"
(二十)VMware Harbor - API的更多相关文章
- (二)VMware Harbor 安装
转自:https://blog.csdn.net/qq_33633013/article/details/82217277 一.环境.软件准备 harbor 需要依赖docker,compose工具, ...
- VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池
VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池 在上一节我们创建了完整克隆的自动专有桌面池,在创建过程比较缓慢,这次我们将学习创建Vi ...
- VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management
VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management 实验失败告终,启动VMware View Persona Management服务报10 ...
- (十九)VMware Harbor 详细介绍
一 . 简介 Harbor是VMware公司开源的企业级DockerRegistry项目,项目地址为https://github.com/vmware/harbor.其目标是帮助用户迅速搭建一个企业级 ...
- VMware vSphere 服务器虚拟化之二十五 桌面虚拟化之终端服务池
VMware vSphere 服务器虚拟化之二十五 桌面虚拟化之终端服务池 终端服务池是指由一台或多台微软终端服务器提供服务的桌面源组成的池.终端服务器桌面源可交付多个桌面.它具有以下特征: 1.终端 ...
- VMware vSphere 服务器虚拟化之二十八 桌面虚拟化之安装View传输服务器
VMware vSphere 服务器虚拟化之二十八 桌面虚拟化之安装View传输服务器 View 传输服务器用于管理和简化数据中心与在最终用户本地系统上检出使用的 View 桌面之间的数据传输.必须安 ...
- VMware vSphere 服务器虚拟化之二十四 桌面虚拟化之手动池管理物理机
VMware vSphere 服务器虚拟化之二十四 桌面虚拟化之手动池管理物理机 VMwareView手动池可以管理物理计算机 说明: 环境基于实验二十三 1.准备一台Windows 7的物理计算机名 ...
- VMware vSphere 服务器虚拟化之二十 桌面虚拟化之准备虚拟桌面模版
VMware vSphere服务器虚拟化之二十 桌面虚拟化之准备虚拟桌面模版 在虚拟桌面的部署中,我们必须准备好作为桌面模板的父映像,通过父映像使用完整克隆或者View Composer的链接克隆,创 ...
- 转:ArcGIS API For JavaScript官方文档(二十)之图形和要素图层——①Graphics概述
原文地址:ArcGIS API For JavaScript官方文档(二十)之图形和要素图层——①Graphics概述 ArcGIS JavaScript API允许在地图上绘制graphic(图形) ...
随机推荐
- el-input输入框的readonly属性
readonly属性是Boolean类型,默认值为false.readonly值为true表示只读. <el-col :span="12"> <el-form-i ...
- Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column
Error: javax.servlet.ServletException: java.sql.SQLSyntaxErrorException: Expression #4 of SELECT lis ...
- wxWidgets源码分析(1) - App启动过程
目录 APP启动过程 wxApp入口定义 wxApp实例化准备 wxApp的实例化 wxApp运行 总结 APP启动过程 本文主要介绍wxWidgets应用程序的启动过程,从app.cpp入手. wx ...
- ElasticSearch 集群安全
公号:码农充电站pro 主页:https://codeshellme.github.io 在安装完 ES 后,ES 默认是没有任何安全防护的. ES 的安全管理主要包括以下内容: 身份认证:鉴定访问用 ...
- 记录 Allsec 解题过程
开局打开URL:http://119.3.191.245:65532/#/allsecPlayGame,前去做游戏 游戏URL:http://119.3.191.245:8877/Login.php ...
- idea配置struts2.5环境
struts2不是struts1的下一代产品,是在struts1和WebWork技术的基础上进行合并后的全新框架,虽然两个名字相似,但是设计思想却有很大的不同. 使用本地的l ib 或者downloa ...
- Linux普通用户安装配置mysql(非root权限)
Linux普通用户安装配置mysql(非root权限) 说明:在实际工作中,公司内网的机器我们一般没有root权限,也没有连网,最近参考网上的资料使用一般的账户成功安装mysql,记录如下 Linux ...
- 09、集合set
集合(set) 集合是一个无序.可变.不允许数据重复的容器 s = {11,22,33,'ccc'} 无序,无法通过索引取值 可变,可以添加和删除元素 s = {11,22,33,44} s.add( ...
- 【odoo14】第二十一章、性能优化
通过odoo框架,我们可以开发大型且复杂的应用.良好的性能是实现这一目标的基础.本章,我们将探讨如何提高应用性能.同时,我们也会讲解找出影响性能的因素. 本章包含以下内容: 记录集的预读取模式 将数据 ...
- 浅析MyBatis(二):手写一个自己的MyBatis简单框架
在上一篇文章中,我们由一个快速案例剖析了 MyBatis 的整体架构与整体运行流程,在本篇文章中笔者会根据 MyBatis 的运行流程手写一个自定义 MyBatis 简单框架,在实践中加深对 MyBa ...