harbor

package module
v0.0.0-...-b26f61c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2020 License: MIT Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

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

Documentation

Overview

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

* Harbor API * * These APIs provide services for manipulating Harbor project. * * API version: 2.0 * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextOAuth2 takes a oauth2.TokenSource as authentication for the request.
	ContextOAuth2 = contextKey("token")

	// ContextBasicAuth takes BasicAuth as authentication for the request.
	ContextBasicAuth = contextKey("basic")

	// ContextAccessToken takes a string oauth2 access token as authentication for the request.
	ContextAccessToken = contextKey("accesstoken")

	// ContextAPIKey takes an APIKey as authentication for the request
	ContextAPIKey = contextKey("apikey")
)

Functions

func CacheExpires

func CacheExpires(r *http.Response) time.Time

CacheExpires helper function to determine remaining time before repeating a request.

Types

type APIClient

type APIClient struct {
	ArtifactApi *ArtifactApiService

	AuditlogApi *AuditlogApiService

	PreheatApi *PreheatApiService

	ProjectApi *ProjectApiService

	RepositoryApi *RepositoryApiService

	ScanApi *ScanApiService
	// contains filtered or unexported fields
}

APIClient manages communication with the Harbor API API v2.0 In most cases there should be only one, shared, APIClient.

func NewAPIClient

func NewAPIClient(cfg *Configuration) *APIClient

NewAPIClient creates a new API client. Requires a userAgent string describing your application. optionally a custom http.Client to allow for advanced features such as caching.

func (*APIClient) ChangeBasePath

func (c *APIClient) ChangeBasePath(path string)

Change base path to allow switching to mocks

type APIKey

type APIKey struct {
	Key    string
	Prefix string
}

APIKey provides API key based authentication to a request passed via context using ContextAPIKey

type APIResponse

type APIResponse struct {
	*http.Response `json:"-"`
	Message        string `json:"message,omitempty"`
	// Operation is the name of the swagger operation.
	Operation string `json:"operation,omitempty"`
	// RequestURL is the request URL. This value is always available, even if the
	// embedded *http.Response is nil.
	RequestURL string `json:"url,omitempty"`
	// Method is the HTTP method used for the request.  This value is always
	// available, even if the embedded *http.Response is nil.
	Method string `json:"method,omitempty"`
	// Payload holds the contents of the response body (which may be nil or empty).
	// This is provided here as the raw response.Body() reader will have already
	// been drained.
	Payload []byte `json:"-"`
}

func NewAPIResponse

func NewAPIResponse(r *http.Response) *APIResponse

func NewAPIResponseWithError

func NewAPIResponseWithError(errorMessage string) *APIResponse
type AdditionLink struct {
	// The link of the addition
	Href string `json:"href,omitempty"`
	// Determine whether the link is an absolute URL or not
	Absolute bool `json:"absolute,omitempty"`
}

type Artifact

type Artifact struct {
	// The ID of the artifact
	Id int64 `json:"id,omitempty"`
	// The type of the artifact, e.g. image, chart, etc
	Type_ string `json:"type,omitempty"`
	// The media type of the artifact
	MediaType string `json:"media_type,omitempty"`
	// The manifest media type of the artifact
	ManifestMediaType string `json:"manifest_media_type,omitempty"`
	// The ID of the project that the artifact belongs to
	ProjectId int64 `json:"project_id,omitempty"`
	// The ID of the repository that the artifact belongs to
	RepositoryId int64 `json:"repository_id,omitempty"`
	// The digest of the artifact
	Digest string `json:"digest,omitempty"`
	// The size of the artifact
	Size int64 `json:"size,omitempty"`
	// The push time of the artifact
	PushTime time.Time `json:"push_time,omitempty"`
	// The latest pull time of the artifact
	PullTime      time.Time   `json:"pull_time,omitempty"`
	ExtraAttrs    *ModelMap   `json:"extra_attrs,omitempty"`
	Annotations   *ModelMap   `json:"annotations,omitempty"`
	References    []Reference `json:"references,omitempty"`
	Tags          []Tag       `json:"tags,omitempty"`
	AdditionLinks *ModelMap   `json:"addition_links,omitempty"`
	Labels        []Label     `json:"labels,omitempty"`
	ScanOverview  *ModelMap   `json:"scan_overview,omitempty"`
}

