本脚本来源于harbor-py 有修改，在harbor 1.5测试可用
harbor is the enterprise-class registry server for docker distribution.
harbor-py is the native and compatible python SDK for harbor and is included in the harbor git repository under
The supported APIs are:
- Projects APIs
- Users APIs
- Repositories APIs
- Others APIs
pip install harbor-py
from harborclient import harborclient host = "127.0.0.1" user = "admin" password = "Harbor12345" client = harborclient.HarborClient(host, user, password) client.get_projects() client.get_users() client.get_statistics() client.get_top_accessed_repositories() client.search("library")
For more usage, please refer to the examples.
If you have suggestions, feel free to submit issues or send pull-requests for
harbor-py package to pypi server with the following commands.
python setup.py register -r pypi python setup.py sdist upload -r pypi