All URIs are relative to http://localhost/api/v2.0
Method | HTTP request | Description |
---|---|---|
action_pending_jobs | PUT /jobservice/queues/{job_type} | stop and clean, pause, resume pending jobs in the queue |
get_worker_pools | GET /jobservice/pools | Get worker pools |
get_workers | GET /jobservice/pools/{pool_id}/workers | Get workers |
list_job_queues | GET /jobservice/queues | list job queues |
stop_running_job | PUT /jobservice/jobs/{job_id} | Stop running job |
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
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)
Name | Type | Description | Notes |
---|---|---|---|
job_type | str | The type of the job. 'all' stands for all job types | |
action_request | ActionRequest | ||
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
get_worker_pools(x_request_id: Optional[str])-> list[WorkerPool]
Get worker pools
Get worker pools
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)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | An unique ID for the request | [optional] |
get_workers(pool_id: str, x_request_id: Optional[str])-> list[Worker]
Get workers
Get workers in current pool
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)
Name | Type | Description | Notes |
---|---|---|---|
pool_id | str | The name of the pool. 'all' stands for all pools | |
x_request_id | str | An unique ID for the request | [optional] |
list_job_queues(x_request_id: Optional[str])-> list[JobQueue]
list job queues
list job queue
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)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | An unique ID for the request | [optional] |
stop_running_job(job_id: str, x_request_id: Optional[str])-> None
Stop running job
Stop running job
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)
Name | Type | Description | Notes |
---|---|---|---|
job_id | str | The id of the job. | |
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)