Add asset resources / links¶
Resources (links) can only be added to assets after an asset exists. (The asset itself must be created first.)
Add to an existing asset¶
Each resource can be assigned to only a single asset. To create a resource and assign it to an asset:
Managing resources for assets is currently not possible via dbt.
Add to an existing asset | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- Set up a reference to the asset you want to assign the resource to from somewhere. In this example, we just create a reference based on the qualifiedName of the asset we want, but this could also be from the result of a search, for example.
- Use the
creator()
method to initialize the link with all necessary attributes for creating it. - In the case of a link, you need to give a reference to an asset to which you want to attach the link.
- And the title Atlan should display for the link.
- And finally the URL for the link itself.
- Call the
save()
method to actually create the link and attach it to the asset. - The response will include that single asset that was created (the link).
- The response will also include a single asset that was updated (the asset to which you've attached the link).
Add to an existing asset | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
- Set up a reference to the asset you want to assign the resource to from somewhere. In this example, we just create a reference based on the qualified_name of the asset we want, but this could also be from the result of a search, for example.
- Use the
create()
method to build a link with all necessary attributes for creating it. - In the case of a link, you need to give a reference to an asset to which you want to attach the link.
- And the title Atlan should display for the link.
- And finally the URL for the link itself.
- Call the
save()
method to actually create the link and attach it to the asset. - Assert that the link was created.
- Assert a table was updated (the asset to which you've attached the link).
Add to an existing asset | |
---|---|
1 2 3 4 5 6 7 8 9 |
|
- Set up a reference to the asset you want to assign the resource to from somewhere. In this example, we just create a reference based on the qualifiedName of the asset we want, but this could also be from the result of a search, for example.
- Use the
creator()
method to initialize the link with all necessary attributes for creating it. - In the case of a link, you need to give a reference to an asset to which you want to attach the link.
- And the title Atlan should display for the link.
- And finally the URL for the link itself.
- Call the
save()
method to actually create the link and attach it to the asset. - The response will include that single asset that was created (the link).
- The response will also include a single asset that was updated (the asset to which you've attached the link).
Note that you are actually creating a new link asset
When adding a link through the API, you are really creating a new instance of a link asset. At the same time, you're attaching this new object to an existing asset.
POST /api/meta/entity/bulk | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
|
- All assets must be wrapped in an
entities
array. - You must provide the exact type name for the link asset, which will always be
Link
(case-sensitive). - You must also provide a name for the link. This will show up on the UI as the title of the link.
- You must also provide a unique
qualifiedName
for the link. This will not show up on the UI, and must be a unique UUID (generated yourself). - The URL for the link should be provided in the
link
field. - Finally, you need to include the reference information for the asset the link should be attached to.
Remove from an existing asset¶
To remove a link from an existing asset you only need to delete the link itself. (The link is itself an asset.)
See Deleting an asset.
The link will have its own GUID, separate from the asset to which it is attached
When deleting the link, you need to use the link's GUID, not the GUID of the asset to which it is attached.