api

package
v1.8.6-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 71 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ReplicationJobType ...
	ReplicationJobType = "replication"
	// ScanJobType ...
	ScanJobType = "scan"
)
View Source
const (
	// PriPC : count of private projects
	PriPC = "private_project_count"
	// PriRC : count of private repositories
	PriRC = "private_repo_count"
	// PubPC : count of public projects
	PubPC = "public_project_count"
	// PubRC : count of public repositories
	PubRC = "public_repo_count"
	// TPC : total count of projects
	TPC = "total_project_count"
	// TRC : total count of repositories
	TRC = "total_repo_count"
)

Variables

View Source
var ErrDuplicateProjectMember = errors.New("The project member specified already exist")

ErrDuplicateProjectMember ...

View Source
var ErrInvalidRole = errors.New("Failed to update project member, role is not in 1,2,3")

ErrInvalidRole ...

Functions

func AddProjectMember

func AddProjectMember(projectID int64, request models.MemberReq) (int, error)

AddProjectMember ...

func HTTPStatusCodeHealthChecker added in v1.8.0

func HTTPStatusCodeHealthChecker(method string, url string, header http.Header,
	timeout time.Duration, statusCode int) health.Checker

HTTPStatusCodeHealthChecker implements a Checker to check that the HTTP status code returned matches the expected one

func Init

func Init() error

Init related objects/configurations for the API controllers

func PeriodicHealthChecker added in v1.8.0

func PeriodicHealthChecker(checker health.Checker, period time.Duration) health.Checker

PeriodicHealthChecker implements a Checker to check status periodically

func SyncRegistry

func SyncRegistry(pm promgr.ProjectManager) error

SyncRegistry syncs the repositories of registry with database.

Types

type AJAPI added in v1.8.0

type AJAPI struct {
	BaseController
}

AJAPI manages the CRUD of admin job and its schedule, any API wants to handle manual and cron job like ScanAll and GC cloud reuse it.

func (*AJAPI) Prepare added in v1.8.0

func (aj *AJAPI) Prepare()

Prepare validates the URL and parms, it needs the system admin permission.

type BaseController

type BaseController struct {
	api.BaseAPI
	// SecurityCtx is the security context used to authN &authZ
	SecurityCtx security.Context
	// ProjectMgr is the project manager which abstracts the operations
	// related to projects
	ProjectMgr promgr.ProjectManager
}

BaseController ...

func (*BaseController) HasProjectPermission added in v1.8.3

func (b *BaseController) HasProjectPermission(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) (bool, error)

HasProjectPermission returns true when the request has action permission on project subresource

func (*BaseController) Prepare

func (b *BaseController) Prepare()

Prepare inits security context and project manager from request context

func (*BaseController) RequireAuthenticated added in v1.8.3

func (b *BaseController) RequireAuthenticated() bool

RequireAuthenticated returns true when the request is authenticated otherwise send Unauthorized response and returns false

func (*BaseController) RequireProjectAccess added in v1.8.3

func (b *BaseController) RequireProjectAccess(projectIDOrName interface{}, action rbac.Action, subresource ...rbac.Resource) bool

RequireProjectAccess returns true when the request has action access on project subresource otherwise send UnAuthorized or Forbidden response and returns false

func (*BaseController) WriteJSONData

func (b *BaseController) WriteJSONData(object interface{})

WriteJSONData writes the JSON data to the client.

func (*BaseController) WriteYamlData

func (b *BaseController) WriteYamlData(object interface{})

WriteYamlData writes the yaml data to the client.

type ChartLabelAPI

type ChartLabelAPI struct {
	LabelResourceAPI
	// contains filtered or unexported fields
}

ChartLabelAPI handles the requests of marking/removing lables to/from charts.

func (*ChartLabelAPI) GetLabels

func (cla *ChartLabelAPI) GetLabels()

GetLabels gets labels for the specified chart version.

func (*ChartLabelAPI) MarkLabel

func (cla *ChartLabelAPI) MarkLabel()

MarkLabel handles the request of marking label to chart.

func (*ChartLabelAPI) Prepare

func (cla *ChartLabelAPI) Prepare()

Prepare required material for follow-up actions.

