Compare Artifacts

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Compare Artifacts - Compares two artifacts and produces the difference between them.

Security: Requires a valid user with the "Read" permission.

Usage: POST /dependencyGraph/artifactDelta

Consumes: application/json

Produces: application/json

Request body:

Name

Type

Required/Optional

Description

source_artifact_path

string

required

The path of the source artifact to be compared

target_artifact_path

string

required

The path of the target artifact to be compared

Response body:

Name

Type

Description

source_artifact

object

Details of the source artifact being compared

target_artifact

object

Details of the target artifact being compared

removed

array

Components that are present in the source artifact but not in the target artifact

added

array

Components that are present in the target artifact but not in the source artifact

unchanged

array

Components that are present in both the source and target artifacts, with no changes in versions

source_artifact Object:

Name

Type

Description

name

string

The name of the source artifact

path

string

The path of the source artifact

pkg_type

string

Package type of the source artifact

sha256

string

SHA256 checksum of the source artifact

sha1

string

SHA1 checksum of the source artifact

target_artifact Object:

Name

Type

Description

name

string

The name of the target artifact

path

string

The path of the target artifact

pkg_type

string

Package type of the target artifact

sha256

string

SHA256 checksum of the target artifact

sha1

string

SHA1 checksum of the target artifact

Component Objects (found in removed, added, and unchanged arrays):

Name

Type

Description

component_name

string

Name of the component

component_id

string

ID of the component

package_type

string

Package type of the component

version

string

Version of the component

created

string

Creation date of the component (ISO8601 format)

modified

string

Modification date of the component (ISO8601 format)

Sample Usage: POST /dependencyGraph/artifactDelta

Request Body

{
 "source_artifact_path":"/pnnl/goss/goss-core-client/0.1.7/goss-core-client-0.1.7-sources.jar",
 "target_artifact_path":"/pnnl/goss/goss-core-client/0.1.8/goss-core-client-0.1.8-sources.jar"
}

Sample Response

{
  "source_artifact":{
    "name": "artifactory-pro.zip",
    "path": "art2/ext-release-local/",
    "pkg_type": "Generic",
    "sha256": "d160c68ed8879ae42756e159daec1dd7ecfd53b6192321656b72715e20d46dd2",
    "sha1": ""
  },
  "target_artifact":{
    "name": "artifactory-pro.zip",
    "path": "art2/ext-release-local/",
    "pkg_type": "Generic",
    "sha256": "d160c68ed8879ae42756e159daec1dd7ecfd53b6192321656b72715e20d46dd2",
    "sha1": ""
  },
  "removed":[
    {
      "component_name":"some-component-1.1",
      "component_id":"pip://some-component:1.1",
      "package_type":"pip",
      "version":"1.1",
      "created":"2008-06-09T16:50:19Z",
      "modified":"2015-07-26T17:49:47Z"
    }
  ],
  "added":[
    {
      "component_name":"Jinja2.7.2",
      "component_id":"pip://Jinja2:2.7.2",
      "package_type":"pip",
      "version":"2.7.2",
      "created":"2008-06-09T16:50:19Z",
      "modified":"2015-07-26T17:49:47Z"
    }
  ],
 "unchanged":[
    {
      "component_name":"Apache1.4",
      "component_id":"gav://apache:1.4",
      "package_type":"maven",
      "version":"1.4",
      "created":"2008-06-09T16:50:19Z",
      "modified":"2015-07-26T17:49:47Z"
    }
  ]
}

Response Codes

Response Codes

Description

200

Success

400

Artifact '<PATH>' doesn't exist or isn't indexed in Xray

401

Bad Credentials

415

Failed to parse request