apiv2

package
v5.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 28 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RESTClient

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

RESTClient implements the Client interface as a REST client

func NewRESTClient

func NewRESTClient(v2Client *v2client.Harbor, opts *config.Options, authInfo runtime.ClientAuthInfoWriter) *RESTClient

NewRESTClient constructs a new REST client containing each sub client.

func NewRESTClientForHost

func NewRESTClientForHost(u, username, password string, opts *config.Options) (*RESTClient, error)

NewRESTClientForHost constructs a new REST client containing a swagger API client using the defined host string and basePath, the additional Harbor v2 API suffix as well as basic auth info.

func (*RESTClient) AddProjectMember

func (c *RESTClient) AddProjectMember(ctx context.Context, projectNameOrID string, m *modelv2.ProjectMember) error

func (*RESTClient) AddProjectMetadata

func (c *RESTClient) AddProjectMetadata(ctx context.Context, projectNameOrID string, key common.MetadataKey, value string) error

func (*RESTClient) AddProjectRobotV1

func (c *RESTClient) AddProjectRobotV1(ctx context.Context, projectNameOrID string, r *modelv2.RobotCreateV1) error

func (*RESTClient) AddProjectWebhookPolicy

func (c *RESTClient) AddProjectWebhookPolicy(ctx context.Context, projectID int, policy *modelv2.WebhookPolicy) error

func (*RESTClient) DeleteProject

func (c *RESTClient) DeleteProject(ctx context.Context, nameOrID string) error

func (*RESTClient) DeleteProjectMember

func (c *RESTClient) DeleteProjectMember(ctx context.Context, projectNameOrID string, m *modelv2.ProjectMember) error

func (*RESTClient) DeleteProjectMetadataValue

func (c *RESTClient) DeleteProjectMetadataValue(ctx context.Context, projectNameOrID string, key common.MetadataKey) error

func (*RESTClient) DeleteProjectRobotV1

func (c *RESTClient) DeleteProjectRobotV1(ctx context.Context, projectNameOrID string, robotID int64) error

func (*RESTClient) DeleteProjectWebhookPolicy

func (c *RESTClient) DeleteProjectWebhookPolicy(ctx context.Context, projectID int, policyID int64) error

func (*RESTClient) DeleteRegistryByID

func (c *RESTClient) DeleteRegistryByID(ctx context.Context, id int64) error

func (*RESTClient) DeleteReplicationPolicyByID

func (c *RESTClient) DeleteReplicationPolicyByID(ctx context.Context, id int64) error

func (*RESTClient) DeleteRepository added in v5.0.6

func (c *RESTClient) DeleteRepository(ctx context.Context, projectName, repositoryName string) error

func (*RESTClient) DeleteRetentionPolicyByID

func (c *RESTClient) DeleteRetentionPolicyByID(ctx context.Context, id int64) error

func (*RESTClient) DeleteRobotAccountByID

func (c *RESTClient) DeleteRobotAccountByID(ctx context.Context, id int64) error

func (*RESTClient) DeleteRobotAccountByName

func (c *RESTClient) DeleteRobotAccountByName(ctx context.Context, name string) error

func (*RESTClient) DeleteUser

func (c *RESTClient) DeleteUser(ctx context.Context, id int64) error

func (*RESTClient) GetCurrentUserInfo

func (c *RESTClient) GetCurrentUserInfo(ctx context.Context) (*modelv2.UserResp, error)

func (*RESTClient) GetCurrentUserPermisisons

func (c *RESTClient) GetCurrentUserPermisisons(ctx context.Context, relative bool, scope string) ([]*modelv2.Permission, error)

func (*RESTClient) GetGarbageCollectionExecution

func (c *RESTClient) GetGarbageCollectionExecution(ctx context.Context, id int64) (*modelv2.GCHistory, error)

func (*RESTClient) GetGarbageCollectionSchedule

func (c *RESTClient) GetGarbageCollectionSchedule(ctx context.Context) (*modelv2.GCHistory, error)

func (*RESTClient) GetHealth

func (*RESTClient) GetProject

func (c *RESTClient) GetProject(ctx context.Context, nameOrID string) (*modelv2.Project, error)

func (*RESTClient) GetProjectMetadataValue

func (c *RESTClient) GetProjectMetadataValue(ctx context.Context, projectNameOrID string, key common.MetadataKey) (string, error)

func (*RESTClient) GetQuotaByProjectID

func (c *RESTClient) GetQuotaByProjectID(ctx context.Context, projectID int64) (*modelv2.Quota, error)

func (*RESTClient) GetRegistryByID

func (c *RESTClient) GetRegistryByID(ctx context.Context, id int64) (*modelv2.Registry, error)

func (*RESTClient) GetRegistryByName

func (c *RESTClient) GetRegistryByName(ctx context.Context, name string) (*modelv2.Registry, error)

func (*RESTClient) GetReplicationExecutionByID