func (*ChartLabelAPI) RemoveLabel

func (cla *ChartLabelAPI) RemoveLabel()

RemoveLabel handles the request of removing label from chart.

type ChartRepositoryAPI

type ChartRepositoryAPI struct {
	// The base controller to provide common utilities
	BaseController
	// contains filtered or unexported fields
}

ChartRepositoryAPI provides related API handlers for the chart repository APIs

func (*ChartRepositoryAPI) DeleteChart

func (cra *ChartRepositoryAPI) DeleteChart()

DeleteChart deletes all the chart versions of the specified chart.

func (*ChartRepositoryAPI) DeleteChartVersion

func (cra *ChartRepositoryAPI) DeleteChartVersion()

DeleteChartVersion handles DELETE /api/:repo/charts/:name/:version

func (*ChartRepositoryAPI) DownloadChart

func (cra *ChartRepositoryAPI) DownloadChart()

DownloadChart handles GET /:repo/charts/:filename

func (*ChartRepositoryAPI) GetChartVersion

func (cra *ChartRepositoryAPI) GetChartVersion()

GetChartVersion handles GET /api/:repo/charts/:name/:version

func (*ChartRepositoryAPI) GetHealthStatus

func (cra *ChartRepositoryAPI) GetHealthStatus()

GetHealthStatus handles GET /api/chartrepo/health

func (*ChartRepositoryAPI) GetIndex

func (cra *ChartRepositoryAPI) GetIndex()

GetIndex handles GET /index.yaml

func (*ChartRepositoryAPI) GetIndexByRepo

func (cra *ChartRepositoryAPI) GetIndexByRepo()

GetIndexByRepo handles GET /:repo/index.yaml

func (*ChartRepositoryAPI) ListChartVersions

func (cra *ChartRepositoryAPI) ListChartVersions()

ListChartVersions GET /api/:repo/charts/:name

func (*ChartRepositoryAPI) ListCharts

func (cra *ChartRepositoryAPI) ListCharts()

ListCharts handles GET /api/:repo/charts

func (*ChartRepositoryAPI) Prepare

func (cra *ChartRepositoryAPI) Prepare()

Prepare something for the following actions

func (*ChartRepositoryAPI) UploadChartProvFile

func (cra *ChartRepositoryAPI) UploadChartProvFile()

UploadChartProvFile handles POST /api/:repo/prov

func (*ChartRepositoryAPI) UploadChartVersion

func (cra *ChartRepositoryAPI) UploadChartVersion()

UploadChartVersion handles POST /api/:repo/charts

type ConfigAPI

type ConfigAPI struct {
	BaseController
	// contains filtered or unexported fields
}

ConfigAPI ...

func (*ConfigAPI) Get

func (c *ConfigAPI) Get()

Get returns configurations

func (*ConfigAPI) GetInternalConfig

func (c *ConfigAPI) GetInternalConfig()

GetInternalConfig returns internal configurations

func (*ConfigAPI) Prepare

func (c *ConfigAPI) Prepare()

Prepare validates the user

func (*ConfigAPI) Put

func (c *ConfigAPI) Put()

Put updates configurations

type EmailAPI

type EmailAPI struct {
	BaseController
}

EmailAPI ...

func (*EmailAPI) Ping

func (e *EmailAPI) Ping()

Ping tests connection and authentication with email server

func (*EmailAPI) Prepare

func (e *EmailAPI) Prepare()

Prepare ...

type GCAPI

type GCAPI struct {
	AJAPI
}

GCAPI handles request of harbor GC...

func (*GCAPI) Get

func (gc *GCAPI) Get()

Get gets GC schedule ...

func (*GCAPI) GetGC

func (gc *GCAPI) GetGC()

GetGC ...

func (*GCAPI) GetLog

func (gc *GCAPI) GetLog()

GetLog ...

func (*GCAPI) List

func (gc *GCAPI) List()

List returns the top 10 executions of GC which includes manual and cron.

func (*GCAPI) Post

func (gc *GCAPI) Post()

Post according to the request, it creates a cron schedule or a manual trigger for GC. create a daily schedule for GC

	{
 "schedule": {
   "type": "Daily",
   "cron": "0 0 0 * * *"
 }
	}

