可以用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. 根据项目名查询

Search for projects, repositories and helm charts
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的更多相关文章

  1. (二)VMware Harbor 安装

    转自:https://blog.csdn.net/qq_33633013/article/details/82217277 一.环境.软件准备 harbor 需要依赖docker,compose工具, ...

  2. VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池

    VMware vSphere 服务器虚拟化之二十二桌面虚拟化之创建View Composer链接克隆的虚拟桌面池 在上一节我们创建了完整克隆的自动专有桌面池,在创建过程比较缓慢,这次我们将学习创建Vi ...

  3. VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management

    VMware vSphere 服务器虚拟化之二十六 桌面虚拟化之View Persona Management 实验失败告终,启动VMware View Persona Management服务报10 ...

  4. (十九)VMware Harbor 详细介绍

    一 . 简介 Harbor是VMware公司开源的企业级DockerRegistry项目,项目地址为https://github.com/vmware/harbor.其目标是帮助用户迅速搭建一个企业级 ...

  5. VMware vSphere 服务器虚拟化之二十五 桌面虚拟化之终端服务池

    VMware vSphere 服务器虚拟化之二十五 桌面虚拟化之终端服务池 终端服务池是指由一台或多台微软终端服务器提供服务的桌面源组成的池.终端服务器桌面源可交付多个桌面.它具有以下特征: 1.终端 ...

  6. VMware vSphere 服务器虚拟化之二十八 桌面虚拟化之安装View传输服务器

    VMware vSphere 服务器虚拟化之二十八 桌面虚拟化之安装View传输服务器 View 传输服务器用于管理和简化数据中心与在最终用户本地系统上检出使用的 View 桌面之间的数据传输.必须安 ...

  7. VMware vSphere 服务器虚拟化之二十四 桌面虚拟化之手动池管理物理机

    VMware vSphere 服务器虚拟化之二十四 桌面虚拟化之手动池管理物理机 VMwareView手动池可以管理物理计算机 说明: 环境基于实验二十三 1.准备一台Windows 7的物理计算机名 ...

  8. VMware vSphere 服务器虚拟化之二十 桌面虚拟化之准备虚拟桌面模版

    VMware vSphere服务器虚拟化之二十 桌面虚拟化之准备虚拟桌面模版 在虚拟桌面的部署中,我们必须准备好作为桌面模板的父映像,通过父映像使用完整克隆或者View Composer的链接克隆,创 ...

  9. 转:ArcGIS API For JavaScript官方文档(二十)之图形和要素图层——①Graphics概述

    原文地址:ArcGIS API For JavaScript官方文档(二十)之图形和要素图层——①Graphics概述 ArcGIS JavaScript API允许在地图上绘制graphic(图形) ...

随机推荐

  1. SpringBoot Admin应用监控搭建

    简介 Spring Boot Admin 用于监控基于 Spring Boot 的应用,它是在 Spring Boot Actuator 的基础上提供简洁的可视化 WEB UI. 参考手册地址:htt ...

  2. EFCodeFirst Migrations数据库迁移

    EFCodeFirst Migrations数据库迁移 数据库迁移 1.生成数据库 修改类文件PortalContext.cs的静态构造函数,取消当数据库模型发生改变时删除当前数据库重建新数据库的设置 ...

  3. 迭代器 (Iterator) 和 生成器 (Generator)

    其他章节请看: es6 快速入门 系列 迭代器 (Iterator) 和 生成器 (Generator) 试图解决的问题 let colors = ['red', 'blue', 'green', ' ...

  4. powerdesigner 16.6破解版下载,支持hive,数据模型hql导出

    powerdesigner 16是一款业内领先的建模工具,是一款开发人员常用的数据库建模工具. 在大数据数据仓库建设过程中,离线数仓往往以hive为基础,但数仓建模过程中老版本不支持hive,这个模型 ...

  5. .NET CORE 3.1 MVC Log4net

    1 引用包:Microsoft.Extensions.Logging.Log4Net.AspNetCore   2 ILoggerFactory loggerFactory 注册 public voi ...

  6. PTA1071 - Speech Patterns - map计算不同单词个数

    题意 输出给定字符串出现最多的字符串(小写输出)和出现次数. 所求字符串要求:字符中可以含有A-Z.0-9. 比如说题目给出的Can1,我们可以转换成can1,can1就算一个字符串整体,而不是单独的 ...

  7. 第三方API接口测试问题反馈文档

    大家在给甲方做大型项目的时候,有时候参与的厂商比较多,而公司负责的部分又需要第三方厂商提供接口支持. 例如我们做医疗行业的,给医院提供医保控费系统服务的,就需要HIS厂商提供接口给我们采集数据.有时候 ...

  8. 2019 GDUT Rating Contest II : Problem C. Rest Stops

    题面: C. Rest Stops Input file: standard input Output file: standard output Time limit: 1 second Memory ...

  9. 最权威最简明的maven 使用教程

    Maven是一个项目管理工具,它包含了一个项目对象模型 (Project Object Model),一组标准集合,一个项目生命周期(Project Lifecycle),一个依赖管理系统(Depen ...

  10. 前端性能监控之performance

    如果我们想要对一个网页进行性能监控,那么使用window.performance是一个比较好的选择. 我们通过window.performance可以获取到用户访问一个页面的每个阶段的精确时间,从而对 ...