func (c *RESTClient) GetReplicationExecutionByID(ctx context.Context, id int64) (*modelv2.ReplicationExecution, error)

func (*RESTClient) GetReplicationPolicyByID

func (c *RESTClient) GetReplicationPolicyByID(ctx context.Context, id int64) (*modelv2.ReplicationPolicy, error)

func (*RESTClient) GetReplicationPolicyByName

func (c *RESTClient) GetReplicationPolicyByName(ctx context.Context, name string) (*modelv2.ReplicationPolicy, error)

func (*RESTClient) GetRepository added in v5.0.6

func (c *RESTClient) GetRepository(ctx context.Context, projectName, repositoryName string) (*modelv2.Repository, error)

func (*RESTClient) GetRetentionPolicyByID

func (c *RESTClient) GetRetentionPolicyByID(ctx context.Context, id int64) (*modelv2.RetentionPolicy, error)

func (*RESTClient) GetRetentionPolicyByProject

func (c *RESTClient) GetRetentionPolicyByProject(ctx context.Context, projectNameOrID string) (*modelv2.RetentionPolicy, error)

func (*RESTClient) GetRobotAccountByID

func (c *RESTClient) GetRobotAccountByID(ctx context.Context, id int64) (*modelv2.Robot, error)

func (*RESTClient) GetRobotAccountByName

func (c *RESTClient) GetRobotAccountByName(ctx context.Context, name string) (*modelv2.Robot, error)

func (*RESTClient) GetSystemInfo

func (c *RESTClient) GetSystemInfo(ctx context.Context) (*modelv2.GeneralInfo, error)

func (*RESTClient) GetUserByID

func (c *RESTClient) GetUserByID(ctx context.Context, id int64) (*modelv2.UserResp, error)

func (*RESTClient) GetUserByName

func (c *RESTClient) GetUserByName(ctx context.Context, username string) (*modelv2.UserResp, error)

func (*RESTClient) ListAllRepositories added in v5.0.6

func (c *RESTClient) ListAllRepositories(ctx context.Context) ([]*modelv2.Repository, error)

func (*RESTClient) ListArtifacts added in v5.0.8

func (c *RESTClient) ListArtifacts(ctx context.Context, projectName, repositoryName string) ([]*modelv2.Artifact, error)

func (*RESTClient) ListAuditLogs

func (c *RESTClient) ListAuditLogs(ctx context.Context) ([]*modelv2.AuditLog, error)

func (*RESTClient) ListProjectMembers

func (c *RESTClient) ListProjectMembers(ctx context.Context, projectNameOrID, memberQuery string) ([]*modelv2.ProjectMemberEntity, error)

func (*RESTClient) ListProjectMetadata

func (c *RESTClient) ListProjectMetadata(ctx context.Context, projectNameOrID string) (map[string]string, error)

func (*RESTClient) ListProjectRobotsV1

func (c *RESTClient) ListProjectRobotsV1(ctx context.Context, projectNameOrID string) ([]*modelv2.Robot, error)

func (*RESTClient) ListProjectWebhookPolicies

func (c *RESTClient) ListProjectWebhookPolicies(ctx context.Context, projectID int) ([]*modelv2.WebhookPolicy, error)

func (*RESTClient) ListProjects

func (c *RESTClient) ListProjects(ctx context.Context, nameFilter string) ([]*modelv2.Project, error)

func (*RESTClient) ListQuotas

func (c *RESTClient) ListQuotas(ctx context.Context, referenceType, referenceID *string) ([]*modelv2.Quota, error)

func (*RESTClient) ListRegistries

func (c *RESTClient) ListRegistries(ctx context.Context) ([]*modelv2.Registry, error)

func (*RESTClient) ListReplicationExecutions

func (c *RESTClient) ListReplicationExecutions(ctx context.Context, policyID *int64, status, trigger *string) ([]*modelv2.ReplicationExecution, error)

func (*RESTClient) ListReplicationPolicies

func (c *RESTClient) ListReplicationPolicies(ctx context.Context) ([]*modelv2.ReplicationPolicy, error)

func (*RESTClient) ListRepositories added in v5.0.6

func (c *RESTClient) ListRepositories(ctx context.Context, projectName string) ([]*modelv2.Repository, error)

func (*RESTClient) ListRobotAccounts

func (c *RESTClient) ListRobotAccounts(ctx context.Context) ([]*modelv2.Robot, error)

func (*RESTClient) ListUsers

func (c *RESTClient) ListUsers(ctx context.Context) ([]*modelv2.UserResp, error)

func (*RESTClient) NewGarbageCollection

func (c *RESTClient) NewGarbageCollection(ctx context.Context, gcSchedule *modelv2.Schedule) error

func (*RESTClient) NewProject

func (c *RESTClient) NewProject(ctx context.Context, projectRequest *modelv2.ProjectReq) error

