Using Other Supported Formats with the REST API

While most of our REST API examples demonstrate API behavior using the Maven format, Nexus IQ Server also supports several other formats.

Usually, there are two ways of representing a component:

  • Component Identifier: Each format has a specific component identifier layout that must be used. These component identifiers consist of the format plus the format-specific coordinates.
  • Package URL (purl): Each format has specific url components that must be used. These url components consist of the format plus the format-specific coordinates.

Understanding component identifiers for a particular format allows you to use the same REST API operations with other formats. This is done by substituting component identifiers for a different format in the same operation, with some coordinates for the component identifier being required while others are optional.

Some API endpoints (such as the Component Versions REST API) may be more permissive than most REST API operations relating to missing coordinates. These may have more optional coordinates than listed on this page within the context of that particular operation.

Component identifiers for particular formats are listed below:

a-name

For a-name (authoritative name) component identifiers, the following coordinates are supported:

  • name
  • version

  • qualifier (optional)

Sample JSON for an a-name component identifier is provided below:

"componentIdentifier": {
  "format": "a-name",
  "coordinates": {
    "name": "pouchdb",
    "version": "6.3.1"
  }
}

Sample JSON for an a-name purl is provided below:

"packageUrl": "pkg:a-name/pouchdb@6.3.1"

maven

  • groupId
  • artifactId
  • version
  • extension
  • classifier (optional)

Sample JSON for a Maven component identifier is provided below:

"componentIdentifier": {
  "format": "maven",
  "coordinates": {
    "artifactId": "commons-fileupload",
    "groupId": "commons-fileupload",
    "version": "1.2.2",
    "extension":"jar"      
  }
}

Sample JSON for a Maven purl is provided below:

"packageUrl": "pkg:maven/commons-fileupload/commons-fileupload@1.2.2?type=jar"

npm

For npm component identifiers, the following coordinates are supported:

  • packageId
  • version

Sample JSON for an npm component identifier is provided below:

"componentIdentifier": {
  "format": "npm",
  "coordinates": {
    "packageId": "grunt-bower-submodule",
    "version": "0.2.3"
  }
}

Sample JSON for an npm purl is provided below:

"packageUrl": "pkg:npm/grunt-bower-submodule@0.2.3"

nuget

For Nuget component identifiers, the following coordinates are supported:

  • packageId
  • version

Sample JSON for a NuGet component identifier is provided below:

"componentIdentifier": {
  "format": "nuget",
  "coordinates": {
    "packageId": "Nirvana.MongoProvider",
    "version": "1.0.53"
  }
}

Sample JSON for a NuGet purl is provided below:

"packageUrl": "pkg:nuget/Nirvana.MongoProvider@1.0.53"

pypi

For PyPI component identifiers, the following coordinates are supported:

  • name
  • version
  • extension
  • qualifier (optional)

Sample JSON for a PyPI component identifier is provided below:

"componentIdentifier": {
  "format": "pypi",
  "coordinates": {
    "name": "jaraco.logging",
    "version": "1.5",
    "extension": "tar.gz"      
  }
}

Sample JSON for a PyPI purl is provided below:

"packageUrl": "pkg:pypi/jaraco.logging@1.5?extension=tar.gz"

rpm

For rpm component identifiers, the following coordinates are supported:

  • name
  • version
  • architecture 

Sample JSON for an rpm component identifier is provided below:

"componentIdentifier": {
  "format": "rpm",
  "coordinates": {
    "name": "AGReader",
    "version": "1.2-6.el6",
    "architecture": "ppc64"      
  }
}

Sample JSON for an RPM purl is provided below:

"packageUrl": "pkg:rpm/AGReader@.2-6.el6?arch=ppc64"

gem

For Gem component identifiers, the following coordinates are supported:

  • name
  • version
  • platform (optional)

Sample JSON for a Gem component identifier is provided below:

"componentIdentifier": {
  "format": "gem",
  "coordinates": {
    "name": "rails",
    "version": "5.0.4"
  }
}

Sample JSON for a gem purl is provided below:

"packageUrl": "pkg:gem/rails@5.0.4"

