All URIs are relative to http://localhost/api/v2.0
| Method | HTTP request | Description |
|---|---|---|
| create_project | POST /projects | Create a new project. |
| delete_project | DELETE /projects/{project_id} | Delete project by projectID |
| get_logs | GET /projects/{project_name}/logs | Get recent logs of the projects |
| get_project | GET /projects/{project_id} | Return specific project detail information |
| get_project_deletable | GET /projects/{project_id}/_deletable | Get the deletable status of the project |
| get_project_summary | GET /projects/{project_id}/summary | Get summary of the project. |
| head_project | HEAD /projects | Check if the project name user provided already exists. |
| list_projects | GET /projects | List projects |
| update_project | PUT /projects/{project_id} | Update properties for a selected project. |
create_project(body, x_request_id=x_request_id)
Create a new project.
This endpoint is for user to create a new project.
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.ApiClient(configuration))
body = harbor.ProjectReq() # ProjectReq | New created project.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Create a new project.
api_instance.create_project(body, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling ProjectApi->create_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| body | ProjectReq | New created project. | |
| x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
delete_project(project_id, x_request_id=x_request_id)
Delete project by projectID
This endpoint is aimed to delete project by project ID.
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.ApiClient(configuration))
project_id = 789 # int | The ID of the project
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Delete project by projectID
api_instance.delete_project(project_id, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling ProjectApi->delete_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | int | The ID of the project | |
| x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[AuditLog] get_logs(project_name, x_request_id=x_request_id, q=q, page=page, page_size=page_size)
Get recent logs of the projects
Get recent logs of the projects
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.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)
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)
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 recent logs of the projects
api_response = api_instance.get_logs(project_name, x_request_id=x_request_id, q=q, page=page, page_size=page_size)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectApi->get_logs: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_name | str | The name of the project | |
| 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= |
[optional] |
| page | int | The page number | [optional] [default to 1] |
| page_size | int | The size of per page | [optional] [default to 10] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Project get_project(project_id, x_request_id=x_request_id)
Return specific project detail information
This endpoint returns specific project information by project ID.
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.ApiClient(configuration))
project_id = 789 # int | The ID of the project
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Return specific project detail information
api_response = api_instance.get_project(project_id, x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectApi->get_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | int | The ID of the project | |
| x_request_id | str | An unique ID for the request | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProjectDeletable get_project_deletable(project_id, x_request_id=x_request_id)
Get the deletable status of the project
Get the deletable status of the project
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.ApiClient(configuration))
project_id = 789 # int | The ID of the project
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Get the deletable status of the project
api_response = api_instance.get_project_deletable(project_id, x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectApi->get_project_deletable: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | int | The ID of the project | |
| x_request_id | str | An unique ID for the request | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ProjectSummary get_project_summary(project_id, x_request_id=x_request_id)
Get summary of the project.
Get summary of the project.
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.ApiClient(configuration))
project_id = 789 # int | The ID of the project
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Get summary of the project.
api_response = api_instance.get_project_summary(project_id, x_request_id=x_request_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectApi->get_project_summary: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_id | int | The ID of the project | |
| x_request_id | str | An unique ID for the request | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
head_project(project_name, x_request_id=x_request_id)
Check if the project name user provided already exists.
This endpoint is used to check if the project name provided already exist.
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.ApiClient(configuration))
project_name = 'project_name_example' # str | Project name for checking exists.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Check if the project name user provided already exists.
api_instance.head_project(project_name, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling ProjectApi->head_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| project_name | str | Project name for checking exists. | |
| x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Project] list_projects(x_request_id=x_request_id, page=page, page_size=page_size, name=name, public=public, owner=owner)
List projects
This endpoint returns projects created by Harbor.
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.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)
name = 'name_example' # str | The name of project. (optional)
public = true # bool | The project is public or private. (optional)
owner = 'owner_example' # str | The name of project owner. (optional)
try:
# List projects
api_response = api_instance.list_projects(x_request_id=x_request_id, page=page, page_size=page_size, name=name, public=public, owner=owner)
pprint(api_response)
except ApiException as e:
print("Exception when calling ProjectApi->list_projects: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| x_request_id | str | An unique ID for the request | [optional] |
| page | int | The page number | [optional] [default to 1] |
| page_size | int | The size of per page | [optional] [default to 10] |
| name | str | The name of project. | [optional] |
| public | bool | The project is public or private. | [optional] |
| owner | str | The name of project owner. | [optional] |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
update_project(body, project_id, x_request_id=x_request_id)
Update properties for a selected project.
This endpoint is aimed to update the properties of a project.
from __future__ import print_function
import time
import harbor
from harbor.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = harbor.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = harbor.ProjectApi(harbor.ApiClient(configuration))
body = harbor.ProjectReq() # ProjectReq | Updates of project.
project_id = 789 # int | The ID of the project
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)
try:
# Update properties for a selected project.
api_instance.update_project(body, project_id, x_request_id=x_request_id)
except ApiException as e:
print("Exception when calling ProjectApi->update_project: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| body | ProjectReq | Updates of project. | |
| project_id | int | The ID of the project | |
| x_request_id | str | An unique ID for the request | [optional] |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]