Distribute Release Bundle Version v2

JFrog REST APIs

Content Type
REST API
ft:sourceType
Paligo

Description: Distributes a Release Bundle v2 version.

Since: 7.63.2 (Artifactory), 2.19.1 (Distribution)

Security: Requires permissions to distribute Release Bundles; requires destination permissions to the target Release Bundle path.

Usage:POST /lifecycle/api/v2/distribution/distribute/{release_bundle_name}/{release_bundle_version}

Query Parameters (optional): repository_key, project. See Common Optional Query Parameters.

Important

If the Release Bundle v2 version belongs to a specific project, you must specify either the repository_key or the project. The repository_key refers to the system repository that contains the Release Bundles related to the project (<project_key>-release_bundles-v2).Projects

Consumes: application/json

Sample Request:

http://localhost:8082/lifecycle/api/v2/distribution/distribute/bundleName/1.0.0?repository_key=release-bundles-v2
{
    "auto_create_missing_repositories": "false",
    "distribution_rules": [
        {
            "site_name": "*"
        }
    ],
    "modifications": {
        "default_path_mapping_by_last_promotion": false,
        "mappings": [
            {
                "input": "(.*)/(.*)",
                "output": "$1/mapping/$2"
            }
        ]
    }
}

The request includes the following information:

Property

Description

auto_create_missing_repositories

Determines whether to create missing repositories automatically on the distribution targets. The default value is false, which means that if a missing repository is encountered in a particular target, the distribution to that target will fail.

Note

In Distribution versions prior to 2.19.0, the option to create missing repositories automatically could not work together with path mappings (defined under modifications as described below), unless a special configuration parameter (distribute.auto-create-target-repo-advance) was changed from its default setting to true.

Starting with 2.19.0, the default setting of this parameter has changed to true, which removes this limitation.

If you want to prevent missing repositories from being created automatically when path mappings are defined, change the setting of distribute.auto-create-target-repo-advance back to false.

distribution_rules

Defines which distribution targets to include when distributing the Release Bundle.

modifications

(Optional) Specifies the path mapping for the artifacts on the distribution targets in the form of input and output regex mapping pairs. These mapping pairs define where the queried artifact is located and where it should be placed. Use this option if the path on the target is different than the source path.

modifications.default_path_mapping_by_last_promotion

Note

Requires Distribution 2.26.1 or higher.

When this property is not set, the default path mapping is determined by the default-path-mapping-by-last-promotion property in the Distribution Application Config YAML file. For more information, see Configure Path Mapping from the Last Promotion.Distribution Application Config YAML FileConfigure Path Mapping from the Last Promotion

When this property is set, this setting overrides the configuration property in the Distribution Application Config YAML file:Distribution Application Config YAML File

  • When set to true, the repositories used for the most recent promotion of the Release Bundle version are provided as the path mapping.

  • When set to false, the default destination repositories will match those at the source.

Note

Setting this property to true can be used, for example, to facilitate a gradual rollout of the feature (default path mapping by last promotion), by limiting its use to specific API requests.

modifications.mappings

Defines the input and output regex mapping pairs.

Warning

Do not configure mappings when default_path_mapping_by_last_promotion is set to true.

Sample Response:

{
    "id": 721286369066762240,
    "sites": [
        {
            "name": "infra-dist-yevdoa-08244892-edge-2",
            "service_id": "jfrt@01h2wh4psm4mhf04w2n00p0rp4",
            "type": "artifactory"
        },
        {
            "name": "HOME",
            "service_id": "jfrt@01h2wgyv4wn0c40jbv881c0www",
            "type": "artifactory"
        },
        {
            "name": "infra-dist-yevdoa-08244892-edge-1",
            "service_id": "jfrt@01h2wh54qwn5rk1wp2rfzh032n",
            "type": "artifactory"
        },
        {
            "name": "infra-dist-yevdoa-08244892-edge-0",
            "service_id": "jfrt@01h2wh9ebwyw5v01nanend06zf",
            "type": "artifactory"
        }
    ]
}

The response includes the following information:

Property

Description

id

The ID number of the distribution operation.

sites

The name, service_id and type of each destination target.

name

The name of Edge node serving as the destination target for the distributed Release Bundle.

service_id

The unique identifier of the Artifactory instance where the Release Bundle was distributed.

type

The destination target device type (e.g. Artifactory).

Status Codes:

Code

Description

200

Success

400

Bad Request

404

Not Found

409

Already Exists