All URIs are relative to http://localhost/api/v2.0
Method | HTTP request | Description |
---|---|---|
delete_repository | DELETE /projects/{project_name}/repositories/{repository_name} | Delete repository |
get_repository | GET /projects/{project_name}/repositories/{repository_name} | Get repository |
list_all_repositories | GET /repositories | List all authorized repositories |
list_repositories | GET /projects/{project_name}/repositories | List repositories |
update_repository | PUT /projects/{project_name}/repositories/{repository_name} | Update repository |
delete_repository(project_name: str, repository_name: str, x_request_id: Optional[str])-> None
Delete repository
Delete the repository specified by name
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.RepositoryApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
repository_name = 'repository_name_example' # str | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Delete repository
api_instance.delete_repository(project_name, repository_name, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling RepositoryApi->delete_repository: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_name | str | The name of the project | |
repository_name | str | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb | |
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
get_repository(project_name: str, repository_name: str, x_request_id: Optional[str])-> Repository
Get repository
Get the repository specified by name
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.RepositoryApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
repository_name = 'repository_name_example' # str | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Get repository
api_response = api_instance.get_repository(project_name, repository_name, x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling RepositoryApi->get_repository: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_name | str | The name of the project | |
repository_name | str | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb | |
x_request_id | str | An unique ID for the request | [optional] |
list_all_repositories(x_request_id: Optional[str], q: Optional[str], sort: Optional[str], page: Optional[int], page_size: Optional[int])-> list[Repository]
List all authorized repositories
List all authorized repositories
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.RepositoryApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
q = 'q_example' # str | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] (optional)
sort = 'sort_example' # str | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
try:
# List all authorized repositories
api_response = api_instance.list_all_repositories(x_request_id=x_request_id, q=q, sort=sort, page=page, page_size=page_size)
pprint(api_response)
except ApiException as e:
print("Exception when calling RepositoryApi->list_all_repositories: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | An unique ID for the request | [optional] |
q | str | Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] |
sort | str | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2" | [optional] |
page | int | The page number | [optional] [default to 1] |
page_size | int | The size of per page | [optional] [default to 10] |
list_repositories(project_name: str, x_request_id: Optional[str], q: Optional[str], sort: Optional[str], page: Optional[int], page_size: Optional[int])-> list[Repository]
List repositories
List repositories of the specified project
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.RepositoryApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
q = 'q_example' # str | Query string to query resources. Supported query patterns are \"exact match(k=v)\", \"fuzzy match(k=~v)\", \"range(k=[min~max])\", \"list with union releationship(k={v1 v2 v3})\" and \"list with intersetion relationship(k=(v1 v2 v3))\". The value of range and list can be string(enclosed by \" or '), integer or time(in format \"2020-04-09 02:36:00\"). All of these query patterns should be put in the query string \"q=xxx\" and splitted by \",\". e.g. q=k1=v1,k2=~v2,k3=[min~max] (optional)
sort = 'sort_example' # str | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with \"sort=field1,-field2\" (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
try:
# List repositories
api_response = api_instance.list_repositories(project_name, x_request_id=x_request_id, q=q, sort=sort, page=page, page_size=page_size)
pprint(api_response)
except ApiException as e:
print("Exception when calling RepositoryApi->list_repositories: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_name | str | The name of the project | |
x_request_id | str | An unique ID for the request | [optional] |
q | str | Query string to query resources. Supported query patterns are "exact match(k=v)", "fuzzy match(k=~v)", "range(k=[min~max])", "list with union releationship(k={v1 v2 v3})" and "list with intersetion relationship(k=(v1 v2 v3))". The value of range and list can be string(enclosed by " or '), integer or time(in format "2020-04-09 02:36:00"). All of these query patterns should be put in the query string "q=xxx" and splitted by ",". e.g. q=k1=v1,k2=~v2,k3=[min~max] | [optional] |
sort | str | Sort the resource list in ascending or descending order. e.g. sort by field1 in ascending orderr and field2 in descending order with "sort=field1,-field2" | [optional] |
page | int | The page number | [optional] [default to 1] |
page_size | int | The size of per page | [optional] [default to 10] |
update_repository(project_name: str, repository_name: str, repository: Repository, x_request_id: Optional[str])-> None
Update repository
Update the repository specified by name
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor_client.RepositoryApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
repository_name = 'repository_name_example' # str | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb
repository = harbor_client.Repository() # Repository | The JSON object of repository.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Update repository
api_instance.update_repository(project_name, repository_name, repository, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling RepositoryApi->update_repository: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
project_name | str | The name of the project | |
repository_name | str | The name of the repository. If it contains slash, encode it with URL encoding. e.g. a/b -> a%252Fb | |
repository | Repository | The JSON object of repository. | |
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)