create a manual trigger for GC

	{
 "schedule": {
   "type": "Manual"
 }
	}

func (*GCAPI) Prepare

func (gc *GCAPI) Prepare()

Prepare validates the URL and parms, it needs the system admin permission.

func (*GCAPI) Put

func (gc *GCAPI) Put()

Put handles GC cron schedule update/delete. Request: delete the schedule of GC

	{
 "schedule": {
   "type": "None",
   "cron": ""
 }
	}

type GeneralInfo

type GeneralInfo struct {
	WithNotary                  bool                             `json:"with_notary"`
	WithClair                   bool                             `json:"with_clair"`
	WithAdmiral                 bool                             `json:"with_admiral"`
	AdmiralEndpoint             string                           `json:"admiral_endpoint"`
	AuthMode                    string                           `json:"auth_mode"`
	AuthProxySettings           *models.HTTPAuthProxy            `json:"authproxy_settings,omitempty"`
	RegistryURL                 string                           `json:"registry_url"`
	ExtURL                      string                           `json:"external_url"`
	ProjectCreationRestrict     string                           `json:"project_creation_restriction"`
	SelfRegistration            bool                             `json:"self_registration"`
	HasCARoot                   bool                             `json:"has_ca_root"`
	HarborVersion               string                           `json:"harbor_version"`
	ClairVulnStatus             *models.ClairVulnerabilityStatus `json:"clair_vulnerability_status,omitempty"`
	RegistryStorageProviderName string                           `json:"registry_storage_provider_name"`
	ReadOnly                    bool                             `json:"read_only"`
	WithChartMuseum             bool                             `json:"with_chartmuseum"`
}

GeneralInfo wraps common systeminfo for anonymous request

type HealthAPI added in v1.8.0

type HealthAPI struct {
	BaseController
}

HealthAPI handles the request for "/api/health"

func (*HealthAPI) CheckHealth added in v1.8.0

func (h *HealthAPI) CheckHealth()

CheckHealth checks the health of system

type InternalAPI

type InternalAPI struct {
	BaseController
}

InternalAPI handles request of harbor admin...

func (*InternalAPI) Prepare

func (ia *InternalAPI) Prepare()

Prepare validates the URL and parms

func (*InternalAPI) RenameAdmin

func (ia *InternalAPI) RenameAdmin()

RenameAdmin we don't provide flexibility in this API, as this is a workaround.

func (*InternalAPI) SyncRegistry

func (ia *InternalAPI) SyncRegistry()

SyncRegistry ...

type LabelAPI

type LabelAPI struct {
	BaseController
	// contains filtered or unexported fields
}

LabelAPI handles requests for label management

func (*LabelAPI) Delete

func (l *LabelAPI) Delete()

Delete the label

func (*LabelAPI) Get

func (l *LabelAPI) Get()

Get the label specified by ID

func (*LabelAPI) List

func (l *LabelAPI) List()

List labels according to the query strings

func (*LabelAPI) ListResources

func (l *LabelAPI) ListResources()

ListResources lists the resources that the label is referenced by

func (*LabelAPI) Post

func (l *LabelAPI) Post()

Post creates a label

func (*LabelAPI) Prepare

func (l *LabelAPI) Prepare()

Prepare ...

func (*LabelAPI) Put

func (l *LabelAPI) Put()

Put updates the label

type LabelResourceAPI

type LabelResourceAPI struct {
	BaseController
	// contains filtered or unexported fields
}

LabelResourceAPI provides the related basic functions to handle marking labels to resources

func (*LabelResourceAPI) Prepare

func (lra *LabelResourceAPI) Prepare()

Prepare resources for follow-up actions.

type LdapAPI

type LdapAPI struct {
	BaseController
	// contains filtered or unexported fields
}

LdapAPI handles requesst to /api/ldap/ping /api/ldap/user/search /api/ldap/user/import

func (*LdapAPI) ImportUser

func (l *LdapAPI) ImportUser()

ImportUser ...

func (*LdapAPI) Ping

func (l *LdapAPI) Ping()

Ping ...

func (*LdapAPI) Prepare

func (l *LdapAPI) Prepare()

Prepare ...

func (*LdapAPI) Search

