Adding tags to my project


#1

I want to add tags to my projects, using the guide at Tagging. I have added a project “restclient-cli-3.2.2” to my repo (vm at 192.168.122.146), then I want to add a tag using

curl -u admin:xxx -X POST --header 'Content-Type: application/json' http://192.168.122.146:8081/service/rest/v1/tags?repository=Releases  \
  -d '{
    "name": "restclient-cli-3.2.2",
    "attributes": {
        "jvm": "9",
        "built-by": "jenkins"
    }
}'

I get a 404 error. I’m sure I’m doing something wrong, but what?


#2

I now realize that tagging doesn’t do what I thought it would do. I’d like to add metadata to individual artifacts. How do I do that through the API?


#3

Hi,
Metadata is automatically generated in NXRM by the artifact you upload. How it is driven differs by format but you don’t add it via NXRM, you add it via the artifacts you are putting in NXRM.
I suspect that probably doesn’t help very much but I also suspect your question is about the format rather than NXRM.
Folks still may be able to help you here if you provide more info on what you need.
2 cents,
Joe


#4

Actually, I was looking for custom meta data. Data that we can add to the artifact, like “when did the application go in production” or “is the application still used in production”.


#5

Some formats, such as NPM support custom attributes but NXRM itself doesn’t have a custom metadata feature. Tagging is going to be the closest option right now. You can create a tag (maybe give it the same name as the artifact you want to tag), then attach that tag to an artifact or artifacts. Those tags will then be visible in the UI when looking at artifact details as well as through the rest API. The next release will have a new tag search field allowing you to search for artifacts assigned to individual tags as well.

…Michael Martz


#6

That curl command worked for me (after changing the IP address). What version of Nexus Repository Manager are you running?

You can do that using the Tag Attributes as you have in your example. The next step is to associate your newly created tag and attributes to the components to which you would like to attach the metadata. See this section of the docs: Tagging - Associate Components with a Tag


#7

I run version 3 (OSS 3.13.0-01), I recently downloaded and installed, I have a trial license for Nexus Firewall which will expire in two days.
I run Nexus in a VM, it works fine, apart from the tagging api.


#8

What should the value of “project” be? Should it be the name of an artifact, or a random string, or can I add a project to Nexus?


#9

I’m afraid that your trial license doesn’t include the Tag feature, which is only available for the full NXRM Pro product.


#10

Oh. So if I want to know if my client can do what they want to do with Nexus, we’ll have to apply for an NXRM Pro trial license? You don’t have something like a one-person developer license?


#11

Hi Christine,

Your trial license should also work on Nexus Repository as well. The tagging feature is enabled with Nexus Repository Pro not OSS as you mentioned you were running above.

Make sure to install the trial license on a non-production instance of Repo. Repo doesn’t revert back to OSS when the license has expired.

If the license doesn’t work on Repo for some reason, please let me know.


#12

Note that you will need to restart Nexus Repo after installing the license in order for the pro features to be enabled.


#13

Hi @christine,
Following up on your Trial License. I have made our Account Team aware of your request so that they can help resolve any questions around the License and help guide you through your evaluation.


#14

Thank you.


#15

I’m ok now. I re-installed the license file, now the tagging works. Thanks for the help.