type ArtifactApiAddLabelOpts

type ArtifactApiAddLabelOpts struct {
	XRequestId optional.String
}

type ArtifactApiCopyArtifactOpts

type ArtifactApiCopyArtifactOpts struct {
	XRequestId optional.String
}

type ArtifactApiCreateTagOpts

type ArtifactApiCreateTagOpts struct {
	XRequestId optional.String
}

type ArtifactApiDeleteArtifactOpts

type ArtifactApiDeleteArtifactOpts struct {
	XRequestId optional.String
}

type ArtifactApiDeleteTagOpts

type ArtifactApiDeleteTagOpts struct {
	XRequestId optional.String
}

type ArtifactApiGetAdditionOpts

type ArtifactApiGetAdditionOpts struct {
	XRequestId optional.String
}

type ArtifactApiGetArtifactOpts

type ArtifactApiGetArtifactOpts struct {
	XRequestId          optional.String
	Page                optional.Int64
	PageSize            optional.Int64
	WithTag             optional.Bool
	WithLabel           optional.Bool
	WithScanOverview    optional.Bool
	WithSignature       optional.Bool
	WithImmutableStatus optional.Bool
}

type ArtifactApiListArtifactsOpts

type ArtifactApiListArtifactsOpts struct {
	XRequestId          optional.String
	Q                   optional.String
	Page                optional.Int64
	PageSize            optional.Int64
	WithTag             optional.Bool
	WithLabel           optional.Bool
	WithScanOverview    optional.Bool
	WithSignature       optional.Bool
	WithImmutableStatus optional.Bool
}

type ArtifactApiListTagsOpts

type ArtifactApiListTagsOpts struct {
	XRequestId          optional.String
	Q                   optional.String
	Page                optional.Int64
	PageSize            optional.Int64
	WithSignature       optional.Bool
	WithImmutableStatus optional.Bool
}

type ArtifactApiRemoveLabelOpts

type ArtifactApiRemoveLabelOpts struct {
	XRequestId optional.String
}

type ArtifactApiService

type ArtifactApiService service

func (*ArtifactApiService) AddLabel

func (a *ArtifactApiService) AddLabel(ctx context.Context, body Label, projectName string, repositoryName string, reference string, localVarOptionals *ArtifactApiAddLabelOpts) (*http.Response, error)

func (*ArtifactApiService) CopyArtifact

func (a *ArtifactApiService) CopyArtifact(ctx context.Context, projectName string, repositoryName string, from string, localVarOptionals *ArtifactApiCopyArtifactOpts) (*http.Response, error)

func (*ArtifactApiService) CreateTag

func (a *ArtifactApiService) CreateTag(ctx context.Context, body Tag, projectName string, repositoryName string, reference string, localVarOptionals *ArtifactApiCreateTagOpts) (*http.Response, error)

func (*ArtifactApiService) DeleteArtifact

func (a *ArtifactApiService) DeleteArtifact(ctx context.Context, projectName string, repositoryName string, reference string, localVarOptionals *ArtifactApiDeleteArtifactOpts) (*http.Response, error)

func (*ArtifactApiService) DeleteTag

func (a *ArtifactApiService) DeleteTag(ctx context.Context, projectName string, repositoryName string, reference string, tagName string, localVarOptionals *ArtifactApiDeleteTagOpts) (*http.Response, error)

func (*ArtifactApiService) GetAddition

func (a *ArtifactApiService) GetAddition(ctx context.Context, projectName string, repositoryName string, reference string, addition string, localVarOptionals *ArtifactApiGetAdditionOpts) (string, *http.Response, error)