func (l *LdapAPI) Search()

Search ...

func (*LdapAPI) SearchGroup

func (l *LdapAPI) SearchGroup()

SearchGroup ... Search LDAP by groupname

type LogAPI

type LogAPI struct {
	BaseController
	// contains filtered or unexported fields
}

LogAPI handles request api/logs

func (*LogAPI) Get

func (l *LogAPI) Get()

Get returns the recent logs according to parameters

func (*LogAPI) Prepare

func (l *LogAPI) Prepare()

Prepare validates the URL and the user

type MetadataAPI

type MetadataAPI struct {
	BaseController
	// contains filtered or unexported fields
}

MetadataAPI ...

func (*MetadataAPI) Delete

func (m *MetadataAPI) Delete()

Delete ...

func (*MetadataAPI) Get

func (m *MetadataAPI) Get()

Get ...

func (*MetadataAPI) Post

func (m *MetadataAPI) Post()

Post ...

func (*MetadataAPI) Prepare

func (m *MetadataAPI) Prepare()

Prepare ...

func (*MetadataAPI) Put

func (m *MetadataAPI) Put()

Put ...

type ProjectAPI

type ProjectAPI struct {
	BaseController
	// contains filtered or unexported fields
}

ProjectAPI handles request to /api/projects/{} /api/projects/{}/logs

func (*ProjectAPI) Deletable

func (p *ProjectAPI) Deletable()

Deletable ...

func (*ProjectAPI) Delete

func (p *ProjectAPI) Delete()

Delete ...

func (*ProjectAPI) Get

func (p *ProjectAPI) Get()

Get ...

func (*ProjectAPI) Head

func (p *ProjectAPI) Head()

Head ...

func (*ProjectAPI) List

func (p *ProjectAPI) List()

List ...

func (*ProjectAPI) Logs

func (p *ProjectAPI) Logs()

Logs ...

func (*ProjectAPI) Post

func (p *ProjectAPI) Post()

Post ...

func (*ProjectAPI) Prepare

func (p *ProjectAPI) Prepare()

Prepare validates the URL and the user

func (*ProjectAPI) Put

func (p *ProjectAPI) Put()

Put ...

type ProjectMemberAPI

type ProjectMemberAPI struct {
	BaseController
	// contains filtered or unexported fields
}

ProjectMemberAPI handles request to /api/projects/{}/members/{}

func (*ProjectMemberAPI) Delete

func (pma *ProjectMemberAPI) Delete()

Delete ...

func (*ProjectMemberAPI) Get

func (pma *ProjectMemberAPI) Get()

Get ...

func (*ProjectMemberAPI) Post

func (pma *ProjectMemberAPI) Post()

Post ... Add a project member

func (*ProjectMemberAPI) Prepare

func (pma *ProjectMemberAPI) Prepare()

Prepare validates the URL and parms

func (*ProjectMemberAPI) Put

func (pma *ProjectMemberAPI) Put()

Put ... Update an exist project member

type RegistryAPI added in v1.8.0

type RegistryAPI struct {
	BaseController
	// contains filtered or unexported fields
}

RegistryAPI handles requests to /api/registries/{}. It manages registries integrated to Harbor.

func (*RegistryAPI) Delete added in v1.8.0

func (t *RegistryAPI) Delete()

Delete deletes a registry

func (*RegistryAPI) Get added in v1.8.0

func (t *RegistryAPI) Get()

Get gets a registry by id.

func (*RegistryAPI) GetInfo added in v1.8.0

func (t *RegistryAPI) GetInfo()

GetInfo returns the base info and capability declarations of the registry

func (*RegistryAPI) GetNamespace added in v1.8.0

func (t *RegistryAPI) GetNamespace()

GetNamespace get the namespace of a registry TODO remove

func (*RegistryAPI) List added in v1.8.0

func (t *RegistryAPI) List()

List lists all registries that match a given registry name.

func (*RegistryAPI) Ping added in v1.8.0

func (t *RegistryAPI) Ping()

Ping checks health status of a registry

func (*RegistryAPI) Post added in v1.8.0

func (t *RegistryAPI) Post()

Post creates a registry

func (*RegistryAPI) Prepare added in v1.8.0

