Updating users and groups¶
You can update basic properties of both users and groups, again using the builder pattern.
Update a group¶
For example, to update a group:
Update a group | |
---|---|
1 2 3 4 5 6 7 8 |
|
- To update a group, start a builder using the
updater()
method. - You must provide the GUID of the group...
- ...and the
path
of the group you want to update. (Note that the path is different from the name — you're best retrieving a group first and then getting the path from that retrieved object if you are unsure.) - You can then specify anything you want to update. In the case of a group, most of the properties are in an embedded
attributes
object that can be built-up through its own builder. - For example, you can add or change the description of the group. (Note that all objects in the attributes of a group are lists, even when they only have a single value.)
- Like other builder patterns, you need to build the attributes object.
- Like other builder patterns, you need to build the updated group object itself.
- Finally, you can call the
update()
method on the built-up group object to actually update the group in Atlan. Note that this method does not return anything.
Update a group | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- To update a group, you could start by retrieving the group. Alternatively, you can use
AtlanGroup.create_for_modification()
to start building a minimal update request. - You must provide the GUID of the group...
- ...and the
path
of the group you want to update. (Note that the path is different from the name — you're best retrieving a group first and then getting the path from that retrieved object if you are unsure.) - You can then specify anything you want to update. In the case of a group, most of the properties are in an embedded
Attributes
class that can be built-up. - For example, you can add or change the description of the group. (Note that all objects in the attributes of a group are lists, even when they only have a single value.)
- Finally, you can call the
group.update()
method with the built-up group object to actually update the group in Atlan. Note that this method does not return anything.
Update a group | |
---|---|
1 2 3 4 5 6 7 8 |
|
- To update a group, start a builder using the
updater()
method. - You must provide the GUID of the group...
- ...and the
path
of the group you want to update. (Note that the path is different from the name — you're best retrieving a group first and then getting the path from that retrieved object if you are unsure.) - You can then specify anything you want to update. In the case of a group, most of the properties are in an embedded
attributes
object that can be built-up through its own builder. - For example, you can add or change the description of the group. (Note that all objects in the attributes of a group are lists, even when they only have a single value.)
- Like other builder patterns, you need to build the attributes object.
- Like other builder patterns, you need to build the updated group object itself.
- Finally, you can call the
update()
method on the built-up group object to actually update the group in Atlan. Note that this method does not return anything.
POST /api/service/groups/e79cb8eb-2bb6-4821-914c-f8dfd21fedc7 | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- You must provide the GUID of the group within the request payload.
- You must provide the internal name of the group, prefixed by
/
, as thepath
. -
You can provide any attributes to update on the group in the
attributes
object.Values are all arrays of strings
Note that every value for an attribute is an array of strings, even when there is only a single value.
Remove users from group¶
To remove one or more users from a group:
Remove users from a group | |
---|---|
1 2 3 4 5 |
|
- To update group membership, start a builder using the
updater()
method. - You must provide the GUID of the group...
- ...and the
path
of the group you want to update. (Note that the path is different from the name — you're best retrieving a group first and then getting the path from that retrieved object if you are unsure.) - Like other builder patterns, you need to build the updated group object itself.
- Use the
removeUsers()
method to remove one or more users from the group. Specify the GUID of each user you want to remove as a member of the group.
Remove users from a group | |
---|---|
1 2 3 4 5 6 7 |
|
- Use the
group.remove_users()
method to remove one or more users from the group. - Specify the GUID of the group from which you want to remove users.
- Specify the GUID of each user you want to remove as a member of the group.
Remove users from a group | |
---|---|
1 2 3 4 5 |
|
- To update group membership, start a builder using the
updater()
method. - You must provide the GUID of the group...
- ...and the
path
of the group you want to update. (Note that the path is different from the name — you're best retrieving a group first and then getting the path from that retrieved object if you are unsure.) - Like other builder patterns, you need to build the updated group object itself.
- Use the
removeUsers()
method to remove one or more users from the group. Specify the GUID of each user you want to remove as a member of the group.
POST /api/service/groups/e79cb8eb-2bb6-4821-914c-f8dfd21fedc7/members/remove | |
---|---|
1 2 3 4 5 |
|
- You must provide the list of users to remove from the group in a
users
array. - Specify each user by its unique ID (GUID).
Update a user¶
To update a user, begin by building the minimal update object:
Build the minimal update object | |
---|---|
1 2 3 |
|
- To update a user, start a builder using the
updater()
method. - You must provide the GUID of the user.
- Like other builder patterns, you need to build the updated user object itself.
Specific operations below
The specific operations for updating a user are all listed below - there is no update object to build in the Python SDK.
Build the minimal update object | |
---|---|
1 2 3 |
|
- To update a user, start a builder using the
updater()
method. - You must provide the GUID of the user.
- Like other builder patterns, you need to build the updated user object itself.
Implicit in the API calls below
There is nothing specific to do for this step when using the raw APIs — constructing the object is simply what you place in the payload of the API calls in the steps below.
Add user to groups¶
Once you have the update object, to add a user to one or more groups:
Add user to groups | |
---|---|
4 |
|
- Use the
addToGroups()
method to add the user to one or more groups. Specify the GUID of each group you want to make the user a member of.
Add user to groups | |
---|---|
1 2 3 4 5 6 7 |
|
- Use the
user.add_to_groups()
method to add the user to one or more groups. - Specify the GUID of the user you want to add to one or more groups.
- Specify the GUID of each group you want to make the user a member of.
Add user to groups | |
---|---|
4 |
|
- Use the
addToGroups()
method to add the user to one or more groups. Specify the GUID of each group you want to make the user a member of.
POST /api/service/users/da213751-95de-4f96-8bee-a2c73e2ef8c8/groups | |
---|---|
1 2 3 4 5 |
|
- You must provide the list of groups to remove the user from in a
groups
array. - Specify each group by its unique ID (GUID).
Change role of user¶
Once you have the update object, to change the role of a user:
Change role of user | |
---|---|
4 |
|
-
Use the
changeRole()
method to change the role of a user.Use the
RoleCache
to find the right GUIDThe
changeRole()
method requires the GUID of the role you want to move the user to. In order to find that GUID, you can use theRoleCache.getIdForName()
and provide the name of the role.
Change role of user | |
---|---|
1 2 3 4 5 6 7 8 |
|
- Use the
user.change_role()
method to change the role of a user. - Specify the GUID of the user whose role you want to change.
-
Specify the GUID of the role you want to change the user to.
Use the
RoleCache
to find the right GUIDThe
user.change_role()
method requires the GUID of the role you want to move the user to. In order to find that GUID, you can use theRoleCache.get_id_for_name()
and provide the name of the role.
Change role of user | |
---|---|
4 |
|
-
Use the
changeRole()
method to change the role of a user.Use the
RoleCache
to find the right GUIDThe
changeRole()
method requires the GUID of the role you want to move the user to. In order to find that GUID, you can use theRoleCache.getIdForName()
and provide the name of the role.
POST /api/service/users/da213751-95de-4f96-8bee-a2c73e2ef8c8/update | |
---|---|
1 2 3 |
|
-
You must provide the unique ID (GUID) of the new role for the user.
You probably need to look this up first
When using the raw API, you will need to lookup the role GUID yourself. You can
GET /api/service/roles
, and the GUID will be theid
field in the response for each role.
Deactivate a user¶
This cannot be done programmatically
You can only deactivate users as an Admin user (via the UI), API tokens do not have access to deactivate users.
Reactivate a user¶
This cannot be done programmatically
You can only reactivate users as an Admin user (via the UI), API tokens do not have access to reactivate users.