func (*ArtifactApiService) GetArtifact

func (a *ArtifactApiService) GetArtifact(ctx context.Context, projectName string, repositoryName string, reference string, localVarOptionals *ArtifactApiGetArtifactOpts) (Artifact, *http.Response, error)

func (*ArtifactApiService) ListArtifacts

func (a *ArtifactApiService) ListArtifacts(ctx context.Context, projectName string, repositoryName string, localVarOptionals *ArtifactApiListArtifactsOpts) ([]Artifact, *http.Response, error)

func (*ArtifactApiService) ListTags

func (a *ArtifactApiService) ListTags(ctx context.Context, projectName string, repositoryName string, reference string, localVarOptionals *ArtifactApiListTagsOpts) ([]Tag, *http.Response, error)

func (*ArtifactApiService) RemoveLabel

func (a *ArtifactApiService) RemoveLabel(ctx context.Context, projectName string, repositoryName string, reference string, labelId int64, localVarOptionals *ArtifactApiRemoveLabelOpts) (*http.Response, error)

type AuditLog

type AuditLog struct {
	// The ID of the audit log entry.
	Id int32 `json:"id,omitempty"`
	// Username of the user in this log entry.
	Username string `json:"username,omitempty"`
	// Name of the repository in this log entry.
	Resource string `json:"resource,omitempty"`
	// Tag of the repository in this log entry.
	ResourceType string `json:"resource_type,omitempty"`
	// The operation against the repository in this log entry.
	Operation string `json:"operation,omitempty"`
	// The time when this operation is triggered.
	OpTime time.Time `json:"op_time,omitempty"`
}

type AuditlogApiListAuditLogsOpts

type AuditlogApiListAuditLogsOpts struct {
	XRequestId optional.String
	Q          optional.String
	Page       optional.Int64
	PageSize   optional.Int64
}

type AuditlogApiService

type AuditlogApiService service

func (*AuditlogApiService) ListAuditLogs

func (a *AuditlogApiService) ListAuditLogs(ctx context.Context, localVarOptionals *AuditlogApiListAuditLogsOpts) ([]AuditLog, *http.Response, error)

type BasicAuth

type BasicAuth struct {
	UserName string `json:"userName,omitempty"`
	Password string `json:"password,omitempty"`
}

BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth

type Configuration

type Configuration struct {
	BasePath      string            `json:"basePath,omitempty"`
	Host          string            `json:"host,omitempty"`
	Scheme        string            `json:"scheme,omitempty"`
	DefaultHeader map[string]string `json:"defaultHeader,omitempty"`
	UserAgent     string            `json:"userAgent,omitempty"`
	HTTPClient    *http.Client
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) AddDefaultHeader

func (c *Configuration) AddDefaultHeader(key string, value string)

type Execution

type Execution struct {
	// The ID of execution
	Id int32 `json:"id,omitempty"`
	// The vendor type of execution
	VendorType string `json:"vendor_type,omitempty"`
	// The vendor id of execution
	VendorId int32 `json:"vendor_id,omitempty"`
	// The status of execution
	Status string `json:"status,omitempty"`
	// The status message of execution
	StatusMessage string   `json:"status_message,omitempty"`
	Metrics       *Metrics `json:"metrics,omitempty"`
	// The trigger of execution
	Trigger    string    `json:"trigger,omitempty"`
	ExtraAttrs *ModelMap `json:"extra_attrs,omitempty"`
	// The start time of execution
	StartTime string `json:"start_time,omitempty"`
	// The end time of execution
	EndTime string `json:"end_time,omitempty"`
}

type GenericSwaggerError

type GenericSwaggerError struct {
	// contains filtered or unexported fields
}

GenericSwaggerError Provides access to the body, error and model on returned errors.

func (GenericSwaggerError) Body

func (e GenericSwaggerError) Body() []byte

Body returns the raw bytes of the response

func (GenericSwaggerError) Error

func (e GenericSwaggerError) Error() string

