Project

General

Profile

Actions

Cluster-wide favorites

[ written in response to requirements in https://dev.arvados.org/issues/14343 ]

A "favorite" is a link record and is used to represent shortcuts to projects in the user interface (workbench).

The schema for a "favorite" link is:

Field Value Description
owner_uuid user or group uuid The user or group that "owns" the favorite
head_uuid project uuid The project being favorited
link_class string of value "star" Indicates this represents a link to a user favorite

Cluster wide favorites

The "All Users" group for a given cluster has the uuid "{prefix}-j7d0g-fffffffffffffff". Cluster-wide favorites that will show up for all users should belong to the "All Users" group.

Creating a favorite

$ arv link create --link '{
"owner_uuid": "c97qk-j7d0g-fffffffffffffff",
"head_uuid": "c97qk-j7d0g-khm44br99mz40hk",
"link_class": "star"}'

Note: historically workbench also set "tail_uuid" to be same as "owner_uuid" and "name" the same as "head_uuid", but these are redundant. However, for compatibility between workbench1 and workbench2, we still need to set "tail_uuid" e.g.:

$ arv link create --link '{
"owner_uuid": "c97qk-j7d0g-fffffffffffffff",
"tail_uuid": "c97qk-j7d0g-fffffffffffffff",
"head_uuid": "c97qk-j7d0g-khm44br99mz40hk",
"link_class": "star"}'

Using curl

$ echo '{"owner_uuid": "c97qk-j7d0g-fffffffffffffff", 
      "head_uuid":  "c97qk-j7d0g-khm44br99mz40hk", 
      "link_class": "star"}' | curl -X POST --data-binary @- -H "Content-Type: application/json" -H "Authorization: Bearer $ARVADOS_API_TOKEN" https://c97qk.arvadosapi.com/arvados/v1/links

Deleting a favorite

$ arv link delete --uuid c97qk-o0j2j-haadun4x0vmpvnd

Using curl

$ curl -X DELETE -H "Authorization: Bearer $ARVADOS_API_TOKEN" https://c97qk.arvadosapi.com/arvados/v1/links/c97qk-o0j2j-vasz95f7f8otj8f

Listing favorites

To list all 'star' links readable by the current user

$ arv link list --filters '[["link_class", "=", "star"]]' --order owner_uuid

However, this will include favorites belonging any group or project that is readable by the user. The UI could break out groups of favorites by owner_uuid. This would enable users to share groups of favorites, such as those pertaining to a specific project.

Alternately, the query can be restricted to only show favorites belonging to the "All Users" group and the current user by filtering on owner_uuid:

$ arv link list --filters '[
["link_class", "=", "star"],
["owner_uuid", "in", ["1b7fr-j7d0g-fffffffffffffff", "1b7fr-tpzed-qmf60jo0vs4ecww"]]]'

Using curl

$ curl  --get -H "Authorization: Bearer $ARVADOS_API_TOKEN" --data-urlencode filters='[["link_class", "=", "star"]]' --data-urlencode order=owner_uuid https://c97qk.arvadosapi.com/arvados/v1/links

If there are more than 1000 favorites, the response will have a value of "items_available" > 1000. In this case, use the "offset" query parameter for paging.

Updated by Tom Morris over 5 years ago · 4 revisions