Retrieving users and groups¶
You can retrieve users and groups through different helper methods.
Retrieve all groups¶
For example, to retrieve all groups in Atlan:
Retrieve all groups | |
---|---|
1 2 3 4 |
|
- You can retrieve all groups in Atlan using the
AtlanGroup.list()
method. - You can then iterate through the groups to do whatever you like with them.
Retrieve all groups | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
-
The
get_all()
method retrieves all groups defined in Atlan. Optional parameters include:- (Optional)
limit
: Specifies the maximum number of results to return. Defaults to20
. - (Optional)
offset
: Indicates the starting point for the results when paging. Defaults to0
. - (Optional)
sort
: Allows sorting by a specific property, such as"createdAt"
. - (Optional)
columns
: Restricts the fields returned for each group, providing column projection support. Example:["roles", "path"]
.
- (Optional)
-
You can then iterate through the groups to do whatever you like with them.
Retrieve all groups | |
---|---|
1 2 3 4 |
|
- You can retrieve all groups in Atlan using the
AtlanGroup.list()
method. - You can then iterate through the groups to do whatever you like with them.
GET /api/service/v2/groups?sort=createdAt&imit=10&offset=0&columns=path&columns=roles | |
---|---|
1 |
|
-
All details are in the URL itself.
Paging results
Note that you have a
limit
to control page size, and anoffset
to control where to start a page.
Retrieve group by name¶
To retrieve a specific group in Atlan by its name:
Retrieve group by name | |
---|---|
1 2 |
|
-
You can retrieve a specific group by its name using the
AtlanGroup.get()
method.Still returns a list
Note that this still returns a list of groups, as it actually runs a
contains
search for the specified name. You could therefore use this same method to retrieve many groups that all follow the same naming convention, for example. -
If you were expecting only a single group to match, however, you can still retrieve that from the list directly, of course.
Retrieve group by name | |
---|---|
1 2 3 4 5 |
|
-
You can retrieve a specific group by its name using the
group.get_by_name()
method.Still returns a list
Note that this still returns a list of groups, as it actually runs a
contains
search for the specified name. You could therefore use this same method to retrieve many groups that all follow the same naming convention, for example. -
If you were expecting only a single group to match, however, you can still retrieve that from the list directly, of course.
Retrieve group by name | |
---|---|
1 2 |
|
-
You can retrieve a specific group by its name using the
AtlanGroup.get()
method.Still returns a list
Note that this still returns a list of groups, as it actually runs a
contains
search for the specified name. You could therefore use this same method to retrieve many groups that all follow the same naming convention, for example. -
If you were expecting only a single group to match, however, you can still retrieve that from the list directly, of course.
GET /api/service/groups?filter=%7B%22%24and%22%3A[%7B%22alias%22%3A%7B%22%24ilike%22%3A%22%25Example%25%22%7D%7D]%7D | |
---|---|
1 |
|
-
All details are in the URL itself.
URL-encoded filter
Note that the filter is URL-encoded. Decoded it would be:
{"$and":[{"alias":{"$ilike":"%Example%"}}]}
Retrieve all users¶
To retrieve all users in Atlan:
Retrieve all users | |
---|---|
1 2 3 4 |
|
- You can retrieve all users in Atlan using the
AtlanUser.list()
method. - You can then iterate through the users to do whatever you like with them.
Retrieve all users | |
---|---|
1 2 3 4 5 6 |
|
- You can retrieve all users in Atlan using the
get_all()
method under theuser
attribute of the AtlanClient instance. - You can then iterate through the users to do whatever you like with them.
Retrieve all users | |
---|---|
1 2 3 4 |
|
- You can retrieve all users in Atlan using the
AtlanUser.list()
method. - You can then iterate through the users to do whatever you like with them.
GET /api/service/users?sort=username&limit=100&offset=0 | |
---|---|
1 |
|
-
All details are in the URL itself.
Paging results
Note that you have a
limit
to control page size, and anoffset
to control where to start a page.
Retrieve user by username¶
To retrieve a specific user in Atlan by their username:
Retrieve user by username | |
---|---|
1 |
|
- You can retrieve a specific user by their username using the
AtlanUser.getByUsername()
method. This runs an exact match for the provided username, so only returns a single user (if found).
Retrieve user by username | |
---|---|
1 2 3 4 |
|
- You can retrieve a specific user by their username using the
user.get_by_username()
method. This runs an exact match for the provided username, so only returns a single user (if found).
Retrieve user by username | |
---|---|
1 |
|
- You can retrieve a specific user by their username using the
AtlanUser.getByUsername()
method. This runs an exact match for the provided username, so only returns a single user (if found).
GET /api/service/users?filter=%7B%22username%22%3A%22jdoe%22%7D | |
---|---|
1 |
|
-
All details are in the URL itself.
URL-encoded filter
Note that the filter is URL-encoded. Decoded it would be:
{"username":"jdoe"}
Retrieve user by email¶
To retrieve a specific user in Atlan by their email address:
Retrieve user by username | |
---|---|
1 2 |
|
-
You can retrieve a specific user by their email address using the
AtlanUser.getByEmail()
method.Still returns a list
Note that this still returns a list of users, as it actually runs a
contains
search for the specified email address. You could therefore use this same method to retrieve many users that all have the same email domain, for example. -
If you were expecting only a single user to match, however, you can still retrieve that from the list directly, of course.
Retrieve user by username | |
---|---|
1 2 3 4 5 |
|
-
You can retrieve a specific user by their email address using the
user.get_by_email()
method.Still returns a list
Note that this still returns a list of users, as it actually runs a
contains
search for the specified email address. You could therefore use this same method to retrieve many users that all have the same email domain, for example. -
If you were expecting only a single user to match, however, you can still retrieve that from the list directly, of course.
Retrieve user by username | |
---|---|
1 2 |
|
-
You can retrieve a specific user by their email address using the
AtlanUser.getByEmail()
method.Still returns a list
Note that this still returns a list of users, as it actually runs a
contains
search for the specified email address. You could therefore use this same method to retrieve many users that all have the same email domain, for example. -
If you were expecting only a single user to match, however, you can still retrieve that from the list directly, of course.
GET /api/service/users?filter=%7B%22email%22%3A%7B%22%24ilike%22%3A%22%25%40example.com%25%22%7D%7D | |
---|---|
1 |
|
-
All details are in the URL itself.
URL-encoded filter
Note that the filter is URL-encoded. Decoded it would be:
{"email":{"$ilike":"%@example.com%"}}
Retrieve multiple users¶
By usernames¶
To retrieve multiple users in Atlan by their usernames:
Retrieve users by usernames | |
---|---|
1 2 3 4 |
|
- Retrieve users with specified usernames using the
users.getByUsernames()
method. This method performs an exact match for the provided username in the list.
Retrieve users by usernames | |
---|---|
1 2 3 4 |
|
- Retrieve users with specified usernames using the
user.get_by_usernames()
method. This method performs an exact match for the provided username in the list.
Retrieve users by usernames | |
---|---|
1 2 3 4 |
|
- Retrieve users with specified usernames using the
users.getByUsernames()
method. This method performs an exact match for the provided username in the list.
GET /api/service/users?filter={%22username%22:{%22$in%22:[%22john.doe%22,%22jane.doe%22]}} | |
---|---|
1 |
|
-
All details are in the URL itself.
URL-encoded filter
Note that the filter is URL-encoded. Decoded it would be:
{"username":{"$in":["john.doe","jane.doe"]}}
By emails¶
To retrieve multiple users in Atlan by their emails:
Retrieve users by emails | |
---|---|
1 2 3 4 |
|
- Retrieve users with specified emails using the
users.getByEmails()
method. This method performs an exact match for the provided email in the list.
Retrieve users by emails | |
---|---|
1 2 3 4 |
|
- Retrieve users with specified emails using the
user.get_by_emails()
method. This method performs an exact match for the provided email in the list.
Retrieve users by emails | |
---|---|
1 2 3 4 |
|
- Retrieve users with specified emails using the
users.getByEmails()
method. This method performs an exact match for the provided email in the list.
GET /api/service/users?filter={%22email%22:{%22$in%22:[%22john@atlan.com%22,%20%22jane@atlan.com%22]}} | |
---|---|
1 |
|
-
All details are in the URL itself.
URL-encoded filter
Note that the filter is URL-encoded. Decoded it would be:
{"email":{"$in":["john@atlan.com","jane@atlan.com"]}}
Retrieve user group membership¶
Retrieve groups for a user¶
To retrieve the groups a user is a member of:
Retrieve groups for a user | |
---|---|
3 4 5 6 |
|
- You can retrieve the groups the user is a member of using the
fetchGroups()
method, after you have anAtlanUser
object (for example, by first retrieving it). - You can then iterate through the groups the user is a member of.
Retrieve groups for a user | |
---|---|
5 6 7 8 9 10 |
|
- You can retrieve the groups the user is a member of using the
user.get_groups()
method, by providing the GUID of the user. - You can then iterate through the groups the user is a member of.
Retrieve groups for a user | |
---|---|
3 4 5 6 |
|
- You can retrieve the groups the user is a member of using the
fetchGroups()
method, after you have anAtlanUser
object (for example, by first retrieving it). - You can then iterate through the groups the user is a member of.
GET /api/service/users/f06122f4-7279-4e42-b9e0-46f9b470e659/groups | |
---|---|
1 |
|
-
All details are in the URL itself.
User ID in the URL
Note that you must provide the unique ID (GUID) of the user to retrieve its associated groups.
Retrieve users in a group¶
To retrieve the users that are members of a group:
Retrieve users in a group | |
---|---|
3 4 5 6 |
|
- You can retrieve the users a group has as members using the
fetchUsers()
method, after you have anAtlanGroup
object (for example, by first retrieving it). - You can then iterate through the users that are members of the group.
Retrieve users in a group | |
---|---|
5 6 7 8 9 10 |
|
- You can retrieve the users a group has as members using the
group.get_members()
method, by providing the GUID of the group. - You can then iterate through the users that are members of the group.
Retrieve users in a group | |
---|---|
3 4 5 6 |
|
- You can retrieve the users a group has as members using the
fetchUsers()
method, after you have anAtlanGroup
object (for example, by first retrieving it). - You can then iterate through the users that are members of the group.
GET /api/service/groups/e79cb8eb-2bb6-4821-914c-f8dfd21fedc7/members | |
---|---|
1 |
|
-
All details are in the URL itself.
Group ID in the URL
Note that you must provide the unique ID (GUID) of the group to retrieve its associated members.