All URIs are relative to http://localhost/api/v2.0
Method | HTTP request | Description |
---|---|---|
create_gc_schedule | POST /system/gc/schedule | Create a gc schedule. |
get_gc | GET /system/gc/{gc_id} | Get gc status. |
get_gc_history | GET /system/gc | Get gc results. |
get_gc_log | GET /system/gc/{gc_id}/log | Get gc job log. |
get_gc_schedule | GET /system/gc/schedule | Get gc's schedule. |
stop_gc | PUT /system/gc/{gc_id} | Stop the specific GC execution |
update_gc_schedule | PUT /system/gc/schedule | Update gc's schedule. |
create_gc_schedule(schedule: Schedule, x_request_id: Optional[str])-> None
Create a gc schedule.
This endpoint is for update gc schedule.
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.GcApi(harbor_client.ApiClient(configuration))
schedule = harbor_client.Schedule() # Schedule | Updates of gc's schedule.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Create a gc schedule.
api_instance.create_gc_schedule(schedule, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling GcApi->create_gc_schedule: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
schedule | Schedule | Updates of gc's schedule. | |
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
get_gc(gc_id: int, x_request_id: Optional[str])-> GCHistory
Get gc status.
This endpoint let user get gc status filtered by specific ID.
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.GcApi(harbor_client.ApiClient(configuration))
gc_id = 789 # int | The ID of the gc log
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Get gc status.
api_response = api_instance.get_gc(gc_id, x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GcApi->get_gc: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gc_id | int | The ID of the gc log | |
x_request_id | str | An unique ID for the request | [optional] |
get_gc_history(x_request_id: Optional[str], q: Optional[str], sort: Optional[str], page: Optional[int], page_size: Optional[int])-> list[GCHistory]
Get gc results.
This endpoint let user get gc execution history.
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.GcApi(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:
# Get gc results.
api_response = api_instance.get_gc_history(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 GcApi->get_gc_history: %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] |
get_gc_log(gc_id: int, x_request_id: Optional[str])-> str
Get gc job log.
This endpoint let user get gc job logs filtered by specific ID.
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.GcApi(harbor_client.ApiClient(configuration))
gc_id = 789 # int | The ID of the gc log
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Get gc job log.
api_response = api_instance.get_gc_log(gc_id, x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GcApi->get_gc_log: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gc_id | int | The ID of the gc log | |
x_request_id | str | An unique ID for the request | [optional] |
str
get_gc_schedule(x_request_id: Optional[str])-> GCHistory
Get gc’s schedule.
This endpoint is for get schedule of gc 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.GcApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Get gc's schedule.
api_response = api_instance.get_gc_schedule(x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling GcApi->get_gc_schedule: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
x_request_id | str | An unique ID for the request | [optional] |
stop_gc(gc_id: int, x_request_id: Optional[str])-> None
Stop the specific GC execution
Stop the GC execution specified by ID
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.GcApi(harbor_client.ApiClient(configuration))
gc_id = 789 # int | The ID of the gc log
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Stop the specific GC execution
api_instance.stop_gc(gc_id, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling GcApi->stop_gc: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
gc_id | int | The ID of the gc log | |
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
update_gc_schedule(schedule: Schedule, x_request_id: Optional[str])-> None
Update gc’s schedule.
This endpoint is for update gc schedule.
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.GcApi(harbor_client.ApiClient(configuration))
schedule = harbor_client.Schedule() # Schedule | Updates of gc's schedule.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Update gc's schedule.
api_instance.update_gc_schedule(schedule, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling GcApi->update_gc_schedule: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
schedule | Schedule | Updates of gc's schedule. | |
x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)