Error returns non-empty string if there was an error.

func (GenericSwaggerError) Model

func (e GenericSwaggerError) Model() interface{}

Model returns the unpacked model of the error

type Instance

type Instance struct {
	// Unique ID
	Id int32 `json:"id,omitempty"`
	// Instance name
	Name string `json:"name,omitempty"`
	// Description of instance
	Description string `json:"description,omitempty"`
	// Based on which driver, identified by ID
	Vendor string `json:"vendor,omitempty"`
	// The service endpoint of this instance
	Endpoint string `json:"endpoint,omitempty"`
	// The authentication way supported
	AuthMode string `json:"auth_mode,omitempty"`
	// The auth credential data if exists
	AuthInfo map[string]string `json:"auth_info,omitempty"`
	// The health status
	Status string `json:"status,omitempty"`
	// Whether the instance is activated or not
	Enabled bool `json:"enabled,omitempty"`
	// Whether the instance is default or not
	Default_ bool `json:"default,omitempty"`
	// Whether the instance endpoint is insecure or not
	Insecure bool `json:"insecure,omitempty"`
	// The timestamp of instance setting up
	SetupTimestamp int64 `json:"setup_timestamp,omitempty"`
}

type InstanceCreatedResp

type InstanceCreatedResp struct {
	// ID of instance created
	Id int32 `json:"id,omitempty"`
}

type InstanceDeletedResp

type InstanceDeletedResp struct {
	// ID of instance removed
	Removed int32 `json:"removed,omitempty"`
}

type InstanceUpdateResp

type InstanceUpdateResp struct {
	// ID of instance updated
	Updated int32 `json:"updated,omitempty"`
}

type Label

type Label struct {
	// The ID of the label
	Id int64 `json:"id,omitempty"`
	// The name the label
	Name string `json:"name,omitempty"`
	// The description the label
	Description string `json:"description,omitempty"`
	// The color the label
	Color string `json:"color,omitempty"`
	// The scope the label
	Scope string `json:"scope,omitempty"`
	// The ID of project that the label belongs to
	ProjectId int64 `json:"project_id,omitempty"`
	// The creation time the label
	CreationTime time.Time `json:"creation_time,omitempty"`
	// The update time of the label
	UpdateTime time.Time `json:"update_time,omitempty"`
}

type Metadata

type Metadata struct {
	// id
	Id string `json:"id,omitempty"`
	// name
	Name string `json:"name,omitempty"`
	// icon
	Icon string `json:"icon,omitempty"`
	// maintainers
	Maintainers []string `json:"maintainers,omitempty"`
	// version
	Version string `json:"version,omitempty"`
	// source
	Source string `json:"source,omitempty"`
}

type Metrics

type Metrics struct {
	// The count of task
	TaskCount int32 `json:"task_count,omitempty"`
	// The count of success task
	SuccessTaskCount int32 `json:"success_task_count,omitempty"`
	// The count of error task
	ErrorTaskCount int32 `json:"error_task_count,omitempty"`
	// The count of pending task
	PendingTaskCount int32 `json:"pending_task_count,omitempty"`
	// The count of running task
	RunningTaskCount int32 `json:"running_task_count,omitempty"`
	// The count of scheduled task
	ScheduledTaskCount int32 `json:"scheduled_task_count,omitempty"`
	// The count of stopped task
	StoppedTaskCount int32 `json:"stopped_task_count,omitempty"`
}

type ModelError

type ModelError struct {
	// The error code
	Code string `json:"code,omitempty"`
	// The error message
	Message string `json:"message,omitempty"`
}

a model for all the error response coming from harbor

type NativeReportSummary

