harbor_client.RegistryApi

All URIs are relative to http://localhost/api/v2.0

MethodHTTP requestDescription
create_registryPOST /registriesCreate a registry
delete_registryDELETE /registries/{id}Delete the specific registry
get_registryGET /registries/{id}Get the specific registry
get_registry_infoGET /registries/{id}/infoGet the registry info
list_registriesGET /registriesList the registries
list_registry_provider_infosGET /replication/adapterinfosList all registered registry provider information
list_registry_provider_typesGET /replication/adaptersList registry adapters
ping_registryPOST /registries/pingCheck status of a registry
update_registryPUT /registries/{id}Update the registry

create_registry

Signature

create_registry(registry: Registry, x_request_id: Optional[str])-> None

Create a registry

Create a registry

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
registry = harbor_client.Registry() # Registry | The registry
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Create a registry
    api_instance.create_registry(registry, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling RegistryApi->create_registry: %s\n" % e)

Parameters

NameTypeDescriptionNotes
registryRegistryThe registry
x_request_idstrAn unique ID for the request[optional]

Return type

void (empty response body)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

delete_registry

Signature

delete_registry(id: int, x_request_id: Optional[str])-> None

Delete the specific registry

Delete the specific registry

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
id = 789 # int | Registry ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Delete the specific registry
    api_instance.delete_registry(id, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling RegistryApi->delete_registry: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idintRegistry ID
x_request_idstrAn unique ID for the request[optional]

Return type

void (empty response body)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

get_registry

Signature

get_registry(id: int, x_request_id: Optional[str])-> Registry

Get the specific registry

Get the specific registry

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
id = 789 # int | Registry ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get the specific registry
    api_response = api_instance.get_registry(id, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RegistryApi->get_registry: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idintRegistry ID
x_request_idstrAn unique ID for the request[optional]

Return type

Registry

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

get_registry_info

Signature

get_registry_info(id: int, x_request_id: Optional[str])-> RegistryInfo

Get the registry info

Get the registry info

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
id = 789 # int | Registry ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get the registry info
    api_response = api_instance.get_registry_info(id, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RegistryApi->get_registry_info: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idintRegistry ID
x_request_idstrAn unique ID for the request[optional]

Return type

RegistryInfo

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

list_registries

Signature

list_registries(x_request_id: Optional[str], q: Optional[str], sort: Optional[str], page: Optional[int], page_size: Optional[int], name: Optional[str])-> list[Registry]

List the registries

List the registries

Example

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.RegistryApi(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)
name = 'name_example' # str | Deprecated, use `q` instead. (optional)

try:
    # List the registries
    api_response = api_instance.list_registries(x_request_id=x_request_id, q=q, sort=sort, page=page, page_size=page_size, name=name)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RegistryApi->list_registries: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]
qstrQuery 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]
sortstrSort 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]
pageintThe page number[optional] [default to 1]
page_sizeintThe size of per page[optional] [default to 10]
namestrDeprecated, use `q` instead.[optional]

Return type

list[Registry]

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

list_registry_provider_infos

Signature

list_registry_provider_infos(x_request_id: Optional[str])-> dict(str, RegistryProviderInfo)

List all registered registry provider information

List all registered registry provider information

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # List all registered registry provider information
    api_response = api_instance.list_registry_provider_infos(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RegistryApi->list_registry_provider_infos: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

dict(str, RegistryProviderInfo)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

list_registry_provider_types

Signature

list_registry_provider_types(x_request_id: Optional[str])-> list[str]

List registry adapters

List registry adapters

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # List registry adapters
    api_response = api_instance.list_registry_provider_types(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling RegistryApi->list_registry_provider_types: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

list[str]

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

ping_registry

Signature

ping_registry(registry: RegistryPing, x_request_id: Optional[str])-> None

Check status of a registry

Check status of a registry

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
registry = harbor_client.RegistryPing() # RegistryPing | The registry
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Check status of a registry
    api_instance.ping_registry(registry, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling RegistryApi->ping_registry: %s\n" % e)

Parameters

NameTypeDescriptionNotes
registryRegistryPingThe registry
x_request_idstrAn unique ID for the request[optional]

Return type

void (empty response body)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]

update_registry

Signature

update_registry(id: int, registry: RegistryUpdate, x_request_id: Optional[str])-> None

Update the registry

Update the registry

Example

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.RegistryApi(harbor_client.ApiClient(configuration))
id = 789 # int | The registry ID
registry = harbor_client.RegistryUpdate() # RegistryUpdate | The registry
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Update the registry
    api_instance.update_registry(id, registry, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling RegistryApi->update_registry: %s\n" % e)

Parameters

NameTypeDescriptionNotes
idintThe registry ID
registryRegistryUpdateThe registry
x_request_idstrAn unique ID for the request[optional]

Return type

void (empty response body)

Authorization

basic

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top]