Search


Cloud customer?
Upgrade in MyJFrog >


Working with an older version?

JFrog Artifactory 6.x
JFrog Xray 2.x
JFrog Mission Control 3.x
JFrog Distribution 1.x
JFrog Enterprise+ (Pre-Platform Release)




Overview

Distribution provides a convenient and up-to-date self-descriptive API that can be used by various tools/frameworks to automate the creation of REST calls.

Usage

Distribution REST API endpoints can be invoked in any of the standard ways to invoke a RESTful API. This section describes how to use the Distribution REST API using cURL as an example.

Using and Configuring cURL

Base URL

The Platform REST URL is constructed of: 

<JFrog URL>/<Service Context>/api/<API-Version>

For example

# Using your JFrog URL 
http://myjfrog.acme.org/distribution/api/v1

# Using your Artifactory server hostname and the Artifactory router port
http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1

GENERAL

Test Connection

Description: Test connection with distribution.

Since: 1.0
Security: No authentication required.
Usage: GET /api/v1/system/ping
Request headers: N/A
Consumes: N/A


cURL Example
$ curl -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/ping"


Response status codes:

200 - Connection healthy
500 - Error.  The following error is displayed: "
One or more of the following services are unavailable: distributor, database and/or redis."

Response headers: N/A
Produces: application/json


Response
On Success
{
  "status_code”: 200,
  "message": "ok"
}
 
On Error
{
  "status_code”: 500,
  "message": "One or more of the following services are unavailable: distributor, database and/or redis"
}


Get System Info

Description: Get general information, including error details if system is unstable.

Note: Do not set a passphrase for the signing keys. When creating release bundles through the UI, JFrog Distribution does not currently support entering a passphrase.

Since: 1.0
Security: No authentication required.
Usage: GET /api/v1/system/info
Request headers: N/A
Consumes: N/A


cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/info"


Response status codes:

200 - Success

Response headers: N/A
Produces: application/json


Response
{
  "status": "STABLE",
  "message": "...",
  "version": "1.0",
  "service_id": "jfds@..."
}



Page Contents

Get System Settings

Description: get system settings
Since: 1.6
Security: Admin only
Usage: GET /api/v1/system/settings
Request headers: N/A
Consumes: N/A

cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/settings"

Response status codes:
200 - Success
Response headers: N/A
Produces: application/json

Response
{
      "call_home_enabled": true
}


Update System Settings

Description: update system settings
Since: 1.6
Security: Admin only
Usage: POST /api/v1/system/settings
Request headers: N/A
Consumes: application/json

cURL Example
$ curl -u myUser:myP455w0rd! -H "Accept: application/json" -H "Content-Type: application/json" -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/settings" -T system_settings.json
system_settings.json
{
      "call_home_enabled": true
}
FieldTypeRequiredDefault ValueSinceDescription
call_home_enabled

Boolean

no

false

1.6

If enabled, sending usage statistics to JFrog


Response status codes:

200 - Success


SIGNING KEYS

Upload and Propagate GPG Signing Keys for Distribution

Description: Upload GPG keys pair to JFrog Distribution. The GPG key pair will automatically be propagated to Artifactory Source and Edge Nodes. GPG Keys are used to sign Release Bundles.
Since: 2.4
Notes: Requires Mission Control version 4.5.0 and above.
Security: Admin only
Usage: POST /api/v1/keys/{protocol: pgp|gpg}
Request headers: N/A
Consumes: application/json

POST:/api/v1/keys/{protocol: pgp|gpg}

body:
{
    "key": {
        "public_key": "-----BEGIN PGP PUBLIC KEY BLOCK-----...-----END PGP PUBLIC KEY BLOCK-----",
        "private_key": "-----BEGIN PGP PRIVATE KEY BLOCK-----...-----END PGP PRIVATE KEY BLOCK-----"
    },
    "propagate_to_edge_nodes": true,
    "fail_on_propagation_failure": false
}
Expected response:
{
	"report": {
		"message" : "error message if exists"
		"status" : PARTIAL_SUCCESS | SUCCESS | FAILURE | PROPAGATION_NOT_REQUESTED | PROPAGATION_NOT_SUPPORTED_BY_MISSION_CONTROL | NO_GPG_KEY_TO_PROPAGATE
		"details" : [
			{
				"jpd_id" : "id1",
				"name" : "US-EAST"
				"key_alias" : "my first key"
				"status" : "SUCCESS"
			},
			{
				"jpd_id" : "id2",
				"name" : "US-WEST"
				"key_alias" : "my first key"
				"status" : "SUCCESS"
			},
		]
	}
}


Propagate GPG Signing Keys to an Edge Node

Description: Propagate the GPG key pair to a newly added Artifactory Edge node. 
Since: 2.4
Notes: Requires Mission Control version 4.5.0 and above.
Security: Admin only
Usage: POST /api/v1/keys/{protocol: pgp|gpg}/propagate
Request headers: N/A
Consumes: application/json

POST /api/v1/keys/{protocol: pgp|gpg}/propagate

response:
{
	"report": {
		"message" : "error message if exists"
		"status" : PARTIAL_SUCCESS | SUCCESS | FAILURE | PROPAGATION_NOT_REQUESTED | PROPAGATION_NOT_SUPPORTED_BY_MISSION_CONTROL | NO_GPG_KEY_TO_PROPAGATE
		"details" : [
			{
				"jpd_id" : "id1",
				"name" : "US-EAST"
				"key_alias" : "my first key"
				"status" : "SUCCESS"
			},
			{
				"jpd_id" : "id2",
				"name" : "US-WEST"
				"key_alias" : "my first key"
				"status" : "SUCCESS"
			},
		]
	}
}

Upload GPG Signing Key for Distribution

Description: Upload GPG keys pair to JFrog Distribution. This keys pair will be used to sign Release Bundles.

Note: Deprecated from Distribution version 2.4
Since:
 1.0
Security: Admin only
Usage: PUT /api/v1/keys/gpg
Request headers: N/A
Consumes: application/json


cURL Example
$ curl -u myUser:myP455w0rd! -H "Accept: application/json" -H "Content-Type: application/json" -X PUT "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/keys/gpg" -T gpg.json



gpg.json
{
  "public_key":  "-----BEGIN PGP PUBLIC KEY BLOCK-----
                  ....
                  -----END PGP PUBLIC KEY BLOCK-----",
  "private_key": "-----BEGIN PGP PRIVATE KEY BLOCK-----
                  ....
                  -----END PGP PRIVATE KEY BLOCK-----"
}


Response status codes:

200 - Keys were successfully set.

Response headers: N/A
Produces: application/json


Response
{
  "status_code”: 201,
  "message": "Set GPG public & private key"
}

Get Public Key

Description: Returns the public GPG key set in Distribution.
Note: The private key field will be displayed in the JSON response format, only if the private key exists in the DB for that public key. 
When GPG public key was not uploaded in the first place, the following message is returned: "No public GPG key exists in Distribution".
Since: 2.3.0
Security: Authenticated users only. Users must have read permissions for the Release Bundle.
Usage: GET /api/v1/keys/gpg
Consumes: application/json

cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/keys/gpg" 


Response:

Response
{
   "public_key": "<public gpg key>",
   "private_key": "****"
}



RELEASE BUNDLES

Create Release Bundle Version

Description: Create a new release bundle version.