type NativeReportSummary struct {
	// id of the native scan report
	ReportId string `json:"report_id,omitempty"`
	// The status of the report generating process
	ScanStatus string `json:"scan_status,omitempty"`
	// The overall severity
	Severity string `json:"severity,omitempty"`
	// The seconds spent for generating the report
	Duration int64                 `json:"duration,omitempty"`
	Summary  *VulnerabilitySummary `json:"summary,omitempty"`
	// The start time of the scan process that generating report
	StartTime time.Time `json:"start_time,omitempty"`
	// The end time of the scan process that generating report
	EndTime time.Time `json:"end_time,omitempty"`
	// The complete percent of the scanning which value is between 0 and 100
	CompletePercent int32 `json:"complete_percent,omitempty"`
}

The summary for the native report

type Platform

type Platform struct {
	// The architecture that the artifact applys to
	Architecture string `json:"architecture,omitempty"`
	// The OS that the artifact applys to
	Os string `json:"os,omitempty"`
	// The version of the OS that the artifact applys to
	OsVersion string `json:"'os.version',omitempty"`
	// The features of the OS that the artifact applys to
	OsFeatures []string `json:"'os.features',omitempty"`
	// The variant of the CPU
	Variant string `json:"variant,omitempty"`
}

type PreheatApiCreateInstanceOpts

type PreheatApiCreateInstanceOpts struct {
	XRequestId optional.String
}

type PreheatApiCreatePolicyOpts

type PreheatApiCreatePolicyOpts struct {
	XRequestId optional.String
}

type PreheatApiDeleteInstanceOpts

type PreheatApiDeleteInstanceOpts struct {
	XRequestId optional.String
}

type PreheatApiDeletePolicyOpts

type PreheatApiDeletePolicyOpts struct {
	XRequestId optional.String
}

type PreheatApiGetExecutionOpts

type PreheatApiGetExecutionOpts struct {
	XRequestId optional.String
}

type PreheatApiGetInstanceOpts

type PreheatApiGetInstanceOpts struct {
	XRequestId optional.String
}

type PreheatApiGetLogOpts

type PreheatApiGetLogOpts struct {
	XRequestId optional.String
}

type PreheatApiGetPolicyOpts

type PreheatApiGetPolicyOpts struct {
	XRequestId optional.String
}

type PreheatApiListExecutionsOpts

type PreheatApiListExecutionsOpts struct {
	XRequestId optional.String
	Page       optional.Int64
	PageSize   optional.Int64
	Q          optional.String
}

type PreheatApiListInstancesOpts

type PreheatApiListInstancesOpts struct {
	XRequestId optional.String
	Page       optional.Int64
	PageSize   optional.Int64
	Q          optional.String
}

type PreheatApiListPoliciesOpts

type PreheatApiListPoliciesOpts struct {
	XRequestId optional.String
	Page       optional.Int64
	PageSize   optional.Int64
	Q          optional.String
}

type PreheatApiListProvidersOpts

type PreheatApiListProvidersOpts struct {
	XRequestId optional.String
}

type PreheatApiListProvidersUnderProjectOpts

type PreheatApiListProvidersUnderProjectOpts struct {
	XRequestId optional.String
}

type PreheatApiListTasksOpts

type PreheatApiListTasksOpts struct {
	XRequestId optional.String
}

type PreheatApiManualPreheatOpts

type PreheatApiManualPreheatOpts struct {
	XRequestId optional.String
}

type PreheatApiPingInstancesOpts

type PreheatApiPingInstancesOpts struct {
	XRequestId optional.String
}

type PreheatApiService

type PreheatApiService service

func (*PreheatApiService) CreateInstance

func (a *PreheatApiService) CreateInstance(ctx context.Context, body Instance, localVarOptionals *PreheatApiCreateInstanceOpts) (InstanceCreatedResp, *http.Response, error)

func (*PreheatApiService) CreatePolicy

func (a *PreheatApiService) CreatePolicy(ctx context.Context, body PreheatPolicy, projectName string, localVarOptionals *PreheatApiCreatePolicyOpts) (*http.Response, error)

func (*PreheatApiService) DeleteInstance

func (a *PreheatApiService) DeleteInstance(ctx context.Context, preheatInstanceName string, localVarOptionals *PreheatApiDeleteInstanceOpts) (InstanceDeletedResp, *http.Response, error)