func (t *RegistryAPI) Prepare()

Prepare validates the user

func (*RegistryAPI) Put added in v1.8.0

func (t *RegistryAPI) Put()

Put updates a registry

type ReplicationAdapterAPI added in v1.8.0

type ReplicationAdapterAPI struct {
	BaseController
}

ReplicationAdapterAPI handles the replication adapter requests

func (*ReplicationAdapterAPI) List added in v1.8.0

func (r *ReplicationAdapterAPI) List()

List the replication adapters

func (*ReplicationAdapterAPI) Prepare added in v1.8.0

func (r *ReplicationAdapterAPI) Prepare()

Prepare ...

type ReplicationOperationAPI added in v1.8.0

type ReplicationOperationAPI struct {
	BaseController
	// contains filtered or unexported fields
}

ReplicationOperationAPI handles the replication operation requests

func (*ReplicationOperationAPI) CreateExecution added in v1.8.0

func (r *ReplicationOperationAPI) CreateExecution()

CreateExecution starts a replication

func (*ReplicationOperationAPI) GetExecution added in v1.8.0

func (r *ReplicationOperationAPI) GetExecution()

GetExecution gets one execution of the replication

func (*ReplicationOperationAPI) GetTaskLog added in v1.8.0

func (r *ReplicationOperationAPI) GetTaskLog()

GetTaskLog ...

func (*ReplicationOperationAPI) ListExecutions added in v1.8.0

func (r *ReplicationOperationAPI) ListExecutions()

ListExecutions ...

func (*ReplicationOperationAPI) ListTasks added in v1.8.0

func (r *ReplicationOperationAPI) ListTasks()

ListTasks ...

func (*ReplicationOperationAPI) Prepare added in v1.8.0

func (r *ReplicationOperationAPI) Prepare()

Prepare ...

func (*ReplicationOperationAPI) StopExecution added in v1.8.0

func (r *ReplicationOperationAPI) StopExecution()

StopExecution stops one execution of the replication

type ReplicationPolicyAPI added in v1.8.0

type ReplicationPolicyAPI struct {
	BaseController
}

ReplicationPolicyAPI handles the replication policy requests

func (*ReplicationPolicyAPI) Create added in v1.8.0

func (r *ReplicationPolicyAPI) Create()

Create the replication policy

func (*ReplicationPolicyAPI) Delete added in v1.8.0

func (r *ReplicationPolicyAPI) Delete()

Delete the replication policy

func (*ReplicationPolicyAPI) Get added in v1.8.0

func (r *ReplicationPolicyAPI) Get()

Get the specified replication policy

func (*ReplicationPolicyAPI) List added in v1.8.0

func (r *ReplicationPolicyAPI) List()

List the replication policies

func (*ReplicationPolicyAPI) Prepare added in v1.8.0

func (r *ReplicationPolicyAPI) Prepare()

Prepare ...

func (*ReplicationPolicyAPI) Update added in v1.8.0

func (r *ReplicationPolicyAPI) Update()

Update the replication policy

type RepositoryAPI

type RepositoryAPI struct {
	BaseController
}

RepositoryAPI handles request to /api/repositories /api/repositories/tags /api/repositories/manifests, the parm has to be put in the query string as the web framework can not parse the URL if it contains veriadic sectors.

func (*RepositoryAPI) Delete

func (ra *RepositoryAPI) Delete()

Delete ...

func (*RepositoryAPI) Get

func (ra *RepositoryAPI) Get()

Get ...

func (*RepositoryAPI) GetManifests

func (ra *RepositoryAPI) GetManifests()

GetManifests returns the manifest of a tag

func (*RepositoryAPI) GetSignatures

func (ra *RepositoryAPI) GetSignatures()

GetSignatures returns signatures of a repository

func (*RepositoryAPI) GetTag

func (ra *RepositoryAPI) GetTag()

GetTag returns the tag of a repository

func (*RepositoryAPI) GetTags

func (ra *RepositoryAPI) GetTags()

GetTags returns tags of a repository

func (*RepositoryAPI) GetTopRepos

func (ra *RepositoryAPI) GetTopRepos()

GetTopRepos returns the most populor repositories

func (*RepositoryAPI) Put

