Comment 34 for bug 1617918

Revision history for this message
Julien Danjou (jdanjou) wrote :

> "sure. but how does it know that foobar in /v1/resource/generic/foobar is something that needs to be translated or is the actual primary key?"

This is already in the API. It checks if foobar is an uuid or not. If it's not it converts it.

The UUID translation is not user nor project scoped, it's "creator" scoped (see the recent patch branch). Which in the Keystone case is user_id:project_id.
So if you don't know user/project (but you can know it by listing the resources) you can't guess the uuid of a named resource, sure.

> "if you use client gnocchi resource show foobar, it will assume uuid first and if nothing, try uuid5(foobar, project-id) also, do we want it project scoped or user scoped? if we make it user scoped doesn't that mean i can't get everything from my project even if i'm admin?"

"foobar" is not an uuid so it will never try "foobar". Even if it does, the server will translate it to an uuid5(foobar, creator).

Same answer for the "scope", it's creator (which is user:project).