system

package
v5.0.0-...-5bc921f Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrSystemInvalidScheduleMsg describes an invalid schedule type request
	ErrSystemInvalidScheduleMsg = "invalid schedule type"

	// ErrSystemGcInProgressMsg describes that a gc progress is already running
	ErrSystemGcInProgressMsg = "the system is already running a gc job"

	// ErrSystemUnauthorizedMsg describes an unauthorized request
	ErrSystemUnauthorizedMsg = "unauthorized"

	// ErrSystemInternalErrorsMsg describes server-side internal errors
	ErrSystemInternalErrorsMsg = "unexpected internal errors"

	// ErrSystemNoPermissionMsg describes a request error without permission
	ErrSystemNoPermissionMsg = "user does not have permission to the System"

	// ErrSystemGcUndefinedMsg describes a server-side response returning an empty GC schedule
	ErrSystemGcUndefinedMsg = "no schedule defined"

	// ErrSystemGcScheduleIdenticalMsg describes equality between two GC schedules
	ErrSystemGcScheduleIdenticalMsg = "the provided schedule is identical to the existing schedule"

	// ErrSystemGcScheduleNotProvidedMsg describes the absence of a required schedule
	ErrSystemGcScheduleNotProvidedMsg = "no schedule provided"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	NewSystemGarbageCollection(ctx context.Context, cron, scheduleType string) (*model.AdminJobSchedule, error)
	UpdateSystemGarbageCollection(ctx context.Context, newGcSchedule *model.AdminJobScheduleObj) error
	GetSystemGarbageCollection(ctx context.Context) (*model.AdminJobSchedule, error)
	ResetSystemGarbageCollection(ctx context.Context) error
}

type ErrSystemGcInProgress

type ErrSystemGcInProgress struct{}

ErrSystemGcInProgress describes that a gc progress is already running.

func (*ErrSystemGcInProgress) Error

func (e *ErrSystemGcInProgress) Error() string

Error returns the error message.

type ErrSystemGcScheduleIdentical

type ErrSystemGcScheduleIdentical struct{}

ErrSystemGcScheduleIdentical describes equality between two GC schedules.

func (*ErrSystemGcScheduleIdentical) Error

Error returns the error message.

type ErrSystemGcScheduleNotProvided

type ErrSystemGcScheduleNotProvided struct{}

ErrSystemGcScheduleNotProvided describes the absence of a required schedule.

func (*ErrSystemGcScheduleNotProvided) Error

Error returns the error message.

type ErrSystemGcUndefined

type ErrSystemGcUndefined struct{}

ErrSystemGcUndefined describes a server-side response returning an empty GC schedule.

func (*ErrSystemGcUndefined) Error

func (e *ErrSystemGcUndefined) Error() string

Error returns the error message.

type ErrSystemInternalErrors

type ErrSystemInternalErrors struct{}

ErrSystemInternalErrors describes server-side internal errors.

func (*ErrSystemInternalErrors) Error

func (e *ErrSystemInternalErrors) Error() string

Error returns the error message.

type ErrSystemInvalidSchedule

type ErrSystemInvalidSchedule struct{}

ErrSystemInvalidSchedule describes an invalid schedule type request.

func (*ErrSystemInvalidSchedule) Error

func (e *ErrSystemInvalidSchedule) Error() string

Error returns the error message.

type ErrSystemNoPermission

type ErrSystemNoPermission struct{}

ErrSystemNoPermission describes a request error without permission.

func (*ErrSystemNoPermission) Error

func (e *ErrSystemNoPermission) Error() string

Error returns the error message.

type ErrSystemUnauthorized

type ErrSystemUnauthorized struct{}

ErrSystemUnauthorized describes an unauthorized request.

func (*ErrSystemUnauthorized) Error

func (e *ErrSystemUnauthorized) Error() string

Error returns the error message.

type RESTClient

type RESTClient struct {
	// The swagger client
	Client *client.Harbor

	// AuthInfo contain auth information, which are provided on API calls.
	AuthInfo runtime.ClientAuthInfoWriter
}

RESTClient is a subclient for handling system related actions.

func NewClient

func NewClient(cl *client.Harbor, authInfo runtime.ClientAuthInfoWriter) *RESTClient

func (*RESTClient) GetSystemGarbageCollection

func (c *RESTClient) GetSystemGarbageCollection(ctx context.Context) (*model.AdminJobSchedule, error)

GetSystemGarbageCollection returns the system GC schedule.

func (*RESTClient) Health

Health reports Harbor system health information.

func (*RESTClient) NewSystemGarbageCollection

func (c *RESTClient) NewSystemGarbageCollection(ctx context.Context, cron,
	scheduleType string) (*model.AdminJobSchedule, error)

NewSystemGarbageCollection creates a new garbage collection schedule.

func (*RESTClient) ResetSystemGarbageCollection

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

ResetSystemGarbageCollection resets the system GC schedule to it's default values containing "None" as the Schedule Type, which effectively deactivates the schedule. For this to work correctly, a GC schedule must exist beforehand.

func (*RESTClient) UpdateSystemGarbageCollection

func (c *RESTClient) UpdateSystemGarbageCollection(ctx context.Context,
	newGcSchedule *model.AdminJobScheduleObj) error

UpdateSystemGarbageCollection updates the system GC schedule.

Jump to

Keyboard shortcuts

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