func (*PreheatApiService) DeletePolicy

func (a *PreheatApiService) DeletePolicy(ctx context.Context, projectName string, preheatPolicyName string, localVarOptionals *PreheatApiDeletePolicyOpts) (*http.Response, error)

func (*PreheatApiService) GetExecution

func (a *PreheatApiService) GetExecution(ctx context.Context, projectName string, preheatPolicyName string, executionId int32, localVarOptionals *PreheatApiGetExecutionOpts) (Execution, *http.Response, error)

func (*PreheatApiService) GetInstance

func (a *PreheatApiService) GetInstance(ctx context.Context, preheatInstanceName string, localVarOptionals *PreheatApiGetInstanceOpts) (Instance, *http.Response, error)

func (*PreheatApiService) GetLog

func (a *PreheatApiService) GetLog(ctx context.Context, projectName string, preheatPolicyName string, executionId int32, taskId int32, localVarOptionals *PreheatApiGetLogOpts) (string, *http.Response, error)

func (*PreheatApiService) GetPolicy

func (a *PreheatApiService) GetPolicy(ctx context.Context, projectName string, preheatPolicyName string, localVarOptionals *PreheatApiGetPolicyOpts) (PreheatPolicy, *http.Response, error)

func (*PreheatApiService) ListExecutions

func (a *PreheatApiService) ListExecutions(ctx context.Context, projectName string, preheatPolicyName string, localVarOptionals *PreheatApiListExecutionsOpts) ([]Execution, *http.Response, error)

func (*PreheatApiService) ListInstances

func (a *PreheatApiService) ListInstances(ctx context.Context, localVarOptionals *PreheatApiListInstancesOpts) ([]Instance, *http.Response, error)

func (*PreheatApiService) ListPolicies

func (a *PreheatApiService) ListPolicies(ctx context.Context, projectName string, localVarOptionals *PreheatApiListPoliciesOpts) ([]PreheatPolicy, *http.Response, error)

func (*PreheatApiService) ListProviders

func (a *PreheatApiService) ListProviders(ctx context.Context, localVarOptionals *PreheatApiListProvidersOpts) ([]Metadata, *http.Response, error)

func (*PreheatApiService) ListProvidersUnderProject

func (a *PreheatApiService) ListProvidersUnderProject(ctx context.Context, projectName string, localVarOptionals *PreheatApiListProvidersUnderProjectOpts) ([]ProviderUnderProject, *http.Response, error)

func (*PreheatApiService) ListTasks

func (a *PreheatApiService) ListTasks(ctx context.Context, projectName string, preheatPolicyName string, executionId int32, localVarOptionals *PreheatApiListTasksOpts) ([]Task, *http.Response, error)

func (*PreheatApiService) ManualPreheat

func (a *PreheatApiService) ManualPreheat(ctx context.Context, body PreheatPolicy, projectName string, preheatPolicyName string, localVarOptionals *PreheatApiManualPreheatOpts) (*http.Response, error)

func (*PreheatApiService) PingInstances

func (a *PreheatApiService) PingInstances(ctx context.Context, body Instance, localVarOptionals *PreheatApiPingInstancesOpts) (*http.Response, error)

func (*PreheatApiService) StopExecution

func (a *PreheatApiService) StopExecution(ctx context.Context, body Execution, projectName string, preheatPolicyName string, executionId int32, localVarOptionals *PreheatApiStopExecutionOpts) (*http.Response, error)

func (*PreheatApiService) UpdateInstance

func (a *PreheatApiService) UpdateInstance(ctx context.Context, body Instance, preheatInstanceName string, localVarOptionals *PreheatApiUpdateInstanceOpts) (InstanceUpdateResp, *http.Response, error)

func (*PreheatApiService) UpdatePolicy

func (a *PreheatApiService) UpdatePolicy(ctx context.Context, body PreheatPolicy, projectName string, preheatPolicyName string, localVarOptionals *PreheatApiUpdatePolicyOpts) (*http.Response, error)

