Skip to content

replication policy

replication policy create

replication policy create <NAME> <SRC_REGISTRY_ID> <DEST_REGISTRY_ID> [OPTIONS]

Create a replication policy.

Arguments

NAME
The policy name.
Type: text
Required:

SRC_REGISTRY_ID
The ID of registry to replicate from. Typically an external registry such as 'hub.docker.com', 'ghcr.io', etc.
Type: integer
Required:

DEST_REGISTRY_ID
The ID of the registry to replicate to.
Type: integer
Required:

Options

--description <DESCRIPTION>
The description of the policy.
Type: text

--dest-namespace <DEST_NAMESPACE>
The destination namespace.
Type: text

--dest-namespace-replace-count <DEST_NAMESPACE_REPLACE_COUNT>
Specify how many path components will be replaced by the provided destination namespace. The default value is -1 in which case the legacy mode will be applied.
Type: integer

--trigger-type <REPLICATION_TRIGGER_TYPE>
The replication policy trigger type. The valid values are manual, event_based and scheduled.
Type: text

--trigger-cron <REPLICATION_TRIGGER_CRON>
The cron string for scheduled trigger
Type: text

--filter-name <FILTER_NAME>
Filter the name of the resource. Leave empty or use '**' to match all. 'library/**' only matches resources under 'library'. For more patterns, please refer to the offical Harbor user guide.
Type: text

--filter-tag <FILTER_TAG>
Filter the tag of the resource.
Type: text

--filter-tag-mode <FILTER_TAG_MODE>
Match or exclude the given tag
Type: choice
Choices: matches, excludes
Default: matches

--filter-label <FILTER_LABEL>
Filter the label of the resource.
Type: text

--filter-label-mode <FILTER_LABEL_MODE>
Match or exclude the given label
Type: choice
Choices: matches, excludes
Default: matches

--filter-resource <FILTER_RESOURCE>
Filter the resource type to replicate.
Type: choice
Choices: all, image, artifact
Default: all

--replicate-deletion <REPLICATE_DELETION>
Whether to replicate the deletion operation.
Type: boolean

--override <OVERRIDE>
Whether to override the resources on the destination registry.
Type: boolean

--enabled <ENABLED>
Whether the policy is enabled or not.
Type: boolean

--speed-limit <SPEED>
speed limit for each task
Type: integer


replication policy delete

replication policy delete <POLICY_ID> [OPTIONS]

Delete a replication policy.

Arguments

POLICY_ID
The ID of the replication policy.
Type: integer
Required:

Options

--force
Force deletion without confirmation.
Type: boolean (flag)
Default: False


replication policy get

replication policy get <POLICY_ID>

Get information about a replication policy.

Arguments

POLICY_ID
The ID of the replication policy.
Type: integer
Required:


replication policy list

replication policy list [OPTIONS]

List replication policies.

Options

--query <QUERY>
Query parameters to filter the results.
See harborapi docs for more information.
Type: text

--sort <SORT>
Sorting order of the results. Example: 'name,-id' to sort by name ascending and id descending.
Type: text

--page <PAGE>
(Advanced) Page to begin fetching from.
Type: integer
Default: 1

--page-size <PAGE_SIZE>
(Advanced) Results to fetch per API call.
Type: integer
Default: 10

--limit <LIMIT>
Maximum number of results to fetch.
Type: integer