Change owners¶
There are actually two kinds of owners per asset
There are actually two fields in Atlan that capture the owners of an asset: ownerUsers
and ownerGroups
.
The examples below illustrate how to change individual (user) owners. To change group owners, replace ownerUsers
with ownerGroups
.
Change an existing asset¶
Could create a new asset
Remember that Atlan matches the provided qualifiedName
to determine whether to update or create the asset.
To change owners on an existing asset:
Change owners on existing asset | |
---|---|
1 2 3 4 5 6 |
|
- You must of course give the name of the object.
- The usernames must be nested within the
meta
.atlan
.attributes
structure. -
You must provide valid usernames, or email addresses, as a list.
Users must be valid
If the user does not exist in Atlan, there will be no updates to the asset. Please verify the usernames or email addresses in Atlan before assigning them to assets.
Change owners on existing asset | |
---|---|
1 2 3 4 5 6 7 |
|
- Use the
updater()
helper method to create the minimal object necessary to do an update. - The
qualifiedName
of the object. - The
name
of the object. - Provide the new owners. Note that this is a list of the usernames of the users.
- Build the updater into an object.
- Send the update to Atlan.
- The response will include that single asset that was updated.
Change owners on existing asset | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
- Use the
updater()
method to create an asset suitable for modification i.e. with all the requisite attributes. - Provide the new owners. Note that this is a list of the usernames of the users.
- Send the update to Atlan.
- The response should only include that single asset that was updated.
Change owners on existing asset | |
---|---|
1 2 3 4 5 6 7 |
|
- Use the
updater()
helper method to create the minimal object necessary to do an update. - The
qualifiedName
of the object. - The
name
of the object. - Provide the new owners. Note that this is a list of the usernames of the users.
- Build the updater into an object.
- Send the update to Atlan.
- The response will include that single asset that was updated.
POST /api/meta/entity/bulk | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- All assets must be wrapped in an
entities
array. - You must provide the exact type name for the asset (case-sensitive).
- You must provide the exact name of the asset (case-sensitive).
- You must provide the exact
qualifiedName
of the asset (case-sensitive). - Provide the new owners, as a list of usernames of users.
Remove from an existing asset¶
To remove owners from an existing asset:
Remove owners from existing asset | |
---|---|
1 2 3 4 5 6 |
|
- You must of course give the name of the object.
- The details for the owners must be nested within the
meta
.atlan
.attributes
structure. -
Specify only the usernames or email addresses of the users you want to keep as owners. (Compared to the other examples, this would remove
jsmith
and keepjdoe
.)Users must be valid
If the user does not exist in Atlan, there will be no updates to the asset. Please verify the usernames or email addresses in Atlan before assigning them to assets.
Remove owners from existing asset | |
---|---|
1 2 3 |
|
- Use the
removeOwners()
helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary API(s), and return with the result of the removal operation all-in-one. - The
qualifiedName
of the object. - The
name
of the object.
Remove owners from existing asset | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
- Use the
updater()
method to create an asset suitable for modification i.e. with all the requisite attributes. - Set the owners to
None
. - Send the update to Atlan.
- The response should only include that single asset that was updated (again, removing owners is an update to the asset — we are not deleting the asset itself).
Remove owners from existing asset | |
---|---|
1 2 3 |
|
- Use the
removeOwners()
helper method, which for most objects requires a minimal set of information. This helper method will construct the necessary request, call the necessary API(s), and return with the result of the removal operation all-in-one. - The
qualifiedName
of the object. - The
name
of the object.
POST /api/meta/entity/bulk | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
- All assets must be wrapped in an
entities
array. - You must provide the exact type name for the asset (case-sensitive).
- You must provide the exact name of the asset (case-sensitive).
- You must provide the exact
qualifiedName
of the asset (case-sensitive). - You must set the
ownerUsers
andownerGroups
to an empty list.
When creating an asset¶
To add owners when creating an asset:
Add owners when creating asset | |
---|---|
1 2 3 4 5 6 |
|
- You must of course give the name of the object.
- The usernames must be nested within the
meta
.atlan
.attributes
structure. -
You must provide valid usernames, or email addresses, as a list.
Users must be valid
If the user does not exist in Atlan, there will be no updates to the asset. Please verify the usernames or email addresses in Atlan before assigning them to assets.
Add owners when creating asset | |
---|---|
1 2 3 4 5 6 7 |
|
- Use the
creator()
method to initialize the object with all necessary attributes for creating it](../advanced-examples/create.md#build-minimal-object-needed). - Set the owners that should be added. Note that this is a list of the usernames of the users.
- Call the
build()
method to build the enriched object. - Call the
save()
method to actually create the asset with these owners. - The response will include that single asset that was created.
Add owners when creating asset | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- Use the
creator()
method to initialize the object with all necessary attributes for creating it. - Set the owners that should be added. Note that this is a list of the usernames of the users.
- Call the
save()
method to actually create the asset with these owners. - Since a save can add, update, delete or partially update multiple assets the
assets_created()
method can be used to return a list of the assets of the specified type that were added. The assert statement is present to ensure aTable
asset was created. - Since only one
Table
has been created we use an index of 0 to retrieve the newly created table.
Add owners when creating asset | |
---|---|
1 2 3 4 5 6 7 |
|
- Use the
creator()
method to initialize the object with all necessary attributes for creating it](../advanced-examples/create.md#build-minimal-object-needed). - Set the owners that should be added. Note that this is a list of the usernames of the users.
- Call the
build()
method to build the enriched object. - Call the
save()
method to actually create the asset with these owners. - The response will include that single asset that was created.
POST /api/meta/entity/bulk | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
|
- All assets must be wrapped in an
entities
array. - You must provide the exact type name for the asset (case-sensitive).
- You must provide a name for the asset.
- In the case of a table, the
qualifiedName
must be the concatenation of the parent schema's qualifiedName and the name of the table. - When creating a table, you must specify the schema to create it within. This is defined by the
atlanSchema
attribute. You must specify both the type (must beSchema
) and qualifiedName of the schema within theatlanSchema
attribute — and the schema must already exist. - Provide the owners, as a list of usernames of users.