type PreheatApiStopExecutionOpts

type PreheatApiStopExecutionOpts struct {
	XRequestId optional.String
}

type PreheatApiUpdateInstanceOpts

type PreheatApiUpdateInstanceOpts struct {
	XRequestId optional.String
}

type PreheatApiUpdatePolicyOpts

type PreheatApiUpdatePolicyOpts struct {
	XRequestId optional.String
}

type PreheatPolicy

type PreheatPolicy struct {
	// The ID of preheat policy
	Id int32 `json:"id,omitempty"`
	// The Name of preheat policy
	Name string `json:"name,omitempty"`
	// The Description of preheat policy
	Description string `json:"description,omitempty"`
	// The ID of preheat policy project
	ProjectId int32 `json:"project_id,omitempty"`
	// The ID of preheat policy provider
	ProviderId int32 `json:"provider_id,omitempty"`
	// The Name of preheat policy provider
	ProviderName string `json:"provider_name,omitempty"`
	// The Filters of preheat policy
	Filters string `json:"filters,omitempty"`
	// The Trigger of preheat policy
	Trigger string `json:"trigger,omitempty"`
	// Whether the preheat policy enabled
	Enabled bool `json:"enabled,omitempty"`
	// The Create Time of preheat policy
	CreationTime time.Time `json:"creation_time,omitempty"`
	// The Update Time of preheat policy
	UpdateTime time.Time `json:"update_time,omitempty"`
}

type ProjectApiGetLogsOpts

type ProjectApiGetLogsOpts struct {
	XRequestId optional.String
	Q          optional.String
	Page       optional.Int64
	PageSize   optional.Int64
}

type ProjectApiService

type ProjectApiService service

func (*ProjectApiService) GetLogs

func (a *ProjectApiService) GetLogs(ctx context.Context, projectName string, localVarOptionals *ProjectApiGetLogsOpts) ([]AuditLog, *http.Response, error)

type ProviderUnderProject

type ProviderUnderProject struct {
	Id       int32  `json:"id,omitempty"`
	Provider string `json:"provider,omitempty"`
}

type Reference

type Reference struct {
	// The parent ID of the reference
	ParentId int64 `json:"parent_id,omitempty"`
	// The child ID of the reference
	ChildId int64 `json:"child_id,omitempty"`
	// The digest of the child artifact
	ChildDigest string    `json:"child_digest,omitempty"`
	Platform    *Platform `json:"platform,omitempty"`
	Annotations *ModelMap `json:"annotations,omitempty"`
	// The download URLs
	Urls []string `json:"urls,omitempty"`
}

type Repository

type Repository struct {
	// The ID of the repository
	Id int64 `json:"id,omitempty"`
	// The ID of the project that the repository belongs to
	ProjectId int64 `json:"project_id,omitempty"`
	// The name of the repository
	Name string `json:"name,omitempty"`
	// The description of the repository
	Description string `json:"description,omitempty"`
	// The count of the artifacts inside the repository
	ArtifactCount int64 `json:"artifact_count,omitempty"`
	// The count that the artifact inside the repository pulled
	PullCount int64 `json:"pull_count,omitempty"`
	// The creation time of the repository
	CreationTime time.Time `json:"creation_time,omitempty"`
	// The update time of the repository
	UpdateTime time.Time `json:"update_time,omitempty"`
}

type RepositoryApiDeleteRepositoryOpts

type RepositoryApiDeleteRepositoryOpts struct {
	XRequestId optional.String
}

type RepositoryApiGetRepositoryOpts

type RepositoryApiGetRepositoryOpts struct {
	XRequestId optional.String
}

type RepositoryApiListRepositoriesOpts

type RepositoryApiListRepositoriesOpts struct {
	XRequestId optional.String
	Q          optional.String
	Page       optional.Int64
	PageSize   optional.Int64
}

type RepositoryApiService

type RepositoryApiService service

