Documentation ¶
Overview ¶
Package server Harbor API These APIs provide services for manipulating Harbor project.
Schemes: http https Host: localhost BasePath: /api/v2.0 Version: 2.0 Consumes: - application/json Produces: - application/json - application/octet-stream - text/plain
swagger:meta
Index ¶
- Constants
- Variables
- func Handler(c Config) (http.Handler, error)
- func HandlerAPI(c Config) (http.Handler, *operations.HarborAPI, error)
- type ArtifactAPI
- type AuditlogAPI
- type Config
- type GCAPI
- type IconAPI
- type PingAPI
- type PreheatAPI
- type ProjectAPI
- type ReplicationAPI
- type RepositoryAPI
- type RetentionAPI
- type RobotAPI
- type Robotv1API
- type ScanAPI
- type ScanAllAPI
- type SysteminfoAPI
Constants ¶
View Source
const AuthKey contextKey = "Auth"
Variables ¶
View Source
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
Functions ¶
func Handler ¶
Handler returns an http.Handler given the handler configuration It mounts all the business logic implementers in the right routing.
func HandlerAPI ¶
HandlerAPI returns an http.Handler given the handler configuration and the corresponding *Harbor instance. It mounts all the business logic implementers in the right routing.
Types ¶
type ArtifactAPI ¶
type ArtifactAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // CopyArtifact is Copy the artifact specified in the "from" parameter to the repository. CopyArtifact(ctx context.Context, params artifact.CopyArtifactParams) middleware.Responder // AddLabel is Add label to the specified artiact. AddLabel(ctx context.Context, params artifact.AddLabelParams) middleware.Responder // CreateTag is Create a tag for the specified artifact CreateTag(ctx context.Context, params artifact.CreateTagParams) middleware.Responder // DeleteArtifact is Delete the artifact specified by the reference under the project and repository. The reference can be digest or tag DeleteArtifact(ctx context.Context, params artifact.DeleteArtifactParams) middleware.Responder // DeleteTag is Delete the tag of the specified artifact DeleteTag(ctx context.Context, params artifact.DeleteTagParams) middleware.Responder // GetAddition is Get the addition of the artifact specified by the reference under the project and repository. GetAddition(ctx context.Context, params artifact.GetAdditionParams) middleware.Responder // GetArtifact is Get the artifact specified by the reference under the project and repository. The reference can be digest or tag. GetArtifact(ctx context.Context, params artifact.GetArtifactParams) middleware.Responder // GetVulnerabilitiesAddition is Get the vulnerabilities addition of the artifact specified by the reference under the project and repository. GetVulnerabilitiesAddition(ctx context.Context, params artifact.GetVulnerabilitiesAdditionParams) middleware.Responder // ListArtifacts is List artifacts under the specific project and repository. Except the basic properties, the other supported queries in "q" includes "tags=*" to list only tagged artifacts, "tags=nil" to list only untagged artifacts, "tags=~v" to list artifacts whose tag fuzzy matches "v", "tags=v" to list artifact whose tag exactly matches "v", "labels=(id1, id2)" to list artifacts that both labels with id1 and id2 are added to ListArtifacts(ctx context.Context, params artifact.ListArtifactsParams) middleware.Responder // ListTags is List tags of the specific artifact ListTags(ctx context.Context, params artifact.ListTagsParams) middleware.Responder // RemoveLabel is Remove the label from the specified artiact. RemoveLabel(ctx context.Context, params artifact.RemoveLabelParams) middleware.Responder }
ArtifactAPI
type AuditlogAPI ¶
type AuditlogAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder ListAuditLogs(ctx context.Context, params auditlog.ListAuditLogsParams) middleware.Responder }
AuditlogAPI
type Config ¶
type Config struct { ArtifactAPI AuditlogAPI GCAPI IconAPI PingAPI PreheatAPI ProjectAPI ReplicationAPI RepositoryAPI RetentionAPI RobotAPI Robotv1API ScanAPI ScanAllAPI SysteminfoAPI Logger func(string, ...interface{}) // InnerMiddleware is for the handler executors. These do not apply to the swagger.json document. // The middleware executes after routing but before authentication, binding and validation InnerMiddleware func(http.Handler) http.Handler // Authorizer is used to authorize a request after the Auth function was called using the "Auth*" functions // and the principal was stored in the context in the "AuthKey" context value. Authorizer func(*http.Request) error // AuthBasic for basic authentication AuthBasic func(user string, pass string) (interface{}, error) }
Config is configuration for Handler
type GCAPI ¶
type GCAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder CreateGCSchedule(ctx context.Context, params gc.CreateGCScheduleParams) middleware.Responder // GetGC is This endpoint let user get gc status filtered by specific ID. GetGC(ctx context.Context, params gc.GetGCParams) middleware.Responder // GetGCHistory is This endpoint let user get gc execution history. GetGCHistory(ctx context.Context, params gc.GetGCHistoryParams) middleware.Responder // GetGCLog is This endpoint let user get gc job logs filtered by specific ID. GetGCLog(ctx context.Context, params gc.GetGCLogParams) middleware.Responder // GetGCSchedule is This endpoint is for get schedule of gc job. GetGCSchedule(ctx context.Context, params gc.GetGCScheduleParams) middleware.Responder UpdateGCSchedule(ctx context.Context, params gc.UpdateGCScheduleParams) middleware.Responder }
GCAPI
type IconAPI ¶
type IconAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // GetIcon is Get the artifact icon with the specified digest. As the original icon image is resized and encoded before returning, the parameter "digest" in the path doesn't match the hash of the returned content GetIcon(ctx context.Context, params icon.GetIconParams) middleware.Responder }
IconAPI
type PingAPI ¶
type PingAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // GetPing is This API simply replies a pong to indicate the process to handle API is up, disregarding the health status of dependent components. GetPing(ctx context.Context, params ping.GetPingParams) middleware.Responder }
PingAPI
type PreheatAPI ¶
type PreheatAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // CreateInstance is Create p2p provider instances CreateInstance(ctx context.Context, params preheat.CreateInstanceParams) middleware.Responder // CreatePolicy is Create a preheat policy under a project CreatePolicy(ctx context.Context, params preheat.CreatePolicyParams) middleware.Responder // DeleteInstance is Delete the specified P2P provider instance DeleteInstance(ctx context.Context, params preheat.DeleteInstanceParams) middleware.Responder // DeletePolicy is Delete a preheat policy DeletePolicy(ctx context.Context, params preheat.DeletePolicyParams) middleware.Responder // GetExecution is Get a execution detail by id GetExecution(ctx context.Context, params preheat.GetExecutionParams) middleware.Responder // GetInstance is Get a P2P provider instance GetInstance(ctx context.Context, params preheat.GetInstanceParams) middleware.Responder // GetPolicy is Get a preheat policy GetPolicy(ctx context.Context, params preheat.GetPolicyParams) middleware.Responder // GetPreheatLog is Get the log text stream of the specified task for the given execution GetPreheatLog(ctx context.Context, params preheat.GetPreheatLogParams) middleware.Responder // ListExecutions is List executions for the given policy ListExecutions(ctx context.Context, params preheat.ListExecutionsParams) middleware.Responder // ListInstances is List P2P provider instances ListInstances(ctx context.Context, params preheat.ListInstancesParams) middleware.Responder // ListPolicies is List preheat policies ListPolicies(ctx context.Context, params preheat.ListPoliciesParams) middleware.Responder // ListProviders is List P2P providers ListProviders(ctx context.Context, params preheat.ListProvidersParams) middleware.Responder // ListProvidersUnderProject is Get all providers at project level ListProvidersUnderProject(ctx context.Context, params preheat.ListProvidersUnderProjectParams) middleware.Responder // ListTasks is List all the related tasks for the given execution ListTasks(ctx context.Context, params preheat.ListTasksParams) middleware.Responder // ManualPreheat is Manual preheat ManualPreheat(ctx context.Context, params preheat.ManualPreheatParams) middleware.Responder PingInstances(ctx context.Context, params preheat.PingInstancesParams) middleware.Responder // StopExecution is Stop a execution StopExecution(ctx context.Context, params preheat.StopExecutionParams) middleware.Responder // UpdateInstance is Update the specified P2P provider instance UpdateInstance(ctx context.Context, params preheat.UpdateInstanceParams) middleware.Responder // UpdatePolicy is Update preheat policy UpdatePolicy(ctx context.Context, params preheat.UpdatePolicyParams) middleware.Responder }
PreheatAPI
type ProjectAPI ¶
type ProjectAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // CreateProject is This endpoint is for user to create a new project. CreateProject(ctx context.Context, params project.CreateProjectParams) middleware.Responder // DeleteProject is This endpoint is aimed to delete project by project ID. DeleteProject(ctx context.Context, params project.DeleteProjectParams) middleware.Responder // GetLogs is Get recent logs of the projects GetLogs(ctx context.Context, params project.GetLogsParams) middleware.Responder // GetProject is This endpoint returns specific project information by project ID. GetProject(ctx context.Context, params project.GetProjectParams) middleware.Responder // GetProjectDeletable is Get the deletable status of the project GetProjectDeletable(ctx context.Context, params project.GetProjectDeletableParams) middleware.Responder // GetProjectSummary is Get summary of the project. GetProjectSummary(ctx context.Context, params project.GetProjectSummaryParams) middleware.Responder // HeadProject is This endpoint is used to check if the project name provided already exist. HeadProject(ctx context.Context, params project.HeadProjectParams) middleware.Responder // ListProjects is This endpoint returns projects created by Harbor. ListProjects(ctx context.Context, params project.ListProjectsParams) middleware.Responder // UpdateProject is This endpoint is aimed to update the properties of a project. UpdateProject(ctx context.Context, params project.UpdateProjectParams) middleware.Responder }
ProjectAPI
type ReplicationAPI ¶
type ReplicationAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // GetReplicationExecution is Get the replication execution specified by ID GetReplicationExecution(ctx context.Context, params replication.GetReplicationExecutionParams) middleware.Responder // GetReplicationLog is Get the log of the specific replication task GetReplicationLog(ctx context.Context, params replication.GetReplicationLogParams) middleware.Responder // ListReplicationExecutions is List replication executions ListReplicationExecutions(ctx context.Context, params replication.ListReplicationExecutionsParams) middleware.Responder // ListReplicationTasks is List replication tasks for a specific execution ListReplicationTasks(ctx context.Context, params replication.ListReplicationTasksParams) middleware.Responder // StartReplication is Start one replication execution according to the policy StartReplication(ctx context.Context, params replication.StartReplicationParams) middleware.Responder // StopReplication is Stop the replication execution specified by ID StopReplication(ctx context.Context, params replication.StopReplicationParams) middleware.Responder }
ReplicationAPI
type RepositoryAPI ¶
type RepositoryAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // DeleteRepository is Delete the repository specified by name DeleteRepository(ctx context.Context, params repository.DeleteRepositoryParams) middleware.Responder // GetRepository is Get the repository specified by name GetRepository(ctx context.Context, params repository.GetRepositoryParams) middleware.Responder // ListRepositories is List repositories of the specified project ListRepositories(ctx context.Context, params repository.ListRepositoriesParams) middleware.Responder // UpdateRepository is Update the repository specified by name UpdateRepository(ctx context.Context, params repository.UpdateRepositoryParams) middleware.Responder }
RepositoryAPI
type RetentionAPI ¶
type RetentionAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // CreateRetention is Create Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when no retention policy binded to project yet. CreateRetention(ctx context.Context, params retention.CreateRetentionParams) middleware.Responder // GetRentenitionMetadata is Get Retention Metadatas. GetRentenitionMetadata(ctx context.Context, params retention.GetRentenitionMetadataParams) middleware.Responder // GetRetention is Get Retention Policy. GetRetention(ctx context.Context, params retention.GetRetentionParams) middleware.Responder // GetRetentionTaskLog is Get Retention job task log, tags ratain or deletion detail will be shown in a table. GetRetentionTaskLog(ctx context.Context, params retention.GetRetentionTaskLogParams) middleware.Responder // ListRetentionExecutions is Get Retention executions, execution status may be delayed before job service schedule it up. ListRetentionExecutions(ctx context.Context, params retention.ListRetentionExecutionsParams) middleware.Responder // ListRetentionTasks is Get Retention tasks, each repository as a task. ListRetentionTasks(ctx context.Context, params retention.ListRetentionTasksParams) middleware.Responder // OperateRetentionExecution is Stop a Retention execution, only support "stop" action now. OperateRetentionExecution(ctx context.Context, params retention.OperateRetentionExecutionParams) middleware.Responder // TriggerRetentionExecution is Trigger a Retention Execution, if dry_run is True, nothing would be deleted actually. TriggerRetentionExecution(ctx context.Context, params retention.TriggerRetentionExecutionParams) middleware.Responder // UpdateRetention is Update Retention Policy, you can reference metadatas API for the policy model. You can check project metadatas to find whether a retention policy is already binded. This method should only be called when retention policy has already binded to project. UpdateRetention(ctx context.Context, params retention.UpdateRetentionParams) middleware.Responder }
RetentionAPI
type RobotAPI ¶
type RobotAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // CreateRobot is Create a robot account CreateRobot(ctx context.Context, params robot.CreateRobotParams) middleware.Responder // DeleteRobot is This endpoint deletes specific robot account information by robot ID. DeleteRobot(ctx context.Context, params robot.DeleteRobotParams) middleware.Responder // GetRobotByID is This endpoint returns specific robot account information by robot ID. GetRobotByID(ctx context.Context, params robot.GetRobotByIDParams) middleware.Responder // ListRobot is List the robot accounts with the specified level and project. ListRobot(ctx context.Context, params robot.ListRobotParams) middleware.Responder // RefreshSec is Refresh the robot secret RefreshSec(ctx context.Context, params robot.RefreshSecParams) middleware.Responder // UpdateRobot is This endpoint updates specific robot account information by robot ID. UpdateRobot(ctx context.Context, params robot.UpdateRobotParams) middleware.Responder }
RobotAPI
type Robotv1API ¶
type Robotv1API interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // CreateRobotV1 is Create a robot account CreateRobotV1(ctx context.Context, params robotv1.CreateRobotV1Params) middleware.Responder // DeleteRobotV1 is This endpoint deletes specific robot account information by robot ID. DeleteRobotV1(ctx context.Context, params robotv1.DeleteRobotV1Params) middleware.Responder // GetRobotByIDV1 is This endpoint returns specific robot account information by robot ID. GetRobotByIDV1(ctx context.Context, params robotv1.GetRobotByIDV1Params) middleware.Responder // ListRobotV1 is Get all robot accounts of specified project ListRobotV1(ctx context.Context, params robotv1.ListRobotV1Params) middleware.Responder // UpdateRobotV1 is Used to disable/enable a specified robot account. UpdateRobotV1(ctx context.Context, params robotv1.UpdateRobotV1Params) middleware.Responder }
Robotv1API
type ScanAPI ¶
type ScanAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // GetReportLog is Get the log of the scan report GetReportLog(ctx context.Context, params scan.GetReportLogParams) middleware.Responder // ScanArtifact is Scan the specified artifact ScanArtifact(ctx context.Context, params scan.ScanArtifactParams) middleware.Responder }
ScanAPI
type ScanAllAPI ¶
type ScanAllAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder // CreateScanAllSchedule is This endpoint is for creating a schedule or a manual trigger for the scan all job, which scans all of images in Harbor. CreateScanAllSchedule(ctx context.Context, params scan_all.CreateScanAllScheduleParams) middleware.Responder // GetLatestScanAllMetrics is Get the metrics of the latest scan all process GetLatestScanAllMetrics(ctx context.Context, params scan_all.GetLatestScanAllMetricsParams) middleware.Responder // GetLatestScheduledScanAllMetrics is Get the metrics of the latest scheduled scan all process GetLatestScheduledScanAllMetrics(ctx context.Context, params scan_all.GetLatestScheduledScanAllMetricsParams) middleware.Responder // GetScanAllSchedule is This endpoint is for getting a schedule for the scan all job, which scans all of images in Harbor. GetScanAllSchedule(ctx context.Context, params scan_all.GetScanAllScheduleParams) middleware.Responder // UpdateScanAllSchedule is This endpoint is for updating the schedule of scan all job, which scans all of images in Harbor. UpdateScanAllSchedule(ctx context.Context, params scan_all.UpdateScanAllScheduleParams) middleware.Responder }
ScanAllAPI
type SysteminfoAPI ¶
type SysteminfoAPI interface { // Prepare action before the operation Prepare(ctx context.Context, operation string, params interface{}) middleware.Responder GetSysteminfo(ctx context.Context, params systeminfo.GetSysteminfoParams) middleware.Responder GetSysteminfoGetcert(ctx context.Context, params systeminfo.GetSysteminfoGetcertParams) middleware.Responder GetSysteminfoVolumes(ctx context.Context, params systeminfo.GetSysteminfoVolumesParams) middleware.Responder }
SysteminfoAPI
Click to show internal directories.
Click to hide internal directories.