Harbor API Client

These APIs provide services for manipulating Harbor project.

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 2.0
  • Package version: 2.7.0
  • Build package: io.swagger.codegen.languages.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/container-registry/harbor-api-client.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/container-registry/harbor-api-client.git)

Then import the package:

import harbor_client 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import harbor_client

Getting Started

Please follow the installation procedure and then run the following:

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.LdapApi(harbor_client.ApiClient(configuration))
uid_list = harbor_client.LdapImportUsers() # LdapImportUsers | The uid listed for importing. This list will check users validity of ldap service based on configuration from the system.
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Import selected available ldap users.
    api_instance.import_ldap_user(uid_list, x_request_id=x_request_id)
except ApiException as e:
    print("Exception when calling LdapApi->import_ldap_user: %s\n" % e)

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
LdapApiimport_ldap_userPOST /ldap/users/importImport selected available ldap users.
LdapApiping_ldapPOST /ldap/pingPing available ldap service.
LdapApisearch_ldap_groupGET /ldap/groups/searchSearch available ldap groups.
LdapApisearch_ldap_userGET /ldap/users/searchSearch available ldap users.
RetentionApicreate_retentionPOST /retentionsCreate Retention Policy
RetentionApidelete_retentionDELETE /retentions/{id}Delete Retention Policy
RetentionApiget_rentenition_metadataGET /retentions/metadatasGet Retention Metadatas
RetentionApiget_retentionGET /retentions/{id}Get Retention Policy
RetentionApiget_retention_task_logGET /retentions/{id}/executions/{eid}/tasks/{tid}Get Retention job task log
RetentionApilist_retention_executionsGET /retentions/{id}/executionsGet Retention executions
RetentionApilist_retention_tasksGET /retentions/{id}/executions/{eid}/tasksGet Retention tasks
RetentionApioperate_retention_executionPATCH /retentions/{id}/executions/{eid}Stop a Retention execution
RetentionApitrigger_retention_executionPOST /retentions/{id}/executionsTrigger a Retention Execution
RetentionApiupdate_retentionPUT /retentions/{id}Update Retention Policy
SystemCVEAllowlistApiget_system_cve_allowlistGET /system/CVEAllowlistGet the system level allowlist of CVE.
SystemCVEAllowlistApiput_system_cve_allowlistPUT /system/CVEAllowlistUpdate the system level allowlist of CVE.
ArtifactApiadd_labelPOST /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labelsAdd label to artifact
ArtifactApicopy_artifactPOST /projects/{project_name}/repositories/{repository_name}/artifactsCopy artifact
ArtifactApicreate_tagPOST /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tagsCreate tag
ArtifactApidelete_artifactDELETE /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}Delete the specific artifact
ArtifactApidelete_tagDELETE /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name}Delete tag
ArtifactApiget_additionGET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition}Get the addition of the specific artifact
ArtifactApiget_artifactGET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}Get the specific artifact
ArtifactApiget_vulnerabilities_additionGET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/vulnerabilitiesGet the vulnerabilities addition of the specific artifact
ArtifactApilist_accessoriesGET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/accessoriesList accessories
ArtifactApilist_artifactsGET /projects/{project_name}/repositories/{repository_name}/artifactsList artifacts
ArtifactApilist_tagsGET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tagsList tags
ArtifactApiremove_labelDELETE /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id}Remove label from artifact
AuditlogApilist_audit_logsGET /audit-logsGet recent logs of the projects which the user is a member of
ConfigureApiget_configurationsGET /configurationsGet system configurations.
ConfigureApiget_internalconfigGET /internalconfigGet internal configurations.
ConfigureApiupdate_configurationsPUT /configurationsModify system configurations.
GcApicreate_gc_schedulePOST /system/gc/scheduleCreate a gc schedule.
GcApiget_gcGET /system/gc/{gc_id}Get gc status.
GcApiget_gc_historyGET /system/gcGet gc results.
GcApiget_gc_logGET /system/gc/{gc_id}/logGet gc job log.
GcApiget_gc_scheduleGET /system/gc/scheduleGet gc's schedule.
GcApistop_gcPUT /system/gc/{gc_id}Stop the specific GC execution
GcApiupdate_gc_schedulePUT /system/gc/scheduleUpdate gc's schedule.
HealthApiget_healthGET /healthCheck the status of Harbor components
IconApiget_iconGET /icons/{digest}Get artifact icon
ImmutableApicreate_immu_rulePOST /projects/{project_name_or_id}/immutabletagrulesAdd an immutable tag rule to current project
ImmutableApidelete_immu_ruleDELETE /projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id}Delete the immutable tag rule.
ImmutableApilist_immu_rulesGET /projects/{project_name_or_id}/immutabletagrulesList all immutable tag rules of current project
ImmutableApiupdate_immu_rulePUT /projects/{project_name_or_id}/immutabletagrules/{immutable_rule_id}Update the immutable tag rule or enable or disable the rule
JobserviceApiaction_pending_jobsPUT /jobservice/queues/{job_type}stop and clean, pause, resume pending jobs in the queue
JobserviceApiget_worker_poolsGET /jobservice/poolsGet worker pools
JobserviceApiget_workersGET /jobservice/pools/{pool_id}/workersGet workers
JobserviceApilist_job_queuesGET /jobservice/queueslist job queues
JobserviceApistop_running_jobPUT /jobservice/jobs/{job_id}Stop running job
LabelApicreate_labelPOST /labelsPost creates a label
LabelApidelete_labelDELETE /labels/{label_id}Delete the label specified by ID.
LabelApiget_label_by_idGET /labels/{label_id}Get the label specified by ID.
LabelApilist_labelsGET /labelsList labels according to the query strings.
LabelApiupdate_labelPUT /labels/{label_id}Update the label properties.
MemberApicreate_project_memberPOST /projects/{project_name_or_id}/membersCreate project member
MemberApidelete_project_memberDELETE /projects/{project_name_or_id}/members/{mid}Delete project member
MemberApiget_project_memberGET /projects/{project_name_or_id}/members/{mid}Get the project member information
MemberApilist_project_membersGET /projects/{project_name_or_id}/membersGet all project member information
MemberApiupdate_project_memberPUT /projects/{project_name_or_id}/members/{mid}Update project member
OidcApiping_oidcPOST /system/oidc/pingTest the OIDC endpoint.
PingApiget_pingGET /pingPing Harbor to check if it's alive.
PreheatApicreate_instancePOST /p2p/preheat/instancesCreate p2p provider instances
PreheatApicreate_policyPOST /projects/{project_name}/preheat/policiesCreate a preheat policy under a project
PreheatApidelete_instanceDELETE /p2p/preheat/instances/{preheat_instance_name}Delete the specified P2P provider instance
PreheatApidelete_policyDELETE /projects/{project_name}/preheat/policies/{preheat_policy_name}Delete a preheat policy
PreheatApiget_executionGET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}Get a execution detail by id
PreheatApiget_instanceGET /p2p/preheat/instances/{preheat_instance_name}Get a P2P provider instance
PreheatApiget_policyGET /projects/{project_name}/preheat/policies/{preheat_policy_name}Get a preheat policy
PreheatApiget_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
PreheatApilist_executionsGET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executionsList executions for the given policy
PreheatApilist_instancesGET /p2p/preheat/instancesList P2P provider instances
PreheatApilist_policiesGET /projects/{project_name}/preheat/policiesList preheat policies
PreheatApilist_providersGET /p2p/preheat/providersList P2P providers
PreheatApilist_providers_under_projectGET /projects/{project_name}/preheat/providersGet all providers at project level
PreheatApilist_tasksGET /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasksList all the related tasks for the given execution
PreheatApimanual_preheatPOST /projects/{project_name}/preheat/policies/{preheat_policy_name}Manual preheat
PreheatApiping_instancesPOST /p2p/preheat/instances/pingPing status of a instance.
PreheatApistop_executionPATCH /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}Stop a execution
PreheatApiupdate_instancePUT /p2p/preheat/instances/{preheat_instance_name}Update the specified P2P provider instance
PreheatApiupdate_policyPUT /projects/{project_name}/preheat/policies/{preheat_policy_name}Update preheat policy
ProjectApicreate_projectPOST /projectsCreate a new project.
ProjectApidelete_projectDELETE /projects/{project_name_or_id}Delete project by projectID
ProjectApiget_logsGET /projects/{project_name}/logsGet recent logs of the projects
ProjectApiget_projectGET /projects/{project_name_or_id}Return specific project detail information
ProjectApiget_project_deletableGET /projects/{project_name_or_id}/_deletableGet the deletable status of the project
ProjectApiget_project_summaryGET /projects/{project_name_or_id}/summaryGet summary of the project.
ProjectApiget_scanner_of_projectGET /projects/{project_name_or_id}/scannerGet project level scanner
ProjectApihead_projectHEAD /projectsCheck if the project name user provided already exists.
ProjectApilist_projectsGET /projectsList projects
ProjectApilist_scanner_candidates_of_projectGET /projects/{project_name_or_id}/scanner/candidatesGet scanner registration candidates for configurating project level scanner
ProjectApiset_scanner_of_projectPUT /projects/{project_name_or_id}/scannerConfigure scanner for the specified project
ProjectApiupdate_projectPUT /projects/{project_name_or_id}Update properties for a selected project.
ProjectMetadataApiadd_project_metadatasPOST /projects/{project_name_or_id}/metadatas/Add metadata for the specific project
ProjectMetadataApidelete_project_metadataDELETE /projects/{project_name_or_id}/metadatas/{meta_name}Delete the specific metadata for the specific project
ProjectMetadataApiget_project_metadataGET /projects/{project_name_or_id}/metadatas/{meta_name}Get the specific metadata of the specific project
ProjectMetadataApilist_project_metadatasGET /projects/{project_name_or_id}/metadatas/Get the metadata of the specific project
ProjectMetadataApiupdate_project_metadataPUT /projects/{project_name_or_id}/metadatas/{meta_name}Update the specific metadata for the specific project
PurgeApicreate_purge_schedulePOST /system/purgeaudit/scheduleCreate a purge job schedule.
PurgeApiget_purge_historyGET /system/purgeauditGet purge job results.
PurgeApiget_purge_jobGET /system/purgeaudit/{purge_id}Get purge job status.
PurgeApiget_purge_job_logGET /system/purgeaudit/{purge_id}/logGet purge job log.
PurgeApiget_purge_scheduleGET /system/purgeaudit/scheduleGet purge's schedule.
PurgeApistop_purgePUT /system/purgeaudit/{purge_id}Stop the specific purge audit log execution
PurgeApiupdate_purge_schedulePUT /system/purgeaudit/scheduleUpdate purge job's schedule.
QuotaApiget_quotaGET /quotas/{id}Get the specified quota
QuotaApilist_quotasGET /quotasList quotas
QuotaApiupdate_quotaPUT /quotas/{id}Update the specified quota
RegistryApicreate_registryPOST /registriesCreate a registry
RegistryApidelete_registryDELETE /registries/{id}Delete the specific registry
RegistryApiget_registryGET /registries/{id}Get the specific registry
RegistryApiget_registry_infoGET /registries/{id}/infoGet the registry info
RegistryApilist_registriesGET /registriesList the registries
RegistryApilist_registry_provider_infosGET /replication/adapterinfosList all registered registry provider information
RegistryApilist_registry_provider_typesGET /replication/adaptersList registry adapters
RegistryApiping_registryPOST /registries/pingCheck status of a registry
RegistryApiupdate_registryPUT /registries/{id}Update the registry
ReplicationApicreate_replication_policyPOST /replication/policiesCreate a replication policy
ReplicationApidelete_replication_policyDELETE /replication/policies/{id}Delete the specific replication policy
ReplicationApiget_replication_executionGET /replication/executions/{id}Get the specific replication execution
ReplicationApiget_replication_logGET /replication/executions/{id}/tasks/{task_id}/logGet the log of the specific replication task
ReplicationApiget_replication_policyGET /replication/policies/{id}Get the specific replication policy
ReplicationApilist_replication_executionsGET /replication/executionsList replication executions
ReplicationApilist_replication_policiesGET /replication/policiesList replication policies
ReplicationApilist_replication_tasksGET /replication/executions/{id}/tasksList replication tasks for a specific execution
ReplicationApistart_replicationPOST /replication/executionsStart one replication execution
ReplicationApistop_replicationPUT /replication/executions/{id}Stop the specific replication execution
ReplicationApiupdate_replication_policyPUT /replication/policies/{id}Update the replication policy
RepositoryApidelete_repositoryDELETE /projects/{project_name}/repositories/{repository_name}Delete repository
RepositoryApiget_repositoryGET /projects/{project_name}/repositories/{repository_name}Get repository
RepositoryApilist_all_repositoriesGET /repositoriesList all authorized repositories
RepositoryApilist_repositoriesGET /projects/{project_name}/repositoriesList repositories
RepositoryApiupdate_repositoryPUT /projects/{project_name}/repositories/{repository_name}Update repository
RobotApicreate_robotPOST /robotsCreate a robot account
RobotApidelete_robotDELETE /robots/{robot_id}Delete a robot account
RobotApiget_robot_by_idGET /robots/{robot_id}Get a robot account
RobotApilist_robotGET /robotsGet robot account
RobotApirefresh_secPATCH /robots/{robot_id}Refresh the robot secret
RobotApiupdate_robotPUT /robots/{robot_id}Update a robot account
Robotv1Apicreate_robot_v1POST /projects/{project_name_or_id}/robotsCreate a robot account
Robotv1Apidelete_robot_v1DELETE /projects/{project_name_or_id}/robots/{robot_id}Delete a robot account
Robotv1Apiget_robot_by_idv1GET /projects/{project_name_or_id}/robots/{robot_id}Get a robot account
Robotv1Apilist_robot_v1GET /projects/{project_name_or_id}/robotsGet all robot accounts of specified project
Robotv1Apiupdate_robot_v1PUT /projects/{project_name_or_id}/robots/{robot_id}Update status of robot account.
ScanApiget_report_logGET /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/logGet the log of the scan report
ScanApiscan_artifactPOST /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scanScan the artifact
ScanApistop_scan_artifactPOST /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/stopCancelling a scan job for a particular artifact
ScanAllApicreate_scan_all_schedulePOST /system/scanAll/scheduleCreate a schedule or a manual trigger for the scan all job.
ScanAllApiget_latest_scan_all_metricsGET /scans/all/metricsGet the metrics of the latest scan all process
ScanAllApiget_latest_scheduled_scan_all_metricsGET /scans/schedule/metricsGet the metrics of the latest scheduled scan all process
ScanAllApiget_scan_all_scheduleGET /system/scanAll/scheduleGet scan all's schedule.
ScanAllApistop_scan_allPOST /system/scanAll/stopStop scanAll job execution
ScanAllApiupdate_scan_all_schedulePUT /system/scanAll/scheduleUpdate scan all's schedule.
ScanDataExportApidownload_scan_dataGET /export/cve/download/{execution_id}Download the scan data export file
ScanDataExportApiexport_scan_dataPOST /export/cveExport scan data for selected projects
ScanDataExportApiget_scan_data_export_executionGET /export/cve/execution/{execution_id}Get the specific scan data export execution
ScanDataExportApiget_scan_data_export_execution_listGET /export/cve/executionsGet a list of specific scan data export execution jobs for a specified user
ScannerApicreate_scannerPOST /scannersCreate a scanner registration
ScannerApidelete_scannerDELETE /scanners/{registration_id}Delete a scanner registration
ScannerApiget_scannerGET /scanners/{registration_id}Get a scanner registration details
ScannerApiget_scanner_metadataGET /scanners/{registration_id}/metadataGet the metadata of the specified scanner registration
ScannerApilist_scannersGET /scannersList scanner registrations
ScannerApiping_scannerPOST /scanners/pingTests scanner registration settings
ScannerApiset_scanner_as_defaultPATCH /scanners/{registration_id}Set system default scanner registration
ScannerApiupdate_scannerPUT /scanners/{registration_id}Update a scanner registration
ScheduleApiget_schedule_pausedGET /schedules/{job_type}/paused
ScheduleApilist_schedulesGET /schedules
SearchApisearchGET /searchSearch for projects, repositories and helm charts
StatisticApiget_statisticGET /statisticsGet the statistic information about the projects and repositories
SysteminfoApiget_certGET /systeminfo/getcertGet default root certificate.
SysteminfoApiget_system_infoGET /systeminfoGet general system info
SysteminfoApiget_volumesGET /systeminfo/volumesGet system volume info (total/free size).
UserApicreate_userPOST /usersCreate a local user.
UserApidelete_userDELETE /users/{user_id}Mark a registered user as be removed.
UserApiget_current_user_infoGET /users/currentGet current user info.
UserApiget_current_user_permissionsGET /users/current/permissionsGet current user permissions.
UserApiget_userGET /users/{user_id}Get a user's profile.
UserApilist_usersGET /usersList users
UserApisearch_usersGET /users/searchSearch users by username
UserApiset_cli_secretPUT /users/{user_id}/cli_secretSet CLI secret for a user.
UserApiset_user_sys_adminPUT /users/{user_id}/sysadminUpdate a registered user to change to be an administrator of Harbor.
UserApiupdate_user_passwordPUT /users/{user_id}/passwordChange the password on a user that already exists.
UserApiupdate_user_profilePUT /users/{user_id}Update user's profile.
UsergroupApicreate_user_groupPOST /usergroupsCreate user group
UsergroupApidelete_user_groupDELETE /usergroups/{group_id}Delete user group
UsergroupApiget_user_groupGET /usergroups/{group_id}Get user group information
UsergroupApilist_user_groupsGET /usergroupsGet all user groups information
UsergroupApisearch_user_groupsGET /usergroups/searchSearch groups by groupname
UsergroupApiupdate_user_groupPUT /usergroups/{group_id}Update group information
WebhookApicreate_webhook_policy_of_projectPOST /projects/{project_name_or_id}/webhook/policiesCreate project webhook policy.
WebhookApidelete_webhook_policy_of_projectDELETE /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}Delete webhook policy of a project
WebhookApiget_supported_event_typesGET /projects/{project_name_or_id}/webhook/eventsGet supported event types and notify types.
WebhookApiget_webhook_policy_of_projectGET /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}Get project webhook policy
WebhookApilast_triggerGET /projects/{project_name_or_id}/webhook/lasttriggerGet project webhook policy last trigger info
WebhookApilist_webhook_policies_of_projectGET /projects/{project_name_or_id}/webhook/policiesList project webhook policies.
WebhookApiupdate_webhook_policy_of_projectPUT /projects/{project_name_or_id}/webhook/policies/{webhook_policy_id}Update webhook policy of a project.
WebhookjobApilist_webhook_jobsGET /projects/{project_name_or_id}/webhook/jobsList project webhook jobs

Documentation For Models

Documentation For Authorization

basic

  • Type: HTTP basic authentication

Author