Documentation ¶
Index ¶
- Constants
- type Client
- type ErrReplicationDisabled
- type ErrReplicationExecutionNotProvided
- type ErrReplicationExecutionReplicationIDMismatch
- type ErrReplicationIDNotExists
- type ErrReplicationIllegalIDFormat
- type ErrReplicationInternalErrors
- type ErrReplicationMismatch
- type ErrReplicationNameAlreadyExists
- type ErrReplicationNoPermission
- type ErrReplicationNotFound
- type ErrReplicationNotProvided
- type ErrReplicationUnauthorized
- type RESTClient
- func (c *RESTClient) DeleteReplicationPolicyByID(ctx context.Context, id int64) error
- func (c *RESTClient) GetReplicationExecutionByID(ctx context.Context, id int64) (*modelv2.ReplicationExecution, error)
- func (c *RESTClient) GetReplicationPolicyByID(ctx context.Context, id int64) (*modelv2.ReplicationPolicy, error)
- func (c *RESTClient) GetReplicationPolicyByName(ctx context.Context, name string) (*modelv2.ReplicationPolicy, error)
- func (c *RESTClient) ListReplicationExecutions(ctx context.Context, policyID *int64, status, trigger *string) ([]*modelv2.ReplicationExecution, error)
- func (c *RESTClient) ListReplicationPolicies(ctx context.Context) ([]*modelv2.ReplicationPolicy, error)
- func (c *RESTClient) NewReplicationPolicy(ctx context.Context, destRegistry, srcRegistry *modelv2.Registry, ...) error
- func (c *RESTClient) TriggerReplicationExecution(ctx context.Context, r *modelv2.StartReplicationExecution) error
- func (c *RESTClient) UpdateReplicationPolicy(ctx context.Context, r *modelv2.ReplicationPolicy, id int64) error
Constants ¶
const ( // ErrReplicationIllegalIDFormatMsg describes an illegal request format ErrReplicationIllegalIDFormatMsg = "illegal format of provided ID value" ErrReplicationUnauthorizedMsg = "unauthorized" // ErrReplicationInternalErrorsMsg describes server-side internal errors ErrReplicationInternalErrorsMsg = "unexpected internal errors" // ErrReplicationNoPermissionMsg describes a request error without permission ErrReplicationNoPermissionMsg = "user does not have permission to the replication" // ErrReplicationIDNotExistsMsg describes an error // when no proper replication ID is found ErrReplicationIDNotExistsMsg = "replication ID does not exist" // ErrReplicationNameAlreadyExistsMsg describes a duplicate replication name error ErrReplicationNameAlreadyExistsMsg = "replication name already exists" // ErrReplicationMismatchMsg describes a failed lookup // of a replication with name/id pair ErrReplicationMismatchMsg = "id/name pair not found on server side" // ErrReplicationNotFoundMsg describes an error // when a specific replication is not found ErrReplicationNotFoundMsg = "replication not found on server side" // ErrReplicationNotProvidedMsg describes an error // caused by a missing replication object ErrReplicationNotProvidedMsg = "no replication provided" // ErrReplicationExecutionNotProvidedMsg describes an error // caused by a missing replication execution object ErrReplicationExecutionNotProvidedMsg = "no replication execution provided" // ErrReplicationExecutionReplicationIDMismatchMsg describes an error // caused by an ID mismatch of the desired replication execution and an existing replication ErrReplicationExecutionReplicationIDMismatchMsg = "received replication execution id doesn't match" // ErrReplicationDisabledMsg describes an error when actions cannot be performed // because the underlying replication is currently disabled. ErrReplicationDisabledMsg = "the underlying replication is disabled" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { NewReplicationPolicy(ctx context.Context, destRegistry, srcRegistry *modelv2.Registry, replicateDeletion, override, enablePolicy bool, filters []*modelv2.ReplicationFilter, trigger *modelv2.ReplicationTrigger, destNamespace, description, name string) error GetReplicationPolicyByName(ctx context.Context, name string) (*modelv2.ReplicationPolicy, error) ListReplicationPolicies(ctx context.Context) ([]*modelv2.ReplicationPolicy, error) GetReplicationPolicyByID(ctx context.Context, id int64) (*modelv2.ReplicationPolicy, error) DeleteReplicationPolicyByID(ctx context.Context, id int64) error UpdateReplicationPolicy(ctx context.Context, r *modelv2.ReplicationPolicy, id int64) error TriggerReplicationExecution(ctx context.Context, r *modelv2.StartReplicationExecution) error ListReplicationExecutions(ctx context.Context, policyID *int64, status, trigger *string) ([]*modelv2.ReplicationExecution, error) GetReplicationExecutionByID(ctx context.Context, id int64) (*modelv2.ReplicationExecution, error) }
type ErrReplicationDisabled ¶
type ErrReplicationDisabled struct{}
ErrReplicationDisabled describes an error that the underlying replication is disabled.
func (*ErrReplicationDisabled) Error ¶
func (e *ErrReplicationDisabled) Error() string
Error returns the error message.
type ErrReplicationExecutionNotProvided ¶
type ErrReplicationExecutionNotProvided struct{}
func (*ErrReplicationExecutionNotProvided) Error ¶
func (e *ErrReplicationExecutionNotProvided) Error() string
Error returns the error message.
type ErrReplicationExecutionReplicationIDMismatch ¶
type ErrReplicationExecutionReplicationIDMismatch struct{}
func (*ErrReplicationExecutionReplicationIDMismatch) Error ¶
func (e *ErrReplicationExecutionReplicationIDMismatch) Error() string
Error returns the error message.
type ErrReplicationIDNotExists ¶
type ErrReplicationIDNotExists struct{}
ErrReplicationIDNotExists describes an error when no proper replication ID is found.
func (*ErrReplicationIDNotExists) Error ¶
func (e *ErrReplicationIDNotExists) Error() string
Error returns the error message.
type ErrReplicationIllegalIDFormat ¶
type ErrReplicationIllegalIDFormat struct{}
ErrReplicationIllegalIDFormat describes an illegal request format.
func (*ErrReplicationIllegalIDFormat) Error ¶
func (e *ErrReplicationIllegalIDFormat) Error() string
Error returns the error message.
type ErrReplicationInternalErrors ¶
type ErrReplicationInternalErrors struct{}
ErrReplicationInternalErrors describes server-side internal errors.
func (*ErrReplicationInternalErrors) Error ¶
func (e *ErrReplicationInternalErrors) Error() string
Error returns the error message.
type ErrReplicationMismatch ¶
type ErrReplicationMismatch struct{}
ErrReplicationMismatch describes a failed lookup of a replication with name/id pair.
func (*ErrReplicationMismatch) Error ¶
func (e *ErrReplicationMismatch) Error() string
Error returns the error message.
type ErrReplicationNameAlreadyExists ¶
type ErrReplicationNameAlreadyExists struct{}
ErrReplicationNameAlreadyExists describes a duplicate replication name error.
func (*ErrReplicationNameAlreadyExists) Error ¶
func (e *ErrReplicationNameAlreadyExists) Error() string
Error returns the error message.
type ErrReplicationNoPermission ¶
type ErrReplicationNoPermission struct{}
ErrReplicationNoPermission describes a request error without permission.
func (*ErrReplicationNoPermission) Error ¶
func (e *ErrReplicationNoPermission) Error() string
Error returns the error message.
type ErrReplicationNotFound ¶
type ErrReplicationNotFound struct{}
ErrReplicationNotFound describes an error when a specific replication is not found.
func (*ErrReplicationNotFound) Error ¶
func (e *ErrReplicationNotFound) Error() string
Error returns the error message.
type ErrReplicationNotProvided ¶
type ErrReplicationNotProvided struct{}
func (*ErrReplicationNotProvided) Error ¶
func (e *ErrReplicationNotProvided) Error() string
Error returns the error message.
type ErrReplicationUnauthorized ¶
type ErrReplicationUnauthorized struct{}
ErrReplicationUnauthorized describes an unauthorized request.
func (*ErrReplicationUnauthorized) Error ¶
func (e *ErrReplicationUnauthorized) Error() string
Error returns the error message.
type RESTClient ¶
type RESTClient struct { // Options contains optional configuration when making API calls. Options *config.Options // 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 replication related actions.
func NewClient ¶
func NewClient(v2Client *v2client.Harbor, opts *config.Options, authInfo runtime.ClientAuthInfoWriter) *RESTClient
func (*RESTClient) DeleteReplicationPolicyByID ¶
func (c *RESTClient) DeleteReplicationPolicyByID(ctx context.Context, id int64) error
DeleteReplicationPolicyByID deletes a replication policy identified by id.
func (*RESTClient) GetReplicationExecutionByID ¶
func (c *RESTClient) GetReplicationExecutionByID(ctx context.Context, id int64) (*modelv2.ReplicationExecution, error)
GetReplicationExecutionByID returns a replication execution specified by ID.
func (*RESTClient) GetReplicationPolicyByID ¶
func (c *RESTClient) GetReplicationPolicyByID(ctx context.Context, id int64) (*modelv2.ReplicationPolicy, error)
GetReplicationPolicyByID returns a replication identified by id.
func (*RESTClient) GetReplicationPolicyByName ¶
func (c *RESTClient) GetReplicationPolicyByName(ctx context.Context, name string) (*modelv2.ReplicationPolicy, error)
GetReplicationPolicyByName returns a replication identified by name.
func (*RESTClient) ListReplicationExecutions ¶
func (c *RESTClient) ListReplicationExecutions(ctx context.Context, policyID *int64, status, trigger *string) ([]*modelv2.ReplicationExecution, error)
ListReplicationExecutions lists replication executions specified by execution ID, status or trigger. Specifying the property "policy_id" will return executions of the specified policy.
func (*RESTClient) ListReplicationPolicies ¶
func (c *RESTClient) ListReplicationPolicies(ctx context.Context) ([]*modelv2.ReplicationPolicy, 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
NewReplicationPolicy creates a new replication policy with the given arguments.
func (*RESTClient) TriggerReplicationExecution ¶
func (c *RESTClient) TriggerReplicationExecution(ctx context.Context, r *modelv2.StartReplicationExecution) error
TriggerReplicationExecution triggers the execution of a replication 'r'.
func (*RESTClient) UpdateReplicationPolicy ¶
func (c *RESTClient) UpdateReplicationPolicy(ctx context.Context, r *modelv2.ReplicationPolicy, id int64) error
UpdateReplicationPolicy updates the replication policy identified by id with the provided policy 'r'.