func (ra *RepositoryAPI) Put()

Put updates description info for the repository

func (*RepositoryAPI) Retag

func (ra *RepositoryAPI) Retag()

Retag tags an existing image to another tag in this repo, the source image is specified by request body.

func (*RepositoryAPI) ScanImage

func (ra *RepositoryAPI) ScanImage()

ScanImage handles request POST /api/repository/$repository/tags/$tag/scan to trigger image scan manually.

func (*RepositoryAPI) VulnerabilityDetails

func (ra *RepositoryAPI) VulnerabilityDetails()

VulnerabilityDetails fetch vulnerability info from clair, transform to Harbor's format and return to client.

type RepositoryLabelAPI

type RepositoryLabelAPI struct {
	LabelResourceAPI
	// contains filtered or unexported fields
}

RepositoryLabelAPI handles requests for adding/removing label to/from repositories and images

func (*RepositoryLabelAPI) AddToImage

func (r *RepositoryLabelAPI) AddToImage()

AddToImage adds the label to an image

func (*RepositoryLabelAPI) AddToRepository

func (r *RepositoryLabelAPI) AddToRepository()

AddToRepository adds the label to a repository

func (*RepositoryLabelAPI) GetOfImage

func (r *RepositoryLabelAPI) GetOfImage()

GetOfImage returns labels of an image

func (*RepositoryLabelAPI) GetOfRepository

func (r *RepositoryLabelAPI) GetOfRepository()

GetOfRepository returns labels of a repository

func (*RepositoryLabelAPI) Prepare

func (r *RepositoryLabelAPI) Prepare()

Prepare ...

func (*RepositoryLabelAPI) RemoveFromImage

func (r *RepositoryLabelAPI) RemoveFromImage()

RemoveFromImage removes the label from an image

func (*RepositoryLabelAPI) RemoveFromRepository

func (r *RepositoryLabelAPI) RemoveFromRepository()

RemoveFromRepository removes the label from a repository

type RobotAPI added in v1.8.0

type RobotAPI struct {
	BaseController
	// contains filtered or unexported fields
}

RobotAPI ...

func (*RobotAPI) Delete added in v1.8.0

func (r *RobotAPI) Delete()

Delete delete robot by id

func (*RobotAPI) Get added in v1.8.0

func (r *RobotAPI) Get()

Get get robot by id

func (*RobotAPI) List added in v1.8.0

func (r *RobotAPI) List()

List list all the robots of a project

func (*RobotAPI) Post added in v1.8.0

func (r *RobotAPI) Post()

Post ...

func (*RobotAPI) Prepare added in v1.8.0

func (r *RobotAPI) Prepare()

Prepare ...

func (*RobotAPI) Put added in v1.8.0

func (r *RobotAPI) Put()

Put disable or enable a robot account

type ScanAllAPI added in v1.8.0

type ScanAllAPI struct {
	AJAPI
}

ScanAllAPI handles request of scan all images...

func (*ScanAllAPI) Get added in v1.8.0

func (sc *ScanAllAPI) Get()

Get gets scan all schedule ...

func (*ScanAllAPI) List added in v1.8.0

func (sc *ScanAllAPI) List()

List returns the top 10 executions of scan all which includes manual and cron.

func (*ScanAllAPI) Post added in v1.8.0

func (sc *ScanAllAPI) Post()

Post according to the request, it creates a cron schedule or a manual trigger for scan all. create a daily schedule for scan all

	{
 "schedule": {
   "type": "Daily",
   "cron": "0 0 0 * * *"
 }
	}

create a manual trigger for scan all

	{
 "schedule": {
   "type": "Manual"
 }
	}

func (*ScanAllAPI) Prepare added in v1.8.0

func (sc *ScanAllAPI) Prepare()

Prepare validates the URL and parms, it needs the system admin permission.

func (*ScanAllAPI) Put added in v1.8.0

func (sc *ScanAllAPI) Put()

Put handles scan all cron schedule update/delete. Request: delete the schedule of scan all

	{
 "schedule": {
   "type": "None",
   "cron": ""
 }
	}

type ScanJobAPI

type ScanJobAPI struct {
	BaseController
	// contains filtered or unexported fields
}

