Hello everyone,
the lxd docs state, that images can be assigned to individual projects:
LXD supports projects as a way to split your LXD server. Each project holds its own set of instances and may also have its own images and profiles.
Right now, I am trying to fetch the fingerprints of all images that belong to a given project. The only way I found to access this information is by querying the /1.0/projects/{name}
endpoint of the lxd api.
In the response one can see what entities make use of the project:
{
"name": "foo",
"used_by": [
"/1.0/images/0e60015346f06627f10580d56ac7fffd9ea775f6d4f25987217d5eed94910a20",
"/1.0/instances/c1",
"/1.0/networks/lxdbr0",
"/1.0/profiles/default",
"/1.0/storage-pools/default/volumes/custom/blah"
]
// ...
},
As shown, the used_by
field includes images as well as profiles, instances etc. Iterating over the array and checking for the prefix /1.0/images/
seems a bit cumbersome in order to retrieve the fingerprint 0e60015346f06627f10580d56ac7fffd9ea775f6d4f25987217d5eed94910a20
.
Is anyone aware of more elegant solution?