func (*RESTClient) NewRegistry

func (c *RESTClient) NewRegistry(ctx context.Context, reg *modelv2.Registry) error

func (*RESTClient) NewReplicationPolicy

func (c *RESTClient) NewReplicationPolicy(ctx context.Context, destRegistry, srcRegistry *modelv2.Registry,
	replicateDeletion, override, enablePolicy bool,
	filters []*modelv2.ReplicationFilter, trigger *modelv2.ReplicationTrigger,
	destNamespace, description, name string) error

func (*RESTClient) NewRetentionPolicy

func (c *RESTClient) NewRetentionPolicy(ctx context.Context, ret *modelv2.RetentionPolicy) error

func (*RESTClient) NewRobotAccount

func (c *RESTClient) NewRobotAccount(ctx context.Context, r *modelv2.RobotCreate) error

func (*RESTClient) NewUser

func (c *RESTClient) NewUser(ctx context.Context, username, email, realname, password, comments string) error

func (*RESTClient) ProjectExists

func (c *RESTClient) ProjectExists(ctx context.Context, nameOrID string) (bool, error)

func (*RESTClient) RefreshRobotAccountSecretByID

func (c *RESTClient) RefreshRobotAccountSecretByID(ctx context.Context, id int64, sec string) (*modelv2.RobotSec, error)

func (*RESTClient) RefreshRobotAccountSecretByName

func (c *RESTClient) RefreshRobotAccountSecretByName(ctx context.Context, name string, sec string) (*modelv2.RobotSec, error)

func (*RESTClient) ResetGarbageCollection

func (c *RESTClient) ResetGarbageCollection(ctx context.Context) error

func (*RESTClient) SearchUsers

func (c *RESTClient) SearchUsers(ctx context.Context, name string) ([]*modelv2.UserSearchRespItem, error)

func (*RESTClient) SetUserSysAdmin

func (c *RESTClient) SetUserSysAdmin(ctx context.Context, id int64, admin bool) error

func (*RESTClient) TriggerReplicationExecution

func (c *RESTClient) TriggerReplicationExecution(ctx context.Context, r *modelv2.StartReplicationExecution) error

func (*RESTClient) UpdateGarbageCollection

func (c *RESTClient) UpdateGarbageCollection(ctx context.Context, newGCSchedule *modelv2.Schedule) error

func (*RESTClient) UpdateProject

func (c *RESTClient) UpdateProject(ctx context.Context, p *modelv2.Project, storageLimit *int64) error

func (*RESTClient) UpdateProjectMember

func (c *RESTClient) UpdateProjectMember(ctx context.Context, projectNameOrID string, m *modelv2.ProjectMember) error

func (*RESTClient) UpdateProjectMetadata

func (c *RESTClient) UpdateProjectMetadata(ctx context.Context, projectNameOrID string, key common.MetadataKey, value string) error

func (*RESTClient) UpdateProjectRobotV1

func (c *RESTClient) UpdateProjectRobotV1(ctx context.Context, projectNameOrID string, robotID int64, r *modelv2.Robot) error

func (*RESTClient) UpdateProjectWebhookPolicy

func (c *RESTClient) UpdateProjectWebhookPolicy(ctx context.Context, projectID int, policy *modelv2.WebhookPolicy) error

func (*RESTClient) UpdateRegistry

func (c *RESTClient) UpdateRegistry(ctx context.Context, u *modelv2.RegistryUpdate, id int64) error

func (*RESTClient) UpdateReplicationPolicy

func (c *RESTClient) UpdateReplicationPolicy(ctx context.Context, r *modelv2.ReplicationPolicy, id int64) error

func (*RESTClient) UpdateRepository added in v5.0.6

func (c *RESTClient) UpdateRepository(ctx context.Context, projectName, repositoryName string, update *modelv2.Repository) error

func (*RESTClient) UpdateRetentionPolicy

func (c *RESTClient) UpdateRetentionPolicy(ctx context.Context, ret *modelv2.RetentionPolicy) error

func (*RESTClient) UpdateRobotAccount

func (c *RESTClient) UpdateRobotAccount(ctx context.Context, r *modelv2.Robot) error

func (*RESTClient) UpdateStorageQuotaByProjectID

func (c *RESTClient) UpdateStorageQuotaByProjectID(ctx context.Context, projectID int64, storageLimit int64) error

func (*RESTClient) UpdateUserPassword

func (c *RESTClient) UpdateUserPassword(ctx context.Context, userID int64, passwordRequest *modelv2.PasswordReq) error

func (*RESTClient) UpdateUserProfile

func (c *RESTClient) UpdateUserProfile(ctx context.Context, id int64, profile *modelv2.UserProfile) error

func (*RESTClient) UserExists

func (c *RESTClient) UserExists(ctx context.Context, idOrName intstr.IntOrString) (bool, error)

Jump to

Keyboard shortcuts

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