Since: 1.0
Security: Authenticated users only. User must have matching Release Bundle write permissions.
Usage: POST api/v1/release_bundle
Request headers: 
X-GPG-PASSPHRASE - String - the passphrase for the signing key, if applicable
Consumes: application/json


cURL Example
$ curl -u myUser:myP455w0rd! -H "Accept: application/json" -H "Content-Type: application/json" -H "X-GPG-PASSPHRASE: keysPassphrase" -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle" -T createbundle.json



createbundle.json
{
  "name": "",
  "version": "",
  "dry_run": true|false,
  "sign_immediately": true|false,
  "storing_repository": "repository-name"|null,
  "description": "",
  "release_notes": {
    "syntax": "markdown|asciidoc|plain_text",
    "content": ""
  }, 
  "spec": {
    "queries": [
      {
        "aql": "items.find({ \"repo\" : \"example-repo-local\" })",
        "query_name": ""
        "mappings": [
          {
            "input": "regex",
            "output": "$1/$2"
          }
        ],
        "added_props": [
          {
            "key": "",
            "values": [""]
		  }
        ]
      }
    ]
  }
}
FieldTypeRequiredDefault ValueSinceDescription
name

String

yes

N/A

1.0

Release bundle name

version

String

yes

N/A

1.0

Release bundle version

dry_run

Boolean

no

false

1.0

If true, only parses and validates.
Note: this parameter default was previously set to true in versions below 2.x.

sign_immediately

Boolean

no

false

1.2

If true, automatically signs the release bundle version.

storing_repository

String

no

null

1.3

A repository name at source Artifactory to store release bundle artifacts in. If not provided, Artifactory will use the default one (requires Artifactory 6.5 or later).

description

String

no

null

1.0

Description of the release bundle

release_notes

String

no

null

1.0

Describes the release notes for the release bundle version

release_notes.syntax

String

no

"plain_text"

1.0

The syntax for the release notes

release_notes.content

String

yes

N/A

1.0

The content of the release notes

spec

Object

yes

N/A

1.0

Describes the specification by artifacts are gathered and distributed in this release bundle

spec.source_artifactory_id

StringdeprecatedN/A2.0
spec.queries

List (Object)

yes

N/A

1.0

List of query objects to gather artifacts by.

spec.queries.aql

String

yes

N/A

1.0

AQL query to gather the artifacts from Artifactory

spec.queries.query_name

String

no

"query-{index}"

1.0

A name to be used when displaying the query object

spec.queries.added_props

List (Object)

no

null

1.0

List of added properties which will be added to the artifacts after distribution of the release bundle

spec.queries.added_props.key

String

yes

N/A

1.0

Property key to be created or updated on the distributed artifacts

DOC-268 - Getting issue details... STATUS

spec.queries.added_props.values

List (String)

no

[ ]

1.0

List of values to be added to the property key after distribution of the release bundle

spec.queries.mappings

List (Object)

no

null

1.0

List of mappings, which are applied to the artifact paths after distribution of the release bundle

spec.queries.mappings.input

String

yes

N/A

1.0

Regex matcher for artifact paths

spec.queries.mappings.output

String

yes

N/A

1.0

Replacement for artifact paths matched by the "input" matcher. Capture groups can be used as "$1".

  

Response status codes:

201 - Successfully created release bundle version
409 - Release bundle with same name and version already exists
X    - Status code for error passed from Artifactory AQL

Response headers: N/A
Produces: application/json

