Skip to content

angeiv/go-harbor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for harbor

These APIs provide services for manipulating Harbor project.

Overview

This API client was generated by the swagger-codegen project. By using the swagger-spec from a remote server, you can easily generate an API client.

  • API version: 2.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen

Installation

Put the package under your project folder and add the following in import:

import "./harbor"

Or install and update with go get -u github.com/angeiv/go-harbor and import directly:

import "github.com/angeiv/go-harbor"

Documentation for API Endpoints

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

Class Method HTTP request Description
ArtifactApi AddLabel Post /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels Add label to artifact
ArtifactApi CopyArtifact Post /projects/{project_name}/repositories/{repository_name}/artifacts Copy artifact
ArtifactApi CreateTag Post /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags Create tag
ArtifactApi DeleteArtifact Delete /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} Delete the specific artifact
ArtifactApi DeleteTag Delete /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags/{tag_name} Delete tag
ArtifactApi GetAddition Get /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/additions/{addition} Get the addition of the specific artifact
ArtifactApi GetArtifact Get /projects/{project_name}/repositories/{repository_name}/artifacts/{reference} Get the specific artifact
ArtifactApi ListArtifacts Get /projects/{project_name}/repositories/{repository_name}/artifacts List artifacts
ArtifactApi ListTags Get /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/tags List tags
ArtifactApi RemoveLabel Delete /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/labels/{label_id} Remove label from artifact
AuditlogApi ListAuditLogs Get /audit-logs Get recent logs of the projects which the user is a member of
PreheatApi CreateInstance Post /p2p/preheat/instances Create p2p provider instances
PreheatApi CreatePolicy Post /projects/{project_name}/preheat/policies Create a preheat policy under a project
PreheatApi DeleteInstance Delete /p2p/preheat/instances/{preheat_instance_name} Delete the specified P2P provider instance
PreheatApi DeletePolicy Delete /projects/{project_name}/preheat/policies/{preheat_policy_name} Delete a preheat policy
PreheatApi GetExecution Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} Get a execution detail by id
PreheatApi GetInstance Get /p2p/preheat/instances/{preheat_instance_name} Get a P2P provider instance
PreheatApi GetLog Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks/{task_id}/logs Get the log text stream of the specified task for the given execution
PreheatApi GetPolicy Get /projects/{project_name}/preheat/policies/{preheat_policy_name} Get a preheat policy
PreheatApi ListExecutions Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions List executions for the given policy
PreheatApi ListInstances Get /p2p/preheat/instances List P2P provider instances
PreheatApi ListPolicies Get /projects/{project_name}/preheat/policies List preheat policies
PreheatApi ListProviders Get /p2p/preheat/providers List P2P providers
PreheatApi ListProvidersUnderProject Get /projects/{project_name}/preheat/providers Get all providers at project level
PreheatApi ListTasks Get /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id}/tasks List all the related tasks for the given execution
PreheatApi ManualPreheat Post /projects/{project_name}/preheat/policies/{preheat_policy_name} Manual preheat
PreheatApi PingInstances Post /p2p/preheat/instances/ping Ping status of a instance.
PreheatApi StopExecution Patch /projects/{project_name}/preheat/policies/{preheat_policy_name}/executions/{execution_id} Stop a execution
PreheatApi UpdateInstance Put /p2p/preheat/instances/{preheat_instance_name} Update the specified P2P provider instance
PreheatApi UpdatePolicy Put /projects/{project_name}/preheat/policies/{preheat_policy_name} Update preheat policy
ProjectApi GetLogs Get /projects/{project_name}/logs Get recent logs of the projects
RepositoryApi DeleteRepository Delete /projects/{project_name}/repositories/{repository_name} Delete repository
RepositoryApi GetRepository Get /projects/{project_name}/repositories/{repository_name} Get repository
RepositoryApi ListRepositories Get /projects/{project_name}/repositories List repositories
RepositoryApi UpdateRepository Put /projects/{project_name}/repositories/{repository_name} Update repository
ScanApi GetReportLog Get /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan/{report_id}/log Get the log of the scan report
ScanApi ScanArtifact Post /projects/{project_name}/repositories/{repository_name}/artifacts/{reference}/scan Scan the artifact

Documentation For Models

Documentation For Authorization

basic

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
	UserName: "username",
	Password: "password",
})
r, err := client.Service.Operation(auth, args)

Author

About

Harbor module for golang.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published