harbor_client.PreheatApi

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

MethodHTTP requestDescription
create_instancePOST /p2p/preheat/instancesCreate p2p provider instances
create_policyPOST /projects/{project_name}/preheat/policiesCreate a preheat policy under a project
delete_instanceDELETE /p2p/preheat/instances/{preheat_instance_name}Delete the specified P2P provider instance
delete_policyDELETE /projects/{project_name}/preheat/policies/{preheat_policy_name}Delete a preheat policy
get_executionGET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}Get a execution detail by id
get_instanceGET /p2p/preheat/instances/{preheat_instance_name}Get a P2P provider instance
get_policyGET /projects/{project_name}/preheat/policies/{preheat_policy_name}Get a preheat policy
get_preheat_logGET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks/{task_id}/logsGet the log text stream of the specified task for the given execution
list_executionsGET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executionsList executions for the given policy
list_instancesGET /p2p/preheat/instancesList P2P provider instances
list_policiesGET /projects/{project_name}/preheat/policiesList preheat policies
list_providersGET /p2p/preheat/providersList P2P providers
list_providers_under_projectGET /projects/{project_name}/preheat/providersGet all providers at project level
list_tasksGET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasksList all the related tasks for the given execution
manual_preheatPOST /projects/{project_name}/preheat/policies/{preheat_policy_name}Manual preheat
ping_instancesPOST /p2p/preheat/instances/pingPing status of a instance.
stop_executionPATCH /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}Stop a execution
update_instancePUT /p2p/preheat/instances/{preheat_instance_name}Update the specified P2P provider instance
update_policyPUT /projects/{project_name}/preheat/policies/{preheat_policy_name}Update preheat policy

create_instance

Signature

create_instance(instance: Instance, x_request_id: Optional[str])-> None

Create p2p provider instances

Create p2p provider instances

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.PreheatApi(harbor_client.ApiClient(configuration))
instance = harbor_client.Instance() # Instance | The JSON object of instance.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Create p2p provider instances
    api_instance.create_instance(instance, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->create_instance: %s\n" % e)

Parameters

NameTypeDescriptionNotes
instanceInstanceThe JSON object of instance.
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]

create_policy

Signature

create_policy(project_name: str, policy: PreheatPolicy, x_request_id: Optional[str])-> None

Create a preheat policy under a project

