Documentation ¶
Index ¶
- Constants
- type Client
- type ErrSystemGcInProgress
- type ErrSystemGcScheduleIdentical
- type ErrSystemGcScheduleNotProvided
- type ErrSystemGcScheduleParametersUndefined
- type ErrSystemGcScheduleUndefined
- type ErrSystemGcUndefined
- type ErrSystemInternalErrors
- type ErrSystemInvalidSchedule
- type ErrSystemNoPermission
- type ErrSystemUnauthorized
- type RESTClient
- func (c *RESTClient) GetGarbageCollectionExecution(ctx context.Context, id int64) (*modelv2.GCHistory, error)
- func (c *RESTClient) GetGarbageCollectionSchedule(ctx context.Context) (*modelv2.GCHistory, error)
- func (c *RESTClient) NewGarbageCollection(ctx context.Context, gcSchedule *modelv2.Schedule) error
- func (c *RESTClient) ResetGarbageCollection(ctx context.Context) error
- func (c *RESTClient) UpdateGarbageCollection(ctx context.Context, newGCSchedule *modelv2.Schedule) error
Constants ¶
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 = "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" // ErrSystemGcScheduleUndefinedMsg describes an error when the GC schedule is undefined ErrSystemGcScheduleUndefinedMsg = "the garbage collection schedule is undefined" // ErrSystemGcScheduleParametersUndefinedMsg describes an error when a GC schedule's parameters are undefined ErrSystemGcScheduleParametersUndefinedMsg = "garbage collection schedule parameters are undefined" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { NewGarbageCollection(ctx context.Context, gcSchedule *modelv2.Schedule) error UpdateGarbageCollection(ctx context.Context, newGCSchedule *modelv2.Schedule) error GetGarbageCollectionExecution(ctx context.Context, id int64) (*modelv2.GCHistory, error) GetGarbageCollectionSchedule(ctx context.Context) (*modelv2.GCHistory, error) ResetGarbageCollection(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 ¶
func (e *ErrSystemGcScheduleIdentical) Error() string
Error returns the error message.
type ErrSystemGcScheduleNotProvided ¶
type ErrSystemGcScheduleNotProvided struct{}
ErrSystemGcScheduleNotProvided describes the absence of a required schedule.
func (*ErrSystemGcScheduleNotProvided) Error ¶
func (e *ErrSystemGcScheduleNotProvided) Error() string
Error returns the error message.
type ErrSystemGcScheduleParametersUndefined ¶
type ErrSystemGcScheduleParametersUndefined struct{}
ErrSystemGcScheduleParametersUndefined describes an error when a GC schedule's parameters are undefined
func (*ErrSystemGcScheduleParametersUndefined) Error ¶
func (e *ErrSystemGcScheduleParametersUndefined) Error() string
Error returns the error message.
type ErrSystemGcScheduleUndefined ¶
type ErrSystemGcScheduleUndefined struct{}
ErrSystemGcScheduleUndefined describes an error when the fetched gc schedule is undefined.
func (*ErrSystemGcScheduleUndefined) Error ¶
func (e *ErrSystemGcScheduleUndefined) Error() string
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 legacy swagger client LegacyClient *client.Harbor // The new client of the harbor v2 API V2Client *v2client.Harbor // AuthInfo contains the auth information that is provided on API calls. AuthInfo runtime.ClientAuthInfoWriter }
RESTClient is a subclient for handling system related actions.
func NewClient ¶
func NewClient(legacyClient *client.Harbor, v2Client *v2client.Harbor, authInfo runtime.ClientAuthInfoWriter) *RESTClient
func (*RESTClient) GetGarbageCollectionExecution ¶
func (c *RESTClient) GetGarbageCollectionExecution(ctx context.Context, id int64) (*modelv2.GCHistory, error)
GetGarbageCollectionExecution Returns a garbage collection execution identified by its id.
func (*RESTClient) GetGarbageCollectionSchedule ¶
GetGarbageCollectionSchedule returns the system GC schedule.
func (*RESTClient) NewGarbageCollection ¶
NewGarbageCollection creates a new garbage collection schedule.
func (*RESTClient) ResetGarbageCollection ¶
func (c *RESTClient) ResetGarbageCollection(ctx context.Context) error
ResetGarbageCollection 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) UpdateGarbageCollection ¶
func (c *RESTClient) UpdateGarbageCollection(ctx context.Context, newGCSchedule *modelv2.Schedule) error
UpdateGarbageCollection updates the system GC schedule.