mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-26 10:38:00 +01:00
302d5c4073
* Correctly specify dependency packages Include the requests package as part of setup.py, so pip will download and install it as a dependency. * Update URLs to point to main harbor git repo harbor-py was moved to the main harbor git repo in July 2016 but the URLs still point to the deprecated repository.
2.3 KiB
2.3 KiB
Introduction
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 contrib/sdk/harbor-py
.
The supported APIs are:
- Projects APIs
- Get projects
- Create project
- Check project exist
- Set project publicity
- Get project id from name
- Get project access logs
- Get project member
- Get project and user member
- Users APIs
- Repositories APIs
- Others APIs
Installation
pip install harbor-py
Usage
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.
Contribution
If you have suggestions, feel free to submit issues or send pull-requests for harbor-py
.
Publish harbor-py
package to pypi server with the following commands.
python setup.py register -r pypi
python setup.py sdist upload -r pypi