Configuration API
The following endpoints are used to access the complete Nexus Repository configuration as well as a complete listing of assets found in each repository.
Export Configuration
This endpoint is used to retrieve the configuration of your Nexus Repository instance as JSON file. The types of entities returned are different depending on Nexus Repository version and edition supported by the license.
GET /v1/configuration
Requires the nexus:settings:read permission.
Upload Repository Configuration
This endpoint may be used to import configuration from one Nexus Repository instance to another instance.
PUT /v1/configuration
Requires the nexus:settings:write permission.
Accepts the same JSON as exported by the GET endpoint.
Configuration may be imported as a complete file or using only the parts required on the destination instance. The JSON may be modified to only limit the configuration needed for migration.
Uploaded configuration does not overwrite existing configuration. The upload may be sent to the destination instance multiple times without replacing configuration already set on the destination.
Get Assets
This endpoint lists the complete asset metadata in JSON format.
GET /v1/configuration/assets
Requires read permission for the repository asset.
The following query parameters are supported:
repository (required) - The repository to query for assets.
continuationToken - Tthe token for the next page of assets is included in each response.
newerThan - Return assets newer than this timestamp (This is a long value, the Unix timestamp)
olderThan - Only return assets older than this timestamp (This is a long value, the Unix timestamp)
Results are in descending order using the timestamp of when the asset was created.
Import Asset
For importing a single asset and its specific attributes. Use this endpoint to import artifacts from one Nexus Repository to another.
POST /v1/configuration/assets/{repositoryName}/importRequires write privileges to the destination repository. This endpoint responses with a HTTP status
repositoryName - Path parameter denoting which repository to import the asset into
The multipart request requires the following named files to be included in the request:
asset: The file to upload to the repository.
attributes: a JSON document that includes entities associated with the asset. Theis endpoint expects the content from the get assets request detailed above.