func (*RepositoryApiService) DeleteRepository

func (a *RepositoryApiService) DeleteRepository(ctx context.Context, projectName string, repositoryName string, localVarOptionals *RepositoryApiDeleteRepositoryOpts) (*http.Response, error)

func (*RepositoryApiService) GetRepository

func (a *RepositoryApiService) GetRepository(ctx context.Context, projectName string, repositoryName string, localVarOptionals *RepositoryApiGetRepositoryOpts) (Repository, *http.Response, error)

func (*RepositoryApiService) ListRepositories

func (a *RepositoryApiService) ListRepositories(ctx context.Context, projectName string, localVarOptionals *RepositoryApiListRepositoriesOpts) ([]Repository, *http.Response, error)

func (*RepositoryApiService) UpdateRepository

func (a *RepositoryApiService) UpdateRepository(ctx context.Context, body Repository, projectName string, repositoryName string, localVarOptionals *RepositoryApiUpdateRepositoryOpts) (*http.Response, error)

type RepositoryApiUpdateRepositoryOpts

type RepositoryApiUpdateRepositoryOpts struct {
	XRequestId optional.String
}

type ScanApiGetReportLogOpts

type ScanApiGetReportLogOpts struct {
	XRequestId optional.String
}

type ScanApiScanArtifactOpts

type ScanApiScanArtifactOpts struct {
	XRequestId optional.String
}

type ScanApiService

type ScanApiService service

func (*ScanApiService) GetReportLog

func (a *ScanApiService) GetReportLog(ctx context.Context, projectName string, repositoryName string, reference string, reportId string, localVarOptionals *ScanApiGetReportLogOpts) (string, *http.Response, error)

func (*ScanApiService) ScanArtifact

func (a *ScanApiService) ScanArtifact(ctx context.Context, projectName string, repositoryName string, reference string, localVarOptionals *ScanApiScanArtifactOpts) (*http.Response, error)

type Tag

type Tag struct {
	// The ID of the tag
	Id int64 `json:"id,omitempty"`
	// The ID of the repository that the tag belongs to
	RepositoryId int64 `json:"repository_id,omitempty"`
	// The ID of the artifact that the tag attached to
	ArtifactId int64 `json:"artifact_id,omitempty"`
	// The name of the tag
	Name string `json:"name,omitempty"`
	// The push time of the tag
	PushTime time.Time `json:"push_time,omitempty"`
	// The latest pull time of the tag
	PullTime time.Time `json:"pull_time,omitempty"`
	// The immutable status of the tag
	Immutable bool `json:"immutable,omitempty"`
	// The attribute indicates whether the tag is signed or not
	Signed bool `json:"signed,omitempty"`
}

type Task

type Task struct {
	// The ID of task
	Id int32 `json:"id,omitempty"`
	// The ID of task execution
	ExecutionId int32 `json:"execution_id,omitempty"`
	// The status of task
	Status string `json:"status,omitempty"`
	// The status message of task
	StatusMessage string `json:"status_message,omitempty"`
	// The count of task run
	RunCount   int32     `json:"run_count,omitempty"`
	ExtraAttrs *ModelMap `json:"extra_attrs,omitempty"`
	// The creation time of task
	CreationTime string `json:"creation_time,omitempty"`
	// The update time of task
	UpdateTime string `json:"update_time,omitempty"`
	// The start time of task
	StartTime string `json:"start_time,omitempty"`
	// The end time of task
	EndTime string `json:"end_time,omitempty"`
}

type VulnerabilitySummary

type VulnerabilitySummary struct {
	// The total number of the found vulnerabilities
	Total int32 `json:"total,omitempty"`
	// The number of the fixable vulnerabilities
	Fixable int32 `json:"fixable,omitempty"`
	// Numbers of the vulnerabilities with different severity
	Summary map[string]int32 `json:"summary,omitempty"`
}

VulnerabilitySummary contains the total number of the foun d vulnerabilities number and numbers of each severity level.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址