Create a preheat policy under a project

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
policy = harbor_client.PreheatPolicy() # PreheatPolicy | The policy schema info
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Create a preheat policy under a project
    api_instance.create_policy(project_name, policy, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->create_policy: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
policyPreheatPolicyThe policy schema info
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_instance

Signature

delete_instance(preheat_instance_name: str, x_request_id: Optional[str])-> None

Delete the specified P2P provider instance

Delete the specified P2P provider instance

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

try:
    # Delete the specified P2P provider instance
    api_instance.delete_instance(preheat_instance_name, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->delete_instance: %s\n" % e)

Parameters

NameTypeDescriptionNotes
preheat_instance_namestrInstance Name
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_policy

Signature

delete_policy(project_name: str, preheat_policy_name: str, x_request_id: Optional[str])-> None

Delete a preheat policy

Delete a preheat policy

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Delete a preheat policy
    api_instance.delete_policy(project_name, preheat_policy_name, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->delete_policy: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
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_execution

Signature

get_execution(project_name: str, preheat_policy_name: str, execution_id: int, x_request_id: Optional[str])-> Execution

Get a execution detail by id

Get a execution detail by id

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
execution_id = 56 # int | Execution ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get a execution detail by id
    api_response = api_instance.get_execution(project_name, preheat_policy_name, execution_id, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->get_execution: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
execution_idintExecution ID
x_request_idstrAn unique ID for the request[optional]

Return type

Execution

Authorization

basic

HTTP request headers

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

[Back to top]

get_instance

Signature

get_instance(preheat_instance_name: str, x_request_id: Optional[str])-> Instance

Get a P2P provider instance

Get a P2P provider instance

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

try:
    # Get a P2P provider instance
    api_response = api_instance.get_instance(preheat_instance_name, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->get_instance: %s\n" % e)

Parameters

NameTypeDescriptionNotes
preheat_instance_namestrInstance Name
x_request_idstrAn unique ID for the request[optional]

Return type

Instance

Authorization

basic

HTTP request headers

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

[Back to top]

get_policy

Signature

get_policy(project_name: str, preheat_policy_name: str, x_request_id: Optional[str])-> PreheatPolicy

Get a preheat policy

Get a preheat policy

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get a preheat policy
    api_response = api_instance.get_policy(project_name, preheat_policy_name, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->get_policy: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
x_request_idstrAn unique ID for the request[optional]

Return type

PreheatPolicy

Authorization

basic

HTTP request headers

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

[Back to top]

get_preheat_log

Signature

get_preheat_log(project_name: str, preheat_policy_name: str, execution_id: int, task_id: int, x_request_id: Optional[str])-> str

Get the log text stream of the specified task for the given execution

Get the log text stream of the specified task for the given execution

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
execution_id = 56 # int | Execution ID
task_id = 56 # int | Task ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get the log text stream of the specified task for the given execution
    api_response = api_instance.get_preheat_log(project_name, preheat_policy_name, execution_id, task_id, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->get_preheat_log: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
execution_idintExecution ID
task_idintTask ID
x_request_idstrAn unique ID for the request[optional]

Return type

str

Authorization

basic

HTTP request headers

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

[Back to top]

list_executions

Signature

list_executions(project_name: str, preheat_policy_name: str, x_request_id: Optional[str], page: Optional[int], page_size: Optional[int], q: Optional[str], sort: Optional[str])-> list[Execution]

List executions for the given policy

List executions for the given policy

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
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)

try:
    # List executions for the given policy
    api_response = api_instance.list_executions(project_name, preheat_policy_name, x_request_id=x_request_id, page=page, page_size=page_size, q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->list_executions: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
x_request_idstrAn unique ID for the request[optional]
pageintThe page number[optional] [default to 1]
page_sizeintThe size of per page[optional] [default to 10]
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]

Return type

list[Execution]

Authorization

basic

HTTP request headers

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

[Back to top]

list_instances

Signature

list_instances(x_request_id: Optional[str], page: Optional[int], page_size: Optional[int], q: Optional[str], sort: Optional[str])-> list[Instance]

List P2P provider instances

List P2P provider instances

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.PreheatApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
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)

try:
    # List P2P provider instances
    api_response = api_instance.list_instances(x_request_id=x_request_id, page=page, page_size=page_size, q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->list_instances: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]
pageintThe page number[optional] [default to 1]
page_sizeintThe size of per page[optional] [default to 10]
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]

Return type

list[Instance]

Authorization

basic

HTTP request headers

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

[Back to top]

list_policies

Signature

list_policies(project_name: str, x_request_id: Optional[str], page: Optional[int], page_size: Optional[int], q: Optional[str], sort: Optional[str])-> list[PreheatPolicy]

List preheat policies

List preheat policies

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.PreheatApi(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)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
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)

try:
    # List preheat policies
    api_response = api_instance.list_policies(project_name, x_request_id=x_request_id, page=page, page_size=page_size, q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->list_policies: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
x_request_idstrAn unique ID for the request[optional]
pageintThe page number[optional] [default to 1]
page_sizeintThe size of per page[optional] [default to 10]
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]

Return type

list[PreheatPolicy]

Authorization

basic

HTTP request headers

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

[Back to top]

list_providers

Signature

list_providers(x_request_id: Optional[str])-> list[Metadata]

List P2P providers

List P2P providers

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

try:
    # List P2P providers
    api_response = api_instance.list_providers(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->list_providers: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

list[Metadata]

Authorization

basic

HTTP request headers

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

[Back to top]

list_providers_under_project

Signature

list_providers_under_project(project_name: str, x_request_id: Optional[str])-> list[ProviderUnderProject]

Get all providers at project level

Get all providers at project level

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.PreheatApi(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)

try:
    # Get all providers at project level
    api_response = api_instance.list_providers_under_project(project_name, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->list_providers_under_project: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
x_request_idstrAn unique ID for the request[optional]

Return type

list[ProviderUnderProject]

Authorization

basic

HTTP request headers

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

[Back to top]

list_tasks

Signature

list_tasks(project_name: str, preheat_policy_name: str, execution_id: int, x_request_id: Optional[str], page: Optional[int], page_size: Optional[int], q: Optional[str], sort: Optional[str])-> list[Task]

List all the related tasks for the given execution

List all the related tasks for the given execution

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
execution_id = 56 # int | Execution ID
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
page = 1 # int | The page number (optional) (default to 1)
page_size = 10 # int | The size of per page (optional) (default to 10)
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)

try:
    # List all the related tasks for the given execution
    api_response = api_instance.list_tasks(project_name, preheat_policy_name, execution_id, x_request_id=x_request_id, page=page, page_size=page_size, q=q, sort=sort)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PreheatApi->list_tasks: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
execution_idintExecution ID
x_request_idstrAn unique ID for the request[optional]
pageintThe page number[optional] [default to 1]
page_sizeintThe size of per page[optional] [default to 10]
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]

Return type

list[Task]

Authorization

basic

HTTP request headers

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

[Back to top]

manual_preheat

Signature

manual_preheat(project_name: str, preheat_policy_name: str, policy: PreheatPolicy, x_request_id: Optional[str])-> None

Manual preheat

Manual preheat

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
policy = harbor_client.PreheatPolicy() # PreheatPolicy | The policy schema info
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Manual preheat
    api_instance.manual_preheat(project_name, preheat_policy_name, policy, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->manual_preheat: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
policyPreheatPolicyThe policy schema info
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]

ping_instances

Signature

ping_instances(instance: Instance, x_request_id: Optional[str])-> None

Ping status of a instance.

This endpoint checks status of a instance, the instance can be given by ID or Endpoint URL (together with credential)

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.PreheatApi(harbor_client.ApiClient(configuration))
instance = harbor_client.Instance() # Instance | The JSON object of instance.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Ping status of a instance.
    api_instance.ping_instances(instance, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->ping_instances: %s\n" % e)

Parameters

NameTypeDescriptionNotes
instanceInstanceThe JSON object of instance.
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]

stop_execution

Signature

stop_execution(project_name: str, preheat_policy_name: str, execution_id: int, execution: Execution, x_request_id: Optional[str])-> None

Stop a execution

Stop a execution

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
execution_id = 56 # int | Execution ID
execution = harbor_client.Execution() # Execution | The data of execution
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Stop a execution
    api_instance.stop_execution(project_name, preheat_policy_name, execution_id, execution, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->stop_execution: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
execution_idintExecution ID
executionExecutionThe data of execution
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_instance

Signature

update_instance(preheat_instance_name: str, instance: Instance, x_request_id: Optional[str])-> None

Update the specified P2P provider instance

Update the specified P2P provider instance

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.PreheatApi(harbor_client.ApiClient(configuration))
preheat_instance_name = 'preheat_instance_name_example' # str | Instance Name
instance = harbor_client.Instance() # Instance | The instance to update
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Update the specified P2P provider instance
    api_instance.update_instance(preheat_instance_name, instance, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->update_instance: %s\n" % e)

Parameters

NameTypeDescriptionNotes
preheat_instance_namestrInstance Name
instanceInstanceThe instance to update
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_policy

Signature

update_policy(project_name: str, preheat_policy_name: str, policy: PreheatPolicy, x_request_id: Optional[str])-> None

Update preheat policy

Update preheat policy

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.PreheatApi(harbor_client.ApiClient(configuration))
project_name = 'project_name_example' # str | The name of the project
preheat_policy_name = 'preheat_policy_name_example' # str | Preheat Policy Name
policy = harbor_client.PreheatPolicy() # PreheatPolicy | The policy schema info
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Update preheat policy
    api_instance.update_policy(project_name, preheat_policy_name, policy, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling PreheatApi->update_policy: %s\n" % e)

Parameters

NameTypeDescriptionNotes
project_namestrThe name of the project
preheat_policy_namestrPreheat Policy Name
policyPreheatPolicyThe policy schema info
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]