Find Component by Name

Xray REST APIs

Products
JFrog Xray
Content Type
REST API
ft:sourceType
Paligo

Description: Search for a component by name. This API is applicable only for components synced from the JFrog Global database to Xray.

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

Usage: GET /component/{component_name}

Consumes: None

Produces: application/json

Path parameters:

Name

Type

Required/Optional

Description

component_name

string

required

The name of the component to be searched for.

Query parameters: None

Response body:

Name

Type

Description

component

string

The unique identifier of the component found.

package_type

string

The type of package associated with the component.

name

string

The name of the component.

description

string

A description of the component.

created

string

The date and time when the component was created, in ISO 8601 format.

modified

string

The date and time when the component was last modified, in ISO 8601 format.

sources

array[SourceObj]

An array containing information about the sources of the component.

versions

array

An array containing information about the versions of the component, including associated files.

sources object:

Name

Type

Description

name

string

The name of the source.

url

string

The URL of the source.

updated

string

The date and time when the source was updated, in ISO 8601 format.

versions object:

Name

Type

Description

version

string

The version of the component.

released

string

The date and time when the version was released, in ISO 8601 format.

licenses

array

An array containing the licenses associated with the version.

files

array

An array containing information about the files associated with the version.

licenses object:

Name

Type

Description

licenses

string

The license associated with the version.

files object:

Name

Type

Description

name

string

The name of the file.

sha256

string

The SHA256 checksum of the file.

sha1

string

The SHA1 checksum of the file.

md5

string

The MD5 checksum of the file.

Response codes:

Status code

Description

200

Components found.

400

Failed to resolve component mapping.

500

Failed to get components by name.

Example Request

GET /component/kdegames-devel

Example successful response:

{
    "component": "4:kdegames-devel",
    "package_type": "rpm",
    "name": "kdegames-devel",
    "description": "Development files for the KDE gaming libraries.Install kdegames-devel if you wish to develop or compile games for the KDE desktop.",
    "created": "2017-11-19T09:24:12.065Z",
    "modified": "2017-11-19T10:13:19.946Z",
    "sources": [
        {
            "name": "archive-centos",
            "url": "http://vault.centos.org/",
            "updated": "2017-11-19T09:24:11.995Z"
        }
    ],
    "versions": [
        {
            "version": "6:3.3.1-2",
            "released": "0001-01-01T00:00:00Z",
            "licenses": [
                "GPL-3.0"
            ],
            "files": [
                {
                    "name": "kdegames-devel-3.3.1-2.i386.rpm",
                    "sha256": "f256373977e2705e521e06c85f6f49cefcd6c74c8a0fa18dec2eb1bcefe7e4b4",
                    "sha1": "d184ba4bd8e205fda0ba29b7f1db39b91174b1ef",
                    "md5": "7b246aeef791ad549e78cda2c3c72a40"
                }
            ]
        }
    ]
}

Sample Response 2 (Operational Risk):

"versions": [
    {
        "version": "7.6",
        "released": "2020-07-17T11:20:00Z",
        "licenses": [
            "Apache-2.0"
        ],
        "files": [
            {
                "name": "consent-core-api-7.6.jar",
                "sha256": "9be98a8b61db29e9660952fc041ffb3937a508eba686619f367e2b601345f2a8",
                "sha1": "7f32c9a9d228e1f14a7d298fe0d424d2e3309b05"
            }
        ],
        "op_risk": {
            "risk": "High",
            "risk_reason": "Number of new versions",
            "newer_versions": 80
        }
    }
]