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: /namespace set-label on a directory works, but rm-label doesn't #7726

Open
onnozweers opened this issue Dec 31, 2024 · 1 comment
Open

Comments

@onnozweers
Copy link
Contributor

Dear dCache devs,

I'm testing with labels in the API. For files, it seems to work as expected. But for directories there is something strange: I can set a label on a directory, but I can't remove it.

[onno@hedgehog14 SpiderScripts]$ curl --config /home/onno/.ada/headers/authorization_header_EAfsrGnaEBc7 --fail --show-error -H 'content-type: application/json' -X POST https://dcachetest.grid.surfsara.nl:20443/api/v1/namespace/%2Fgroups%2Fdteam%2Fonno-tests -d '{"action":"set-label","label":"mylabel"}'
{"status":"success"}

[onno@hedgehog14 SpiderScripts]$ curl --config /home/onno/.ada/headers/authorization_header_EAfsrGnaEBc7 --fail --show-error -H 'content-type: application/json' -X POST https://dcachetest.grid.surfsara.nl:20443/api/v1/namespace/%2Fgroups%2Fdteam%2Fonno-tests -d '{"action":"rm-label","label":"mylabel"}'
curl: (22) The requested URL returned error: 400 Bad Request

In the frontend log:

level=WARN ts=2024-12-31T10:52:25.181+0100 event=org.dcache.frontend.request request.method=POST request.url=https://dcachetest.grid.surfsara.nl:20443/api/v1/namespace//groups/dteam/onno-tests response.code=400 response.reason="Bad Request" socket.remote=[2001:610:108:203a::2:28]:41748 user-agent=curl/7.61.1 user.sub=8571849c-1044-416f-9702-5acb60257479@DTEAM user.jti=dde2813d-29b1-4045-96e7-44743433e9ee@DTEAM user.mapped=36490:31631 request.entity="{"action":"rm-lab[...]l":"mytestlabel"}" response.entity="{"detail":"Directory object cannot [...]" duration=12

So, my guess is that labels are not implemented for directories. This is perfectly fine, I can't think of any use case for that. But wouldn't it be nice if a set-label on a dir also failed?

Please give this a low priority, it's not urgent, once you know how it works you can live with it.

Thanks, and happy new year!

@mksahakyan
Copy link
Contributor

mksahakyan commented Jan 3, 2025 via email

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