可以用swagger在线解析
http://editor.swagger.io/ 将swagger.yaml中的内容拷贝到里面即可。
官方文档说明链接如下:
https://github.com/vmware/harbor/blob/master/docs/configure_swagger.md
curl -X GET "http://172.25.65.126:8000/api/health" -H "accept: application/json"
Search for projects, repositories and helm charts
curl -X GET "http://172.25.65.126:8000/api/search?q=sx628" -H "accept: application/json"
curl -X GET "http://172.25.65.126:8000/api/projects?name=sx628&public=true&owner=test01" -H "accept: application/json"
curl -X HEAD "http://172.25.65.126:8000/api/projects?project_name=sx62811" -H "accept: application/json"
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\" }}"
curl -X GET "http://172.25.65.126:8000/api/users/current" -H "accept: application/json"
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
}
]
}
curl -X GET "http://172.25.65.126:8000/api/users/search?username=test02&email=test02%40163.com" -H "accept: application/json"
curl -X GET "http://172.25.65.126:8000/api/users/3" -H "accept: application/json"
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"
}
}
]
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"
}
]
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"
}
]
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
}
]
curl -X GET "http://172.25.65.126:8000/api/ldap/groups/search" -H "accept: application/json"
手机扫一扫
移动阅读更方便
你可能感兴趣的文章