Skip to main content

Python wrapper for JFROG Xray REST API

Project description

Python wrapper for JFROG Xray REST API

jfrog-xray-api is a live python package for JFrog Xray REST API.

Install

pip install jfrog-xray-api

Usage

Authentication

# User and password OR API_KEY
from xray import XrayRestClient
xray_rest_client = XrayRestClient(
    base_url="http://localhost:8082/xray",
    username='USERNAME',
    password='PASSWORD or API_KEY'
)

Components

Find Component by Name

components = xray_rest_client.components
response = components.find_component_by_name("jenkinsapi")
print(response.json())

Find Components by CVEs

components = xray_rest_client.components
cve_list = ['CVE-2021-4104']
response = components.find_components_by_cves(cve_list)
print(response.json())

Find CVEs by Components

components = xray_rest_client.components
components_id_list = ['gav://commons-collections:commons-collections:3.2.1', 'gav://commons-collections:commons-collections:3.2.2']
response = components.find_cves_by_components(components_id_list)
print(response.json())

Get Component List Per Watch

# TODO

Get Artifact Dependency Graph

components = xray_rest_client.components
artifact_path = '/Artifactory/pnnl/goss/goss-core-client/0.1.7/goss-core-client-0.1.7-sources.jar'
response = components.get_artifact_dependency_graph(artifact_path)
print(response.json())

Compare Artifacts

components = xray_rest_client.components
source_artifact_path = '/Artifactory/pnnl/goss/goss-core-client/0.1.7/goss-core-client-0.1.7-sources.jar'
target_artifact_path = '/Artifactory/pnnl/goss/goss-core-client/0.1.8/goss-core-client-0.1.8-sources.jar'
response = components.compare_artifacts(source_artifact_path, target_artifact_path)
print(response.json())

Get Build Dependency Graph

components = xray_rest_client.components
artifactory_instance = "myInstance",
build_name = "someBuild",
build_number = "someNumber"
response = components.get_build_dependency_graph(artifactory_instance, build_name, build_number)
print(response.json())

Compare Builds

components = xray_rest_client.components
response = components.compare_builds(
    "my-instance", "someOriginBuild", "111",
    "my-instance", "someTargetBuild", "222",
)
print(response.json())

Export Component Details

# TODO

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jfrog-xray-api-0.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

jfrog_xray_api-0.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file jfrog-xray-api-0.0.1.tar.gz.

File metadata

  • Download URL: jfrog-xray-api-0.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.4

File hashes

Hashes for jfrog-xray-api-0.0.1.tar.gz
Algorithm Hash digest
SHA256 19822ca32a267a51cf6e91f888081cb6262526151387b44be7475ac77a04b18c
MD5 dfce6ad2e4a962227829093589685597
BLAKE2b-256 1f2ca1f11fa91d47bf2b3159f071e894041e500d11e8cc78189a849a1fc96e9f

See more details on using hashes here.

File details

Details for the file jfrog_xray_api-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jfrog_xray_api-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a94b1a1e26e4737ee22f1118f7b0117edc0cc6aef538eb8d77a96d2bee90092
MD5 cea8e7fbe955bd1de730917576b5b8be
BLAKE2b-256 3c2ab56c8d2342463835c7e6ce1ac651863bfafb28f6cb320b0e3f9bfd30e8b7

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page