DB: Consolidate entity URL methods
There are two different methods for getting the URL of a LXD entity by it's type and ID.
getWarningEntityURLinlxd/warnings.gowhich accepts a*sql.Txbut doesn't cover all entity types.(*Cluster).GetURIFromEntityinlxd/db/entity.gowhich handles it's own transactions.
I can see that GetURIFromEntity will be moved to ClusterTx in #12754. When this is done, I think the performance of this function can be improved and used in place of getWarningEntityURL.
Originally posted by @markylaing in https://github.com/canonical/lxd/pull/12853#discussion_r1486035350
@markylaing we should also consider the .URL() functions in shared/api/* and think about if these can be consolidated too.
@markylaing we should also consider the
.URL()functions inshared/api/*and think about if these can be consolidated too.
See https://github.com/canonical/lxd/pull/12872#discussion_r1488121382