I had a look at the documentation of the API but did not find a listing of all the possible query parameters, and in particular, could not find an appropriate parameter to search by SHA1, or other checksum :
https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/search-api
https://help.sonatype.com/repomanager3/integrations/rest-and-integration-api/assets-api
Previously in Nexus 2 it was possible to do this with 2 endpoints data_index
and lucene
:
https://repository.sonatype.org/service/local/lucene/search?sha1=686ef3410bcf4ab8ce7fd0b899e832aaba5facf7 https://nexus.xwiki.org/nexus/service/local/data_index?sha1=686ef3410bcf4ab8ce7fd0b899e832aaba5facf7
I had a look at what endpoint Nexus 3 queries internally, and it's again another endpoint called extdirect
which uses POST.
I found on some other post that it is already deprecated https://groups.google.com/a/glists.sonatype.com/g/nexus-users/c/8_DyIZrt9mM
Other answers didn't help, in fact I couldn't find 2 answers that agree on the parameter names.
Here it's a strange spelling of artifact
spelled artefact
with a 'e'
Can't download using Nexus 3 REST API and CURL
curl -u username:password -L -X GET "https://mynexusserver/service/rest/v1/search/assets/download?sort=version&repository=snapshotsrepo&maven.groupId=mygroup&maven.artefactId=myartefact&maven.extension=zip" -H "accept: application/json" -o myartefact.zip
In this answer, the parameters are again different:
https://stackoverflow.com/a/71126636/8315843
curl -u token:tokenPassword -L -X GET "https://MY_NEXUS/service/rest/v1/search/assets/download?sort=version&repository=MY-REPO&group=MY_GROUP&name=MY_ARTIFACT_NAME&version=MY_Version&maven.extension=zip" --output My_Artifact.zip
So, for artifact, is it maven.artifactId
or name
?
For group, is it maven.groupId
or group
?
How would I get token:tokenPassword
? Can't I just use username:password
?