ScanJobAPI handles request to /api/scanJobs/:id/log

func (*ScanJobAPI) GetLog

func (sj *ScanJobAPI) GetLog()

GetLog ...

func (*ScanJobAPI) Prepare

func (sj *ScanJobAPI) Prepare()

Prepare validates that whether user has read permission to the project of the repo the scan job scanned.

type SearchAPI

type SearchAPI struct {
	BaseController
}

SearchAPI handles request to /api/search

func (*SearchAPI) Get

func (s *SearchAPI) Get()

Get ...

type StatisticAPI

type StatisticAPI struct {
	BaseController
	// contains filtered or unexported fields
}

StatisticAPI handles request to /api/statistics/

func (*StatisticAPI) Get

func (s *StatisticAPI) Get()

Get total projects and repos of the user

func (*StatisticAPI) Prepare

func (s *StatisticAPI) Prepare()

Prepare validates the URL and the user

type Storage

type Storage struct {
	Total uint64 `json:"total"`
	Free  uint64 `json:"free"`
}

Storage models for storage.

type SystemInfo

type SystemInfo struct {
	HarborStorage Storage `json:"storage"`
}

SystemInfo models for system info.

type SystemInfoAPI

type SystemInfoAPI struct {
	BaseController
}

SystemInfoAPI handle requests for getting system info /api/systeminfo

func (*SystemInfoAPI) GetCert

func (sia *SystemInfoAPI) GetCert()

GetCert gets default self-signed certificate.

func (*SystemInfoAPI) GetGeneralInfo

func (sia *SystemInfoAPI) GetGeneralInfo()

GetGeneralInfo returns the general system info, which is to be called by anonymous user

func (*SystemInfoAPI) GetVolumeInfo

func (sia *SystemInfoAPI) GetVolumeInfo()

GetVolumeInfo gets specific volume storage info.

func (*SystemInfoAPI) Ping

func (sia *SystemInfoAPI) Ping()

Ping ping the harbor core service.

type UserAPI

type UserAPI struct {
	BaseController

	SelfRegistration bool
	IsAdmin          bool
	AuthMode         string
	// contains filtered or unexported fields
}

UserAPI handles request to /api/users/{}

func (*UserAPI) ChangePassword

func (ua *UserAPI) ChangePassword()

ChangePassword handles PUT to /api/users/{}/password

func (*UserAPI) Delete

func (ua *UserAPI) Delete()

Delete ...

func (*UserAPI) GenCLISecret added in v1.8.0

func (ua *UserAPI) GenCLISecret()

GenCLISecret generates a new CLI secret and replace the old one

func (*UserAPI) Get

func (ua *UserAPI) Get()

Get ...

func (*UserAPI) List

func (ua *UserAPI) List()

List ...

func (*UserAPI) ListUserPermissions added in v1.8.0

func (ua *UserAPI) ListUserPermissions()

ListUserPermissions handles GET to /api/users/{}/permissions

func (*UserAPI) Post

func (ua *UserAPI) Post()

Post ...

func (*UserAPI) Prepare

func (ua *UserAPI) Prepare()

Prepare validates the URL and parms

func (*UserAPI) Put

func (ua *UserAPI) Put()

Put ...

func (*UserAPI) Search added in v1.8.0

func (ua *UserAPI) Search()

Search ...

func (*UserAPI) ToggleUserAdminRole

func (ua *UserAPI) ToggleUserAdminRole()

ToggleUserAdminRole handles PUT api/users/{}/sysadmin

type UserGroupAPI

type UserGroupAPI struct {
	BaseController
	// contains filtered or unexported fields
}

UserGroupAPI ...

func (*UserGroupAPI) Delete

func (uga *UserGroupAPI) Delete()

Delete ...

func (*UserGroupAPI) Get

func (uga *UserGroupAPI) Get()

Get ...

func (*UserGroupAPI) Post

func (uga *UserGroupAPI) Post()

Post ... Create User Group

func (*UserGroupAPI) Prepare

func (uga *UserGroupAPI) Prepare()

Prepare validates the URL and parms

func (*UserGroupAPI) Put

func (uga *UserGroupAPI) Put()

Put ... Only support update name

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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