Viewing Group Information
Problem
You want to view group information.
Solution
Use the groups
attribute. Use the prefix
argument to filter based on group name.
from posit import connect
= "data scientists"
PREFIX
= connect.Client()
client = client.groups.find_one(prefix=PREFIX) group
>>> import json
>>> print(json.dumps(group, indent=4))
{"guid": "54ed1e9d-4bee-4797-97a3-f22e990bccfe",
"owner_guid": "6ca57cef-186f-4897-9875-d692f97edd5a"
"name": "Data Scientists",
}
Use the get_groups()
function. This returns a table that you can filter to find details about a specific group.
library(connectapi)
library(dplyr)
= "Data Scientists"
GROUP_NAME
<- connect()
client
<- get_groups(client)
all_groups <- filter(groups, name == GROUP_NAME) group
> group
# A tibble: 1 × 3
guid name owner_guid <chr> <chr> <chr>
1 54ed1e9d-4bee-4797-97a3-f22e990bccfe Data Scientists 6ca57cef-186f-4897-9875-d692f97edd5a
Discussion
The groups
object contains guid, owner_guid, and name field. The guid is a globally unique identifier for the group. The owner_guid is a reference to the user that created the group. The name field is a human readable description of the group.