Response
 {
	"name": "bundle-name",
	"version": "1.0",
	"state": "OPEN",
	"created": "2018-03-14T10:19:30.678Z",
	"artifacts": [
		{
			"checksum": "0651d26f4cc6ed60cd9d273c440daf7617459d3f6e3d512188ff19d4933e4ff6",
			"source_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
			"target_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
			"props": [
				{
					"key": "conan.package.version",
					"values": [
						"1.0"
					]
				},
				...
			]
		},
		{
			"xray_scan_info": {
			"blocked": boolean.
			"blocked_reason": string (null if not blocked)
		},
		...
	],
	"archived": false
}

NPM, Bower and NuGet Package Types

When working with package types such as NPM, Bower and NuGet, that require transitive dependencies, you will need to create two separate release bundles: 1. An artifacts release bundle, and 2. A dependencies release bundle.

You can generate the build.info using JFrog CLI, and create the release bundles using the following dependency and artifact AQL queries:

Artifact AQL
builds.find({"name":"buileName", "number":"buildNumber"}).include("module.artifact.item")
Dependency AQL
builds.find({"name":"buildName", "number":"buildNumber"}).include("module.dependency.item")

Update Release Bundle Version

Description: Updates an existing unsigned release bundle version.

Since: 1.2
Security: Authenticated users only. User must have matching Release Bundle write permissions.
Usage: PUT api/v1/release_bundle/:name/:version
Request headers: 
X-GPG-PASSPHRASE - String - the passphrase for the signing key, if applicable
Consumes: application/json


cURL Example
$ curl -u myUser:myP455w0rd! -H "Accept: application/json" -H "Content-Type: application/json" -H "X-GPG-PASSPHRASE: keysPassphrase" -X PUT "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/:version" -T createbundle.json



updatebundle.json
{
  "dry_run": true|false,
  "sign_immediately": true|false,
  "description": "",
  "storing_repository": "repository-name"|null,
  "release_notes": {
    "syntax": "markdown|asciidoc|plain_text",
    "content": ""
  }, 
  "spec": {
    "queries": [
      {
        "aql": "items.find({ \"repo\" : \"example-repo-local\" })",
        "query_name": ""
        "mappings": [
          {
            "input": "regex",
            "output": "$1/$2"
          }
        ],
        "added_props": [
          {
            "key": "",
            "values": [""]
        ]
      }
    ]
  }
}
FieldTypeRequiredDefault ValueSinceDescription
dry_run

Boolean

no

false

1.2

If true, only parses and validates.
Note: this parameter default was previously set to true in versions below 2.x.

sign_immediately

Boolean

no

false

1.2

if true, automatically signs the release bundle version.

storing_repository

String

no

null

1.3

A repository name at source Artifactory to store release bundle artifacts in. If not provided, Artifactory will use the default one (requires Artifactory 6.5 or later).

description

String

no

null

1.2

Description of the release bundle

release_notes

String

no

null

1.2

Describes the release notes for the release bundle version

release_notes.syntax

String

no

"plain_text"

1.2

The syntax for the release notes

release_notes.content

String

yes

N/A

1.2

The content of the release notes

spec

Object

yes

N/A

1.2

Describes the specification by artifacts are gathered and distributed in this release bundle

spec.queries

List (Object)

yes

N/A

1.2

List of query objects to gather artifacts by.

spec.queries.aql

String

yes

N/A

1.2

AQL query to gather the artifacts from Artifactory

spec.queries.query_name

String

no

"query-{index}"

1.2

A name to be used when displaying the query object

spec.queries.added_props

List (Object)

no

null

1.2

List of added properties which will be added to the artifacts after distribution of the release bundle

spec.queries.added_props.key

String

yes

N/A

1.2

Property key to be created or updated on distributed artifacts

spec.queries.added_props.values

List (String)

no

[ ]

1.2

List of values to be added to the property key after distribution of the release bundle

spec.queries.mappings

List (Object)

no

null

1.2

List of mappings, which are applied to the artifact paths after distribution of the release bundle

spec.queries.mappings.input

String

yes

N/A

1.2

Regex matcher for artifact paths

spec.queries.mappings.output

String

yes

N/A

1.2

Replacement for artifact paths matched by the "input" matcher. Capture groups can be used as "$1".

  

Response status codes:

200 - Successfully updated release bundle version
400 - Release bundle version is signed
X - Status code for error passed from Artifactory AQL

Response headers: N/A
Produces: application/json

Response
 {
	"name": "bundle-name",
	"version": "1.0",
	"state": "OPEN",
	"created": "2018-03-14T10:19:30.678Z",
	"artifacts": [
		{          
			"checksum": "0651d26f4cc6ed60cd9d273c440daf7617459d3f6e3d512188ff19d4933e4ff6",
			"source_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
			"target_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
			"props": [
				{
					"key": "conan.package.version",
					"values": [
						"1.0"
					]
				},
				...
			]
		},
		{
			"xray_scan_info": {
			"blocked": boolean.
			"blocked_reason": string (null if not blocked)
		},
		...
	],
	"archived": false
}

NPM, Bower and NuGet Package Types

When working with package types such as NPM, Bower and NuGet, that require transitive dependencies, you will need to create two separate release bundles: 1. An artifacts release bundle, and 2. A dependencies release bundle.

You can generate the build.info using JFrog CLI, and create the release bundles using the following dependency and artifact AQL queries:

Artifact AQL
builds.find({"name":"buileName", "number":"buildNumber"}).include("module.artifact.item")
Dependency AQL
builds.find({"name":"buildName", "number":"buildNumber"}).include("module.dependency.item")

Sign Release Bundle Version

Description: Signs a release bundle version and stores it in the source Artifactory (requires Artifactory 6.5 or later) in the storing repository.

Since: 1.2
Security: Authenticated users only. User must have matching Release Bundle write permissions.
Usage: POST api/v1/release_bundle/:name/:version/sign
Request headers: 
X-GPG-PASSPHRASE - String - the passphrase for the signing key, if applicable


cURL Example
$ curl -u myUser:myP455w0rd! -H "Accept: application/json" -H "Content-Type: application/json" -H "X-GPG-PASSPHRASE: keysPassphrase" -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/:version/sign"



FieldTypeRequiredDefault ValueSinceDescription
storing_repository

String

no

null

1.3

A repository name at source Artifactory to store release bundle artifacts in. If not provided, Artifactory will use the default one (requires Artifactory 6.5 or later).


Response status codes:

200 - Successfully signed release bundle version
400 - Release bundle version is already signed

Response headers: N/A
Produces: application/json

Response
 {
	"name": "bundle-name",
	"version": "1.0",
	"state": "SIGNED",
	"created": "2018-03-14T10:19:30.678Z",
	"artifacts": [
		{
			"checksum": "0651d26f4cc6ed60cd9d273c440daf7617459d3f6e3d512188ff19d4933e4ff6",
			"source_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
			"target_repo_path": "conanx/demo/sample-conan1/1.0/testing/export/conanfile.py",
			"props": [
				{
					"key": "conan.package.version",
					"values": [
						"1.0"
					]
				},
				...
			]
		},
		...
	],
	"archived": false
}


Get all Versions of all Release Bundles

Description: Returns all the release bundle versions. This endpoint supports pagination, returning up to 10 release bundles per page.

Since: 1.0
Security: Authenticated users only. Only release bundles which the user has read permission for are displayed.
Usage: GET api/v1/release_bundle[?start_pos=:position]
Request headers: N/A
Consumes: N/A


cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle?start_pos=0"


Response status codes:

200 - Success

Response headers: 
X-RangeLimit-StartPos - number
X-RangeLimit-EndPos  - number
X-RangeLimit-Total       - number

Produces: application/json


Response
[
	{
		"name": "release-bundle-name",
		"version": "1.0.0",
		"state": "OPEN",
		"description": "release bundle description text",
        "release_notes": {
            "content": "release notes text",
            "syntax": "plain_text"
        },
		"created": "2018-03-14T17:36:35.416Z",
        "created_by":"[username]",
        "distributed_by":"[username]"
		"artifacts": [
			{
				"checksum": "0bd5d1e46180436132a86d3d3ec9ddfd7ab0023ac4648f4448fde6e41fffae54",
				"source_repo_path": "maven-1521048945483/org/pom/test/multi1/1.1/multi1-1.1.jar",
				"target_repo_path": "maven-1521048945483/org/pom/test/multi1/1.1/multi1-1.1.jar"
                "props": [
					{
						"key": "build.timestamp",
						"values": [
							"1521049005953"
						]
					},
					...
				]
			},
			{
				"xray_scan_info": {
				"blocked": boolean.
				"blocked_reason": string (null if not blocked)
			},
			...
		],
		"archived": false
	},
    ...
]


Get Release Bundle Versions

Description: Returns all the release bundle versions. This endpoint supports pagination, returning up to 10 release bundles per page.

Since: 1.0
Security: Authenticated users only. User must have read permission for the release bundle.
Usage: GET api/v1/release_bundle/:name[?start_pos=:position]
Request headers: N/A
Consumes: N/A


cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name?start_pos=0"


Response status codes:

200 - Success
404 - Release bundle not found
Response headers: 
X-RangeLimit-StartPos - number
X-RangeLimit-EndPos  - number
X-RangeLimit-Total       - number

Produces: application/json


Response
[
  {
    "name": "release-bundle-name",
    "version": "1",
	"state": "OPEN",
    "description": "release bundle description text",
    "release_notes": {
      "content": "release notes description text",
      "syntax": "plain_text"
    },
    "created": "2018-03-14T17:36:35.416Z",
    "created_by":"[username]",
    "distributed_by":"[username]",
    "artifacts": [
      {
	    "checksum": "5880e05b5886a2fcd9a5a6dace38cd4f243affa06719c5e63116b16094e95a31",
        "props": [
	      {
		    "key": "build.timestamp",
		    "values": ["1521049005953"]
		  },
		  ...
	    ],
	    "source_repo_path": "artifactory-generic/bintray-client-java-api-0.9.2.jar",
	    "target_repo_path": "artifactory-generic/bintray-client-java-api-0.9.2.jar"
	  },
      ...
    ],
    "archived": false
  },
  ...
] 


Get Release Bundle Version

Description: View a specific release bundle version. Multiple response formats are supported.

Since: 1.0
Security:  Authenticated users only. User must have read permission for the release bundle.
Usage: GET api/v1/release_bundle/:name/:version[?format=json | jws | jose]
Request headers: N/A
Consumes: N/A


cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/:version?format=json"


Response status codes:
200 - Success
404 - Release bundle or release bundle version not found
Response headers: N/A

Produces: application/json (default)


format=json
{
  "name": "bundle-name",
  "version": "1.0.0",
  "state": "OPEN",
  "description": "Bundle description",
  "release_notes": {
    "content": "release notes description text",
    "syntax": "plain_text"
  },
  "created": "2018-05-02T08:45:16.860Z",
  "created_by":"[username]",
  "distributed_by":"[username]",
  "artifacts": [
    {
      "source_repo_path": "example-repo-local/Screen Shot 2018-04-05 at 10.47.16.png",
      "target_repo_path": "example-repo-local/achange/Screen Shot 2018-04-05 at 10.47.16.png",
      "checksum": "5a730b01e81e2aa3b5188bcef3be8e4e7d61f83b6156b22a33c9a3f23ff38e19",
      "props": [
        {
          "key": "jira",
          "values": ["1"]
        }
      ]
    },
    ...
  ],
  "archived": false
}
Produces: application/jose+json (format=jws) 

format=jws
{
    "header": "eyJraWQiOiIzZWFiNGEiLCJhbGciOiJSUzI1NiJ9",
    "payload": "eyJuYW1lIjoiYnVuZGxlLW5hbWUiLCJ2ZXJzaW9uIjoiMS4wLjAiLCJkZXNjcmlwdGlvbiI6IkJ1bmRsZSBkZXNjcmlwdGlvbiIsInJlbGVhc2Vfbm90ZXMiOnsiY29udGVudCI6InJlbGVhc2Ugbm90ZXMgZGVzY3JpcHRpb24gdGV4dCIsInN5bnRheCI6InBsYWluX3RleHQifSwiY3JlYXRlZCI6IjIwMTgtMDUtMDJUMDg6NDU6MTYuODYwWiIsImFydGlmYWN0cyI6W3sicmVwb19wYXRoIjoiZXhhbXBsZS1yZXBvLWxvY2FsL2FjaGFuZ2UvU2NyZWVuIFNob3QgMjAx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Note: Latest is a reserved word. Release Bundle versions cannot contain this word.
Since: 2.3.0
Security: Authenticated users only. Users must have read permissions for the Release Bundle.
Usage:  /api/v1/release_bundle/:name/:LATEST
Request headers: N/A
Consumes: N/A
cURL

Response status codes:
200 - Success
403 - No permission for the Release Bundle
404 - Release Bundle or Release Bundle version not found
Response

{
  "name": "the_release_bundle",
  "version": "6",
  "storing_repository": "release-bundles",
  "description": "Maven bundle description",
  "created": "2020-05-03T12:33:40.759+0300",
  "created_by": "[username]",
  "distributed_by": "[username]",
 
 
  "artifacts": [
    {
      "checksum": "d4f8baa9d0b46aa1e5d9e60bfd7acc1265c51723844d81ad0b2dfc9f702e89f8",
      "props": [],
      "sourceRepoPath": "release-bundles/the_release_bundle/6/example-repo-local/folder1/public_key.txt",
      "targetRepoPath": "example-repo-local/folder1/public_key.txt"
    },
    {
      "checksum": "c7e875ebb4a69de287eb040375a88d254acf85c2b69dc9a59689d657e7f2d3cb",
      "props": [],
      "sourceRepoPath": "release-bundles/the_release_bundle/6/example-repo-local/audio-1.5.0.tar.gz",
      "targetRepoPath": "example-repo-local/audio-1.5.0.tar.gz"
    }
  ],
  "artifacts_size": 2892,
  "archived": false,
  "state": "SIGNED",
  "spec": {
    "queries": [
      {
        "aql": "items.find({ \"repo\" : \"example-repo-local\" })",
        "query_name": "query-0",
        "mappings": [],
        "added_props": [],
        "query_type": "AQL"
      }
    ]
  }
}

Delete Release Bundle All Versions

Description: Deletes all versions of a release bundle on JFrog Distribution only. To delete from Artifactory Edge nodes where it was distributed, see Delete Release Bundle Version from Artifactory Edge nodes.

Since: 1.0
Security:  Authenticated users only. User must have delete permission for the release bundle.
Usage: DELETE /api/v1/release_bundle/:name
Request headers: N/A
Consumes: N/A


cURL Example
$ curl -u myUser:myP455w0rd! -X DELETE "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name"


Response status codes:

204 - Successfully deleted release bundle versions
404 - Release bundle not found

Response headers: N/A

Produces: N/A

Delete Release Bundle Version

Description: Deletes specific release bundle version on JFrog Distribution only. 

Since: 1.0
Security:  Authenticated users only. User must have delete permission for the release bundle.To delete from Artifactory Edge nodes where it was distributed, see Delete Release Bundle Version from Artifactory Edge nodes.
Usage: DELETE /api/v1/release_bundle/:name/:version
Request headers: N/A
Consumes: N/A


cURL Example
$ curl -u myUser:myP455w0rd! -X DELETE "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/:version"


Response status codes:

204 - Successfully deleted release bundle version
404 - Release bundle or release bundle version not found

Response headers: N/A

Produces: N/A


DISTRIBUTION

Distribute Release Bundle Version

Description: Schedules a release bundle version for distribution to Edge nodes. Action tracking id will be returned.

Since: 1.0
Security: Authenticated users only. User must have distribution permission for the release bundle. The Edge nodes will be filtered by the user's permissions.
Usage: POST /api/v1/distribution/:name/:version
Request headers: N/A
Consumes: application/json


cURL Example
$ curl -u myUser:myP455w0rd! -H "Content-Type: application/json" -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/distribution/:name/:version" -T distribute.json



distribute.json
{
  "dry_run": true|false,
  "distribution_rules": [
    {
      "site_name": "?wildcard*",
      "city_name": "?wildcard*",
      "country_codes": ["?wildcard*"]
    }
  ]
}
FieldTypeRequiredDefault ValueDescription
dry_run
Booleannofalse 

If true, only parses and validates.
Note: this parameter default was previously set to true in versions below 2.x.

distribution_rules
List (Object)yesN/A Describes the filters by which Artifactory Edge nodes are selected. Must resolve at least one node.
distribution_rules.site_name
Stringno"*" Wildcard filter for site name
distribution_rules.city_name
Stringno"*" Wildcard filter for site city name
distribution_rules.country_codes
List (String)no[ "*" ] Wildcard filters for site country codes


 

Response status codes:

200 - Success for dry_run
202 - Successfully scheduled distribution

400 - Release bundle version must be signed before distribution

404 - Release bundle or release bundle version not found

Response headers: N/A

Produces: application/json


Response
{
  "id": 188527534551203840,
  "sites": [
    {
      "service_id": "jfrt@01cc8hkzy1zgtc1wqw3zk41p2a",
      "name": "US_NY_Art01",
      "type": "edge"
    },
    ...
  ]
}


Stop Release Bundle Version Distribution

Description: Stop a release bundle version distribution to Artifactory Edge nodes.

Since: 1.1
Security: Authenticated users only. User must have distribution permission for the release bundle. The Edge nodes will be filtered by the user's permissions.
Usage: PUT /api/v1/distribution/:name/:version/abort
Request headers: N/A
Consumes: application/json


cURL Example
$ curl -u myUser:myP455w0rd! -X PUT "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/distribution/:name/:version/abort"

Response status codes:

202 - Successfully scheduled distribution interruption. Returns the list of Artifactory Edge nodes affected by the stop request.

204 - No Artifactory Edge node with distribution in progress found
404 - Release bundle or release bundle version not found

Response headers: N/A

Produces: application/json


Response
[
    {
        "name":"US_NY_Art01",
        "service_id":"jfrt@01cejrg5ack7dd1v3r213a0vx9",
        "type":"edge"
    },
    {
        "name":"UK_LN_Art02",
        "service_id":"jfrt@01cejrfwjtt65d1g9asq8h1cda",
        "type":"edge"
    }
]


Delete Release Bundle Version from Artifactory Edge nodes

Description: Schedules a release bundle version for deletion in Artifactory Edge nodes. Action tracking id will be returned. Have a parameter to keep or delete release bundle from JFrog Distribution on success.

Since: 1.0
Security: Authenticated users only. User must have distribution delete permission for the release bundle. The Edge nodes will be filtered by the user's permissions.
Usage: POST /api/v1/distribution/:name/:version/delete
Request headers: N/A
Consumes: application/json


cURL Example
$ curl -u myUser:myP455w0rd! -H "Content-Type: application/json" -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/distribution/bundle98/version100/delete" -T delete.json



delete.json
{
  "dry_run": true|false,
  "distribution_rules": [
    {
      "site_name": "?wildcard*",
      "city_name": "?wildcard*",
      "country_codes": ["?wildcard*"]
    }
  ],
  "on_success": "keep|delete"
}
FieldTypeRequiredDefault ValueDescription
dry_run
Booleannotrue 
If true, only parses and validates
distribution_rules
List (Object)yesN/A Describes the filters by which Edge nodes are selected. Must resolve at least one node.
distribution_rules.site_name
Stringno"*" Wildcard filter for site name
distribution_rules.city_name
Stringno"*" Wildcard filter for site city name
distribution_rules.country_codes
List (String)no[ "*" ] Wildcard filters for site country codes
on_success
StringnokeepAction to be performed on the release bundle version in JFrog Distrubution itself after deletion is complete in the specified Edge node/s.


Response status codes:

200 - Success for dry_run
202 - Successfully scheduled deletion
404 - Release bundle or release bundle version not found

Response headers: N/A

Produces: application/json


Response
{
  "id": 188527534551203840,
  "sites": [
    {
      "service_id": "jfrt@01cc8hkzy1zgtc1wqw3zk41p2a",
      "name": "US_NY_Art01",
      "type": "edge"
    },
    ...
  ]
}


Get Distribution Status Details

Description:  Get status details for all distributions.

Since: 1.0
Security: Authenticated users only. Only distributions of release bundles which the user has read permission for are displayed.
Usage: GET api/v1/release_bundle/distribution
Request Headers: N/A

Consumes: N/A

cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/distribution"

Response status codes:

200 - Success

Response headers: N/A

Produces: application/json


Response
[
  {
    "distribution_id": 188527534551203840,
    "distribution_friendly_id": 1,
    "created_by":"[username]",
    "distributed_by":"[username]",
    "start_time":"[YYY-MM_DDTHH:HH:MM:SS.MI:Sec+UTF]",
    "finish_time":[YYY-MM_DDTHH:HH:MM:SS.MI:Sec+UTF],"duration":[milliseconds],    "type": "distribute | delete_release_bundle_version",
    "release_bundle_name": "release-bundle",
    "release_bundle_version": "1.0.0",
    "status": "Not distributed | In progress | Completed | Failed",
    "distribution_rules": [
      {
        "site_name": "*",
        "city_name": "*",
        "country_codes": ["*"]
      },
      ...
    ],
    "sites": [
      {
        "status": "Not distributed | In progress | Completed | Failed",
        "general_error": "<error explanation>",
        "target_artifactory": {
          "service_id": "jfrt@01cc8hkzy1zgtc1wqw3zk41p2a",
          "name": "US_NY_Art01",
          "type": "edge"
        },
        "total_files": 4,
        "total_bytes": 4403784,
        "distributed_bytes": 0,
        "distributed_files": 0,
        "general_error": "",
        "file_errors": [],
        "files_in_progress": []
      },
      ...
    ]
  },
  ...
]


Get Distribution Status Details by Release Bundle Name

Description:  Get status details for all distributions of all versions of a release bundle.

Since: 1.0
Security: Authenticated users only. User must have read permission for the release bundle.
Usage: GET api/v1/release_bundle/:name/distribution
Request Headers: N/A

Consumes: N/A

cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/distribution"


Response status codes:

200 - Success

Response headers: N/A

Produces: application/json


Response
[
  {
    "distribution_id": 188527534551203840,
    "distribution_friendly_id": 1,
    "created_by":"[username]",
    "distributed_by":"[username]",
    "start_time":"[YYY-MM_DDTHH:HH:MM:SS.MI:Sec+UTF]",
    "finish_time":[YYY-MM_DDTHH:HH:MM:SS.MI:Sec+UTF],
    
    "type": "distribute | delete_release_bundle_version",
    "release_bundle_name": "release-bundle",
    "release_bundle_version": "1.0.0",
    "status": "Not distributed | In progress | Completed | Failed",
    "distribution_rules": [
      {
        "site_name": "*",
        "city_name": "*",
        "country_codes": ["*"]
      },
      ...
    ],
    "sites": [
      {
        "status": "Not distributed | In progress | Completed | Failed",
        "general_error": "<error explanation>",
        "target_artifactory": {
          "service_id": "jfrt@01cc8hkzy1zgtc1wqw3zk41p2a",
          "name": "US_NY_Art01",
          "type": "edge"
        },
        "total_files": 4,
        "total_bytes": 4403784,
        "distributed_bytes": 0,
        "distributed_files": 0,
        "general_error": "",
        "file_errors": [],
        "files_in_progress": []
      },
      ...
    ]
  },
  ...
]


Get Distribution Status Details by Release Bundle Version

Description:  Get status details for all distributions of a specific release bundle version.

Since: 1.0
Security: Authenticated users only. User must have read permission for the release bundle.
Usage: GET api/v1/release_bundle/:name/:version/distribution
Request Headers: N/A

Consumes: N/A

cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/:version/distribution"


Response status codes:

200 - Success

Response headers: N/A

Produces: application/json


Response
[
  {
    "distribution_id": 188527534551203840,
    "distribution_friendly_id": 1,
    "type": "distribute | delete_release_bundle_version",
    "release_bundle_name": "release-bundle",
    "release_bundle_version": "1.0.0",
    "status": "Not distributed | In progress | Completed | Failed",
    "distribution_rules": [
      {
        "site_name": "*",
        "city_name": "*",
        "country_codes": ["*"]
      },
      ...
    ],
    "sites": [
      {
        "status": "Not distributed | In progress | Completed | Failed",
        "general_error": "<error explanation>",
        "target_artifactory": {
          "service_id": "jfrt@01cc8hkzy1zgtc1wqw3zk41p2a",
          "name": "US_NY_Art01",
          "type": "edge"
        },
        "total_files": 4,
        "total_bytes": 4403784,
        "distributed_bytes": 0,
        "distributed_files": 0,
        "general_error": "",
        "file_errors": [],
        "files_in_progress": []
      },
      ...
    ]
  },
  ...
]


Get Distribution Status Details by Tracker Id

Description:  Get status details for a specific distribution.

Since: 1.0
Security: Authenticated users only. User must have read permission for the release bundle.
Usage: GET api/v1/release_bundle/:name/:version/distribution/:tracker_id
Request Headers: N/A

Consumes: N/A

 

cURL Example
$ curl -X GET -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/:version/distribution/:tracker_id"

 

Response status codes:

200 - Success

Response headers: N/A

Produces: application/json


Response
{
  "distribution_id": 188527534551203840,
  "distribution_friendly_id": 1,
  "created_by":"[username]",
  "distributed_by":"[username]",
  "start_time":"[YYY-MM_DDTHH:HH:MM:SS.MI:Sec+UTF]",
  "finish_time":[YYY-MM_DDTHH:HH:MM:SS.MI:Sec+UTF],
  "type": "distribute | delete_release_bundle_version",
  "release_bundle_name": "release-bundle",
  "release_bundle_version": "1.0.0",
  "status": "Not distributed | In progress | Completed | Failed",
  "distribution_rules": [
    {
      "site_name": "*",
      "city_name": "*",
      "country_codes": ["*"]
    },
    ...
  ],
  "sites": [
    {
      "status": "Not distributed | In progress | Completed | Failed",
      "general_error": "<error explanation>",
      "target_artifactory": {
        "service_id": "jfrt@01cc8hkzy1zgtc1wqw3zk41p2a",
        "name": "US_NY_Art01",
        "type": "edge"
      },
      "total_files": 4,
      "total_bytes": 4403784,
      "distributed_bytes": 0,
      "distributed_files": 0,
      "general_error": "",
      "file_errors": [],
      "files_in_progress": []
    },
    ...
  ]
}

TOKEN MANAGEMENT

Create a Token

Description: Creates an authentication token for an existing (non-transient) user.

Since: 1.2
Security: admin for itself and others (or with admin scope), user for itself only
Usage: POST /api/v1/security/token
Request Headers: N/A
Consumes: application/x-www-form-urlencoded


cURL Example
$ curl -X POST -u myUser:myP455w0rd! http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/token -d 'username=user' -d 'refreshable=true' -d 'scope=applied-permissions%2Fadmin' -d "expires_in=123"


Response status codes:

201 - Successfully created token

Response headers: N/A

Produces: application/json


Response
 {
	"access_token": "eyJ2ZXIiOiIyIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYiLCJraWQiOiJ6WWFWQjVFRlpkOXlpbWtCNkZTbDAtSWFhMHRPWldLX293c1BTVTNTZmdNIn0.eyJzdWIiOiJsZW5vbiIsInNjcCI6ImFwcGxpZWQtcGVybWlzc2lvbnNcL2FkbWluIiwiYXVkIjoiamZkc0AwMWNoMDV0ajRuM3NzODBzNm4zdjIzMDdiOSIsImlzcyI6ImpmZHNAMDFjaDA1dGo0bjNzczgwczZuM3YyMzA3YjkiLCJleHAiOjE1MzAwOTk2MTgsImlhdCI6MTUzMDA5OTQ5NSwianRpIjoiYTQzM2YwZDAtNTQ5OC00YjI5LWE5ODctZjI3MTNkYmMyOTdmIn0.E7csEhcHqsOJxz1jmhDVu_Ij51yQyxYifMXusexqZk78pi_7YHlJcY1iRg6VMthdv8_Db2CsaNzYdubCyTTt77OOTSVfqJdZsm_0AEz-paIj71lvgyJBFLZ2bjE253tMGLgweypUqqEsEH3J3FyfAaw4XXURlKT5inbwKklMu-DvPG5772ZS1Y6YPU8oOGc2dWg_BHUvjMTJ5vQAw0Ws5Ta2CJ0DF40JLQKcyN_JCgzQ2RCXr2C70JIF9Fa0OBaIKVT-DguSNGU83dnr-YF0XBsUcTDu5K-Jl5H3FMdb129awXe4_fLLdltMK8iAaRujsIDlvexdlezVal4nLRZcxA",
	"refresh_token": "f96bda0c-ab50-4b7e-96f1-be8bd20605a3",
	"expires_in": 123,
	"scope": "applied-permissions/admin",
	"token_type": "Bearer"
}
FieldTypeRequiredDefault ValueDescription
grant_typeStringnoclient_credentialsThe grant type used to authenticate the request. In this case, the only value supported is "client_credentials" which is also the default value if this parameter is not specified.
usernameStringyes
The user name for which this token is created. Non-admin users can only create tokens for themselves so they must specify their own username.
scopeStringno
The scope to assign to the token provided as a space-separated list of scope tokens. Currently there are only one possible scope option:
applied-permissions/admin
expires_inLongno0

The time in seconds for which the token will be valid. To specify a token that never expires, set to zero.

refreshableBooleannofalseIf true, this token is refreshable and the refresh token can be used to replace it with a new token once it expires.

Refresh a Token


Description: Refreshes the authentication token for an existing (non-transient) user.
Since: 1.2
Security: admin for itself and others (or with admin scope), user for itself onlya
Usage: POST /api/v1/security/token
Request Headers: N/A
Consumes: application/x-www-form-urlencoded


FieldTypeRequiredDefault ValueDescription
grant_typeStringyes
The grant type used to authenticate the request. In this case, the only value supported is "refresh_token".
access_tokenStringyes
The access token to refresh.
refresh_tokenStringyes
The refresh token of the access token that needs to be refreshed.
expires_inLongno0

The time in seconds for which the token will be valid. To specify a token that never expires, set to zero.

refreshableBooleannotrueIf true, this token is refreshable and the refresh token can be used to replace it with a new token once it expires.
cURL Example
$ curl -X POST -u myUser:myP455w0rd! http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/token -d "grant_type=refresh_token" -d "refresh_token=fgsg53t3g…" -d "access_token=gsfdgw35gt..."


Response status codes:

200 - Successfully refreshed token

Response headers: N/A

Produces: application/json


Response
 {
	"access_token": "eyJ2ZXIiOiIyIiwidHlwIjoiSldUIiwiYWxnIjoiUlMyNTYiLCJraWQiOiJ6WWFWQjVFRlpkOXlpbWtCNkZTbDAtSWFhMHRPWldLX293c1BTVTNTZmdNIn0.eyJzdWIiOiJsZW5vbiIsInNjcCI6ImFwcGxpZWQtcGVybWlzc2lvbnNcL2FkbWluIiwiYXVkIjoiamZkc0AwMWNoMDV0ajRuM3NzODBzNm4zdjIzMDdiOSIsImlzcyI6ImpmZHNAMDFjaDA1dGo0bjNzczgwczZuM3YyMzA3YjkiLCJleHAiOjE1MzAwOTk2MTgsImlhdCI6MTUzMDA5OTQ5NSwianRpIjoiYTQzM2YwZDAtNTQ5OC00YjI5LWE5ODctZjI3MTNkYmMyOTdmIn0.E7csEhcHqsOJxz1jmhDVu_Ij51yQyxYifMXusexqZk78pi_7YHlJcY1iRg6VMthdv8_Db2CsaNzYdubCyTTt77OOTSVfqJdZsm_0AEz-paIj71lvgyJBFLZ2bjE253tMGLgweypUqqEsEH3J3FyfAaw4XXURlKT5inbwKklMu-DvPG5772ZS1Y6YPU8oOGc2dWg_BHUvjMTJ5vQAw0Ws5Ta2CJ0DF40JLQKcyN_JCgzQ2RCXr2C70JIF9Fa0OBaIKVT-DguSNGU83dnr-YF0XBsUcTDu5K-Jl5H3FMdb129awXe4_fLLdltMK8iAaRujsIDlvexdlezVal4nLRZcxA",
	"refresh_token": "f96bda0c-ab50-4b7e-96f1-be8bd20605a3",
	"expires_in": 123,
	"scope": "applied-permissions/admin",
	"token_type": "Bearer"
}


Revoke a Token

Description: Revokes an access token by specifying the token or the token_id

Since: 1.2
Security: Admin
Usage: POST /api/v1/security/token/revoke
Request Headers: N/A
Consumes: application/x-www-form-urlencoded


cURL Example
$ curl -u myUser:myP455w0rd! -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/token/revoke" -d "token=fasdt3..."

or

$ curl -u myUser:myP455w0rd! -X POST "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/token/revoke" -d "token_id=7e0eec..."


FieldTypeRequiredDescription
tokenStringyes (if token_id is empty)The token to be revoked. Must not be specified if token_id specified.
token_id
Stringyes (if token is empty)The ID of the token to be revoked. Must not be specified if token specified.

Response status codes:

200 - Successfully revoked token
404 - Token not found


Get Tokens Info

Description: Gets a list of access tokens for a specific user.

Since: 1.2
Security: Admin
Usage: GET /api/v1/security/token


cURL Example
$ curl -u myUser:myP455w0rd! -X GET "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/token"


Response status codes:

200 - Successfully retrieves the list of tokens
404 - Tokens not found
Response headers: N/A

Produces: application/json


Response
{
	"tokens": [
		{
			"token_id": "58ae2b6f-085d-493e-b7c3-670d7700c034",
			"issuer": "jfds@01ch05tj4n3ss80s6n3v2307b9",
			"subject": "admin",
			"issued_at": 1530088236,
			"expiry": 2476168236,
			"refreshable": false
		},
		{
			"token_id": "5c0399f9-de42-4cc8-bbd6-ba04a8b861a7",
			"issuer": "jfds@01ch05tj4n3ss80s6n3v2307b9",
			"subject": "lenon",
			"issued_at": 1530089226,
			"refreshable": true
		}
	]
}



PERMISSION MANAGEMENT

Permission action types:

d

delete

x

distribute

  

Create/Update Destinations Permissions by Name

Permissions can be created and overridden by specifying the unique permission name.

Destination permission is used to define permissions for interactions with Artifactory Edge nodes, such as distributing and deleting release bundles.

Allowed actions for destination permission: x, d.

The permissions are applied to Artifactory Edge nodes which information is matched by the passed wildcard expressions.

Description: Create/Update permissions for users and groups, based on permission scope. The response body will contain the created/updated permission.

Since: 2.0
Security: Admin only.
Usage: PUT /api/v1/security/permissions/:name
Request Headers: N/A
Consumes: application/json

cURL Example
$ curl -X PUT -u myUser:myP455w0rd! -H "Content-Type: application/json" "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/permissions/:name" -T permission.json
permission.json
{
  "distribution_destinations": [
    {
      "site_name": "*",
      "city_name": "*",
      "country_codes": [
        "*"
      ]
    }
  ],
  "name": "permission-name",
  "resource_type": "destination",
  "principals": {
    "users": {
      "anonymous": [
        "x"
      ]
    },
    "groups": {
      "readers": [
        "x"
      ]
    }
  }
}


Response status codes:
200 - Successfully set permission
Response headers: N/A
Produces: application/json

  

Response
{
  "distribution_destinations": [
    {
      "site_name": "*",
      "city_name": "*",
      "country_codes": [
        "*"
      ]
    }
  ],
  "name": "permission-name",
  "resource_type": "destination",
  "principals": {
    "users": {
      "user1": [
        "x"
      ]
    },
    "groups": {
      "group1": [
        "x"
      ]
    }
  }
}


Get All Permissions

Description: Get all permissions.

Since: 2.0
Security: Admin only.

Usage: GET /api/v1/security/permissions
Request Headers: N/A
Consumes: application/json


cURL Example
$ curl -X GET -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/permissions"


Response status codes:

200 - Success

Response headers: N/A

Produces: application/json


Response
[
    {
        "distribution_destinations": [
            {
                "site_name": "*",
                "city_name": "*",
                "country_codes": [
                    "*"
                ]
            }
        ],
        "name": "permission-name",
        "resource_type": "destination",
        "principals": {
            "users": {
                "anonymous": [
                    "x"
                ]
            },
            "groups": {
                "readers": [
                    "x"
                ]
            }
        }
    }
]

Get Permission by name

Description: Get permission information by name.

Since: 2.0
Security: Admin only.
Usage: GET /api/v1/security/permissions/:name
Request Headers: N/A
Consumes: N/A


cURL Example
$ curl -X GET -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/permissions/:name

Response status codes:

200 - Success
404 - Permission not found

Response headers: N/A

Produces: application/json


Response
{
  "distribution_destinations": [
    {
      "site_name": "*",
      "city_name": "*",
      "country_codes": [
        "*"
      ]
    }
  ],
  "name": "permission-name",
  "resource_type": "destination",
  "principals": {
    "users": {
      "anonymous": [
        "x"
      ]
    },
    "groups": {
      "readers": [
        "x"
      ]
    }
  }
}

Delete Permission by name

Description: Delete permission by it's id

Since: 1.0
Security: Admin only.
Usage: DELETE /api/v1/security/permissions/:name
Request Headers: N/A
Consumes: N/A


cURL Example
$ curl -X DELETE -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/security/permissions/:name"

Response status codes:

204 - Successfully deleted permission
404 - Permission not found

Response headers: N/A

Produces: N/A


SUPPORT

Create Support Bundle

Description: Creates support bundle 
Since: 1.6
Security: Admin only
Usage: POST  /api/v1/system/support/bundle
Request headers: N/A
Consumes: application/json
Produces: application/json

cURL Example
$ curl -X POST -u myUser:myP455w0rd! -H "Content-Type: application/json" "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/support/bundle" -T create_support_bundle.json
create_support_bundle.json
{
 "parameters": {
                "configuration": true|false,
                "logs": {
                         "include":  true|false,
                         "start_date": ISO8601 based date in the pattern: YYYY-MM-DD,
                         "end_date": ISO8601 based date in the pattern: YYYY-MM-DD,
                        },
                "system": true|false,
                "thread_dump": {
                                "count": 1,
                                "interval" :0
                               }
                    },
  "description": "",
  "name": ""
}
FieldTypeRequiredDefault ValueSinceDescription
parameters

Object

no

N/A

1.6

Support bundle parameters

parameters.configuration

Boolean

no

true

1.6

Collect configuration files

parameters.logs

Object

no

N/A

1.6

Collect all system logs, if this field is not specified support bundle will collect logs from day before today until today.

parameters.logs.include

Boolean

no

true

1.6

Collect system logs.

parameters.logs.start_date

String

no

Day before end_date

1.6

Start date from which to fetch the logs
parameters.logs.end_date
StringnoToday1.6End date until which to fetch the logs
system

Boolean

no

true

1.6

Information about your system including storage, system properties, cpu, and JVM information
thread_dump

Object

no

N/A

1.6

Create a thread dump for all running threads
thread_dump.count

Integer

no

1

1.6

Number of thread dumps to collect


thread_dump.interval

Integer

no

0


1.6

Interval between times of collect thread dump in milliseconds


description

String

no

N/A

1.6

Support bundle description


name
StringnoN/A1.6Support bundle name


Response status codes:

200 - Successfully create support bundle

Response headers: N/A
Produces: application/json

response.json
{
 "id": 20181230145474-53666747,
  "artifactory": { 
                 "service_id": "jfds@...",
                 "bundle_url":
                      http://<artifactory host>:<artifactory port>/artifactory/support-bundles/<bundle id>/jfds/<service id>
                 }
}

Create Specific Support Bundle

Description: Creates a new support bundle and assigns it a specific ID
Since: 1.6
Security: Admin only
Usage: PUT  /api/v1/system/support/bundle/:bundle_id
Request headers: N/A
Consumes: application/json
Produces: application/json

cURL Example
$ curl -X PUT -u myUser:myP455w0rd! -H "Content-Type: application/json" "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/support/bundle/:bundle_id" -T create_support_bundle.json
create_support_bundle.json
{
 "parameters": {
                "configuration": true|false,
                "logs": {
                         "include":  true|false,
                         "start_date": ISO8601 based date in the pattern: YYYY-MM-DD,
                         "end_date": ISO8601 based date in the pattern: YYYY-MM-DD,
                        },
                "system": true|false,
                "thread_dump": {
                                "count": 1,
                                "interval" :0
                               }
                    },
  "description": "",
  "name": ""
}
FieldTypeRequiredDefault ValueSinceDescription
parameters

Object

no

N/A

1.6

Support bundle parameters

parameters.configuration

Boolean

no

true

1.6

Collect configuration files

parameters.logs

Object

no

N/A

1.6

Collect all system logs, if this field is not specified support bundle will collect logs from day before today until today.

parameters.logs.include

Boolean

no

true

1.6

Collect system logs.

parameters.logs.start_date

String

no

Day before end_date

1.6

Start date from which to fetch the logs
parameters.logs.end_date
StringnoToday1.6End date until which to fetch the logs
system

Boolean

no

true

1.6

Information about your system including storage, system properties, cpu, and JVM information
thread_dump

Object

no

N/A

1.6

Create a thread dump for all running threads
thread_dump.count

Integer

no

1

1.6

Number of thread dumps to collect


thread_dump.interval

Integer

no

0


1.6

Interval between times of collect thread dump in milliseconds


description

String

no

N/A

1.6

Support bundle description


name
StringnoN/A1.6Support bundle name

Response status codes:

200 - Successfully create support bundle
400 - Corresponding repository does not exist in Artifactory. Support bundle will be persisted to the file system in each Distribution node.
404 - Artifactory authentication provider could not be found
Response headers: N/A
Produces: application/json

response.json
{
 "id": 20181230145474-53666747,
  "artifactory": { 
                 "service_id": "jfds@...",
                 "bundle_url":
                      http://<artifactory host>:<artifactory port>/artifactory/support-bundles/<bundle id>/jfds/<service id>
                 }
}


Get Support Bundle Info

Description: get support bundle information
Since: 1.6
Security: Admin only
Usage: GET  /api/v1/system/support/bundle/:bundle_id
Request headers: N/A
Consumes: N/A

cURL Example
$ curl -X GET -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/support/bundle/:bundle_id"

Response status codes:

200 - Successfully get support bundle info
404 - Support bundle not found
Response headers: N/A
Produces: application/json

info_support_bundle.json
{
 "parameters": {
                "configuration": true,
                "logs": {
                         "include":  true,
                         "start_date": 2019-01-20,
                         "end_date": 2019-01-21
                        },
                "system": true,
                "thread_dump": {
                                "count": 2,
                                "interval": 100
                               }
                    },
  "description": "",
  "name": ""
  "artifactory": {
                 "service_id": "",
                 "bundle_url": 
                      http://<artifactory host>:<artifactory port>/artifactory/support-bundles/<bundle id>/jfds/<service id>
                 }
  },
  status: success,
  created:  2019-02-02,
}


Get support bundle

Description: download support bundle
Since: 1.6
Security: Admin only
Usage: GET  /api/v1/system/support/bundle/:bundle_id/archive
Request headers: N/A
Consumes: N/A

cURL Example
$ curl -X GET -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/support/bundle/:bundle_id/archive" --output support_bundle.zip

Response status codes:

200 - Successfully download support bundle
404 - Support bundle not found
Response headers: N/A

response.json
200 OK
Content-Type: application/zip


Delete Support Bundle

Description: delete support bundle
Since: 1.6
Security: Admin only
Usage: DELETE  /api/v1/system/support/bundle/:bundle_id
Request headers: N/A
Consumes: N/A

cURL Example
$ curl -X DELETE -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/support/bundle/:bundle_id"

Response status codes:

204 - Successfully delete support bundle
404 - Support bundle not found
Response headers: N/A

response.json
204 No Content


List Support Bundles

Description: 
get the list of all support bundles
Since: 1.6
Security: Admin only
Usage: GET  /api/v1/system/support/bundles
Request headers: N/A
Consumes: N/A

cURL Example
$ curl -X GET -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/system/support/bundles"

Response status codes:

200 - Success
Response headers: N/A

response.json
{
  "count": 2,
  "bundles": [
    {
      id: 20181230145474-53666747,
      description: "",
      name: "",
      created:  2018-12-30,
    },
    ….
  ]
}



XRAY

Triggers Xray Release Bundle Version Indexing

Description: Triggers Xray indexing of the release bundle version.
Since: 2.0.0
Security: Authenticated users only. User must have matching Release Bundle write permissions.
Usage: POST api/v1/release_bundle/:name/:version/trigger_xray_scan
Request headers: N/A
Consumes: N/A

cURL Example
$ curl -X POST -u myUser:myP455w0rd! "http://ARTIFACTORY_SERVER_HOSTNAME:8082/distribution/api/v1/release_bundle/:name/:version/trigger_xray_scan

Response status codes:

200 - Success


IMPORT & EXPORT

Get Source Artifactory_IDs

Description: Lists the Artifactory IDs containing Release Bundles. Used as the preliminary step, prior to exporting the Release Bundles metadata to the relevant Distribution services.
Notes: To support the One to One Pairing ratio between Artifactory (from 7.x) and Distribution (from 2.4) introduced in the JFrog Platform, you need to migrate the Distribution metadata to Distribution services based on the list generated by this command. For more information, see Distribution REST API.
Since: 2.4
Security: Requires an admin user
Usage: POST /v1/system/migration/import_export/source_artifactories
Consumes: application/json
Produces: application/json
Sample Usage: 

POST /v1/system/migration/import_export/source_artifactories

Export Distribution Release Bundle Metadata 

Description: Exports the Release Bundles metadata on the Distribution service to an export.zip file.
Notes: To support the Artifactory to Distribution one to one paring ratio introduced in the JFrog Platform, you need to migrate the Distribution Release Bundle metadata to its relevant Distribution service according to the <Artifactory_instance_ID> associated with its correlating Distribution service. 
Since:
 2.4
Security: Requires an admin user
Usage: POST /api/v1/system/migration/export/<Artifactory_instance_ID> -o export.zip
Produces: application/zip

Sample Usage: 

Post api/v1/system/migration/export/DEV_Art01 -o export.zip

Sample Response:

Please provide an example

Import Distribution Release Bundle Metadata

Description: Imports the Release Bundles to the newly created Distribution service from the exported zip file. For more information, see Distribution REST API.
Notes: To support the One to One Pairing between Artifactory (from 7.x) and Distribution (from 2.4), run this command to import the Release Bundle Metadata from the core Distribution service to the newly created Distribution service. For more information, see Distribution REST API.
Since: 2.4
Security: Requires an admin user
Usage: POST /api/v1/system/migration/import
Consumes: multipart/form-data

Sample Usage: 

POST /api/v1/system/migration/import



ERROR RESPONSES

Status codeReasonSuggested actions
400Invalid request parameters (headers / body)Compare request against specification
401Endpoint requires authenticationRepeat request with authentication credentials
403Endpoint permission requirements are not metResponse will include necessary permissions
500Unexpected error during request handlingCheck distribution logs
  • No labels
Copyright © 2020 JFrog Ltd.