Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement groups functions to compliment users #178

Closed
kmasiello opened this issue Apr 23, 2024 · 2 comments
Closed

Implement groups functions to compliment users #178

kmasiello opened this issue Apr 23, 2024 · 2 comments
Labels
enhancement New feature or request sdk Used for automation

Comments

@kmasiello
Copy link

For:

client = connect.Client()

Enable group find / get functionality similar to what is enabled for users, i.e.,

user_guids = pl.DataFrame(client.users.find()).select(["username","guid"])
group_guids = pl.DataFrame(client.groups.find()).select(["name","guid"])
@tdstein tdstein added this to the 0.3.0 milestone Apr 26, 2024
@tnederlof
Copy link

tnederlof commented May 17, 2024

It would be helpful to have a built in way to lookup by group name since this is pretty common. Here is the Python code I wrote to do this in a recipe with the SDK as in if its helpful...

group_guid = ""
group_name = "GROUP_NAME_HERE"

if not group_guid and group_name:
    group_match = client.get("/v1/groups", params={"prefix": group_name}).json()
    if not group_match["results"]:
        raise Exception("Invalid group name")
    elif len(group_match["results"]) != 1:
        raise Exception("More than one group name found, ensure you enter a unique name")
    else:
        group_guid = group_match["results"][0]["guid"]
        print(group_guid)
elif not group_name: 
    raise Exception("Either group_guid or group_name must be specified")

@tdstein tdstein added the enhancement New feature or request label Jun 13, 2024
@tdstein tdstein removed this from the 0.3.0 milestone Sep 4, 2024
@tdstein tdstein added the sdk Used for automation label Sep 13, 2024
@tdstein
Copy link
Collaborator

tdstein commented Sep 13, 2024

Resolved in #227

@tdstein tdstein closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request sdk Used for automation
Projects
None yet
Development

No branches or pull requests

3 participants