golang

For Go component identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for a Go component identifier is provided below:

"componentIdentifier": {
  "format": "golang",
  "coordinates": {
    "name": "github.com/rs/cors",
    "version": "v1.4.0"
  }
}

Sample JSON for a golang purl is provided below:

"packageUrl": "pkg:golang/github.com/rs/cors@v1.4.0"

conan

For Conan component identifiers, the following coordinates are supported:

  • name
  • namespace
  • version

Sample JSON for a Conan component identifier is provided below:

"componentIdentifier": {
  "format": "conan",
  "coordinates": {
    "name": "libxml2",
    "namespace": "bincrafters",
    "version": "2.9.8"
  }
}

Sample JSON for a Conan purl is provided below:

"packageUrl": "pkg:conan/bincrafters/libxml2@2.9.8"

conda

For Conda component identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for a Conda component identifier is provided below:

"componentIdentifier": {
  "format": "conda",
  "coordinates": {
    "name": "openssl",
    "version": "0.9.4"
  }
}

Sample JSON for a Conda purl is provided below:

"packageUrl": "pkg:conda/openssl@0.9.4"

bower

For Bower component identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for a Bower component identifier is provided below:

"componentIdentifier": {
  "format": "bower",
  "coordinates": {
    "name": "js-yaml",
    "version": "2.0.1"
  }
}

Sample JSON for a Bower purl is provided below:

"packageUrl": "pkg:bower/js-yaml@2.0.1"

composer

For Composer component identifiers, the following coordinates are supported:

  • namespace
  • name
  • version

Sample JSON for a Composer component identifier is provided below:

"componentIdentifier": {
  "format": "composer",
  "coordinates": {
	"namespace": "components",
    "name": "jqueryui",
    "version": "1.11.4"
  }
}

Sample JSON for a Composer purl is provided below:

"packageUrl": "pkg:composer/components/jqueryui@1.11.4"

cran

For Cran component identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for a Cran component identifier is provided below:

"componentIdentifier": {
  "format": "cran",
  "coordinates": {
    "name": "readxl",
    "version": "1.1.0"
  }
}

Sample JSON for a Cran purl is provided below:

"packageUrl": "pkg:cran/readxl@1.1.0"

cargo

For Cargo component identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for a Cargo component identifier is provided below:

"componentIdentifier": {
  "format": "cargo",
  "coordinates": {
    "name": "grin",
    "version": "1.0.0"
  }
}

Sample JSON for a Cargo purl is provided below:

"packageUrl": "pkg:cargo/grin@1.0.0"

cocoapods

For Cocoapods component identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for a Cocoapods component identifier is provided below:

"componentIdentifier": {
  "format": "cocoapods",
  "coordinates": {
    "name": "libpng",
    "version": "1.4.9"
  }
}

Sample JSON for a Cocoapods purl is provided below:

"packageUrl": "pkg:cocoapods/libpng@1.4.9"

debian

For Debian package identifiers, the following coordinates are supported:

  • name
  • namespace
  • version

Sample JSON for a Debian component identifier is provided below:

"componentIdentifier": {
  "format": "deb",
  "coordinates": {
    "name": "stunnel",
    "namespace": "debian",
    "version": "3.20.0"
  }
}

Sample JSON for a Debian purl is provided below:

"packageUrl": "pkg:deb/debian/stunnel@3.20.0"

alpine

For Alpine package identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for an Alpine component identifier is provided below:

"componentIdentifier": {
  "format": "alpine",
  "coordinates": {
    "name": "openssl",
    "version": "0.9.4"
  }
}

Sample JSON for an Alpine purl is provided below:

"packageUrl": "pkg:alpine/openssl@0.9.4"

drupal

For Drupal package identifiers, the following coordinates are supported:

  • name
  • version

Sample JSON for a Drupal component identifier is provided below:

"componentIdentifier": {
  "format": "drupal",
  "coordinates": {
    "name": "simplenews",
    "version": "2.0.0"
  }
}

Sample JSON for a Drupal purl is provided below:

"packageUrl": "pkg:drupal/simplenews@2.0.0"