Get Artifact Dependency Graph

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Retrieves the complete dependency graph for a specified artifact.

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

Usage: POST /dependencyGraph/artifact

Consumes: application/json

Produces: application/json

Request Body:

Name

Type

Required/Optional

Description

path

string

The path of the artifact (artifactory-name/repo-name/path)

Example

{
  "path": "<artifactory-name/repo-name/path>"
}

Response Body:

Name

Type

Description

artifact

object

Information about the main artifact.

artifact.name

string

The name of the artifact whose dependency graph is being retrieved.

artifact.path

string

The path of the artifact.

artifact.pkg_type

string

The package type of the artifact.

artifact.sha256

string

The SHA256 checksum of the artifact.

artifact.sha1

string

The SHA1 checksum of the artifact.

artifact.component_id

string

The component ID of the artifact.

components

array

An array of dependency components.

components.component_name

string

The name of the dependency component.

components.component_id

string

The component ID of the dependency component.

components.package_type

string

The package type of the dependency component.

components.version

string

The version of the dependency component.

components.created

string

The creation date of the dependency component (ISO8601).

components.modified

string

The last modification date of the dependency component (ISO8601).

components.components

array

Next level dependencies of the dependency component.

Sample Response

{
  "artifact":{
    "name": "<The name of the artifact whose graph we are obtaining>",
    "path": "<artifactory-name/repo-name/path>",
    "pkg_type": "<Package type>",
    "sha256": "<Artifact's SHA256 checksum>",
    "sha1": "<Artifact's SHA1 checksum>",
    "component_id": "<The component ID>"
  },
  "components":[ 
    {
      "component_name":"<Dependency component name>",
      "component_id":"<Dependency Component ID>",
      "package_type":"<Dependency component package type>",
      "version":"<Dependency component version>",
      "created":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>",
      "modified":"<ISO8601 (yyyy-MM-dd'T'HH:mm:ss.SSSZ)>",
      "components":[<Next level dependencies of the dependency component>] 
    }
  ]
}

Sample Usage

POST /dependencyGraph/artifact
{
  "path": "/Artifactory/pnnl/goss/goss-core-client/0.1.7/goss-core-client-0.1.7-sources.jar"
}

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