Skip to main content

Manage Insights assets (Collection, Folder, Query)

In general, these should be:

  • Created in top-down order (collection, folder, query)
  • Deleted in bottom-up order (query, folder, collection)1

Collection

To create a Collection:

Create a collection
AtlanCollection collection = AtlanCollection.creator(client, "MyCollection") 
.adminGroup("admins")
.build(); // (1)
AssetMutationResponse response = collection.save(client); // (2)
  1. Build the minimum request to create a collection.

    • provide an instance of AtlanClient.
    • specify a human-readable name for your collection.
    • (optional) specify the name of the group that can administer this collection. You can use also use adminUsers, viewerUsers, ownerUsers, etc to manage different levels of access control for the collection.
  2. Actually call Atlan to create the collection. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

Folder

To create a Folder:

Create a folder
Folder folder = Folder.creator("MyFolder", collection).build(); // (1)
AssetMutationResponse response = folder.save(client); // (2)
  1. Build the minimum request to create a folder.

    • specify a human-readable name for your folder.
    • provide an instance of Collection, or if you want to create a sub-folder, provide an instance of Folder.
  2. Actually call Atlan to create the folder. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

Query

To create a Query:

Create a query
String schemaQualifiedName = "default/snowflake/1735591234/DB/SCHEMA";
AtlanQuery query = AtlanQuery.creator("MyQuery", folder) // (1)
.withRawQuery(schemaQualifiedName, "SELECT * FROM CUSTOMERS;") // (2)
.build();
AssetMutationResponse response = query.save(client); // (3)
  1. Build the minimum request to create a query.

    • specify a human-readable name for your query.
    • provide an instance of Folder, or if you want to create a query inside a collectin, provide an instance of Collection.
  2. In this example, we're creating a query for an existing Snowflake schema.

  3. Actually call Atlan to create the folder. Because this operation will persist the asset in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

Footnotes

  1. Although if you want to delete everything in a connection, your better avenue is the packaged connection delete utility in the UI.

Was this page helpful?