harbor_client.JobserviceApi

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

MethodHTTP requestDescription
action_pending_jobsPUT /jobservice/queues/{job_type}stop and clean, pause, resume pending jobs in the queue
get_worker_poolsGET /jobservice/poolsGet worker pools
get_workersGET /jobservice/pools/{pool_id}/workersGet workers
list_job_queuesGET /jobservice/queueslist job queues
stop_running_jobPUT /jobservice/jobs/{job_id}Stop running job

action_pending_jobs

Signature

action_pending_jobs(job_type: str, action_request: ActionRequest, x_request_id: Optional[str])-> None

stop and clean, pause, resume pending jobs in the queue

stop and clean, pause, resume pending jobs in the queue

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.JobserviceApi(harbor_client.ApiClient(configuration))
job_type = 'job_type_example' # str | The type of the job. 'all' stands for all job types
action_request = harbor_client.ActionRequest() # ActionRequest | 
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # stop and clean, pause, resume pending jobs in the queue
    api_instance.action_pending_jobs(job_type, action_request, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling JobserviceApi->action_pending_jobs: %s\n" % e)

Parameters

NameTypeDescriptionNotes
job_typestrThe type of the job. 'all' stands for all job types
action_requestActionRequest
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_worker_pools

Signature

get_worker_pools(x_request_id: Optional[str])-> list[WorkerPool]

Get worker pools

Get worker pools

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

try:
    # Get worker pools
    api_response = api_instance.get_worker_pools(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobserviceApi->get_worker_pools: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

list[WorkerPool]

Authorization

basic

HTTP request headers

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

[Back to top]

get_workers

Signature

get_workers(pool_id: str, x_request_id: Optional[str])-> list[Worker]

Get workers

Get workers in current pool

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.JobserviceApi(harbor_client.ApiClient(configuration))
pool_id = 'pool_id_example' # str | The name of the pool. 'all' stands for all pools
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Get workers
    api_response = api_instance.get_workers(pool_id, x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobserviceApi->get_workers: %s\n" % e)

Parameters

NameTypeDescriptionNotes
pool_idstrThe name of the pool. 'all' stands for all pools
x_request_idstrAn unique ID for the request[optional]

Return type

list[Worker]

Authorization

basic

HTTP request headers

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

[Back to top]

list_job_queues

Signature

list_job_queues(x_request_id: Optional[str])-> list[JobQueue]

list job queues

list job queue

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

try:
    # list job queues
    api_response = api_instance.list_job_queues(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling JobserviceApi->list_job_queues: %s\n" % e)

Parameters

NameTypeDescriptionNotes
x_request_idstrAn unique ID for the request[optional]

Return type

list[JobQueue]

Authorization

basic

HTTP request headers

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

[Back to top]

stop_running_job

Signature

stop_running_job(job_id: str, x_request_id: Optional[str])-> None

Stop running job

Stop running job

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.JobserviceApi(harbor_client.ApiClient(configuration))
job_id = 'job_id_example' # str | The id of the job.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Stop running job
    api_instance.stop_running_job(job_id, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling JobserviceApi->stop_running_job: %s\n" % e)

Parameters

NameTypeDescriptionNotes
job_idstrThe id of the job.
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]