Yunter
Yunter

Reputation: 284

Nexus API - using curl to get specific asset

Using the Nexus API docs I can retrieve a list of assets within a repository with the following curl command:

curl -u user:password -X GET 'https://nexusurl/service/rest/v1/components?repository=docker'

How can I get a specific asset? e.g. in the repository 'docker' with the path:

v2/x/manifests/1.0

I get a 404 with the following attempt:

curl -u user:password -X GET 'https://nexusurl/service/rest/v1/components?repository=docker/v2/x/manifests/1.0'

Nexus version: 3.18

Upvotes: 0

Views: 2938

Answers (1)

joedragons
joedragons

Reputation: 2645

You can use the /v1/assets/{id} endpoint once you have the ID from the list. If this is not sufficient, you either need to have a very specific /v1/search/assets or I suspect what you want is not possible at this time (latest 3.25.1).

Upvotes: 1

Related Questions