Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API: /labels doesn't work? #7727

Open
onnozweers opened this issue Dec 31, 2024 · 4 comments
Open

API: /labels doesn't work? #7727

onnozweers opened this issue Dec 31, 2024 · 4 comments

Comments

@onnozweers
Copy link
Contributor

Dear dCache devs,

Is the API call /labels properly implemented? I can't get it to produce anything more than this:

{
  "children": [],
  "labels": []
}

Using a fairly recent 10.2 snapshot. The /namespace set-label and rm-label actions do work.

Thanks and happy new year!

@mksahakyan
Copy link
Contributor

mksahakyan commented Jan 3, 2025 via email

@mksahakyan
Copy link
Contributor

Or you were talking rather about a functionality to list all existing labels?

@onnozweers
Copy link
Contributor Author

Hi Marina,

I can see the labels of files with the /namespace call with labels=true, so that part works. But I was looking at the /labels API call. I assume the /labels call would allow filtering a directory based on labels, is that correct? Otherwise, what is the /labels call for?

My current plan (to implement in our dCache API client Ada) is to use /namespace showing children and with labels=true and use jq to filter on labels. I hope that will perform.

Cheers,
Onno

@onnozweers
Copy link
Contributor Author

Some examples:

[onno@badger14 SpiderScripts]$ curl --config /home/onno/.ada/headers/authorization_header_we6DkeFfFWWj -H 'accept: application/json' --fail --silent --show-error -X GET 'https://dcachetest.grid.surfsara.nl:20443/api/v1/namespace/%2Fgroups%2Fdteam%2Fonno-tests%2Fonnotest2?labels=true'
{
  "fileMimeType" : "application/octet-stream",
  "labels" : [ "mytestlabel" ],
  "size" : 2229,
  "creationTime" : 1716303093555,
  "fileType" : "REGULAR",
  "pnfsId" : "0000F99E8AEBF9B34BF3ADDF023B2CDD81BD",
  "nlink" : 1,
  "mtime" : 1716303093610,
  "mode" : 432
}

[onno@badger14 SpiderScripts]$ curl --config /home/onno/.ada/headers/authorization_header_we6DkeFfFWWj -H 'accept: application/json' --fail --silent --show-error -X GET 'https://dcachetest.grid.surfsara.nl:20443/api/v1/labels/%2Fgroups%2Fdteam%2Fonno-tests'
{
  "children" : [ ],
  "labels" : [ ]
}

[onno@badger14 SpiderScripts]$ curl --config /home/onno/.ada/headers/authorization_header_we6DkeFfFWWj -H 'accept: application/json' --fail --silent --show-error -X GET 'https://dcachetest.grid.surfsara.nl:20443/api/v1/labels/%2Fgroups%2Fdteam%2Fonno-tests%2Fonnotest2'
{
  "children" : [ ],
  "labels" : [ ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants