Skip to main content

Connection delete package

The connection delete package deletes a connection and all its related assets.

Soft-delete (archive) assets

To soft-delete (archive) all assets in a connection:

Archive assets
Workflow workflow = ConnectionDelete.creator( // (1)
"default/snowflake/1234567890", false // (2)
).build() // (3)
.toWorkflow(); // (4)

WorkflowResponse response = workflow.run(client); // (5)
  1. The ConnectionDelete package will create a workflow to delete a connection and its assets using the creator() method.

  2. You need to provide the following:

    • qualified name of the connection whose assets should be deleted.
    • whether to permanently delete the connection and its assets (hard-delete) (true), or only archive (soft-delete) them (false).
  3. Build the minimal package object.

  4. Convert the package into a Workflow object.

  5. Run the workflow using the run() method on the object you've created. Because this operation will execute work in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

    Workflows run asynchronously

Remember that workflows run asynchronously. See the packages and workflows introduction for details on how to check the status and wait until the workflow has been completed. :::

Hard-delete (purge) assets

Permanent and irreversible

A hard-delete (purge) is permanent and irreversible. Be certain that you want to entirely remove all of the assets in a connection before running in this way!

To hard-delete (purge) all assets in a connection:

Purge assets
Workflow workflow = ConnectionDelete.creator( // (1)
"default/snowflake/1234567890", true // (2)
).build() // (3)
.toWorkflow(); // (4)

WorkflowResponse response = workflow.run(client); // (5)
  1. The ConnectionDelete package will create a workflow to delete a connection and its assets using the creator() method.

  2. You need to provide the following:

    • qualified name of the connection whose assets should be deleted.
    • whether to permanently delete the connection and its assets (hard-delete) (true), or only archive (soft-delete) them (false).
  3. Build the minimal package object.

  4. Convert the package into a Workflow object.

  5. Run the workflow using the run() method on the object you've created. Because this operation will execute work in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

    Workflows run asynchronously

Remember that workflows run asynchronously. See the packages and workflows introduction for details on how to check the status and wait until the workflow has been completed. :::

Re-run existing workflow

To re-run an existing connection delete workflow:

Re-run existing connection delete workflow
List<WorkflowSearchResult> existing = WorkflowSearchRequest // (1)
.findByType(client, ConnectionDelete.PREFIX, 5); // (2)
// Determine which of the results is the Connection delete workflow you want to re-run...
WorkflowRunResponse response = existing.get(n).rerun(client); // (3)
  1. You can search for existing workflows through the WorkflowSearchRequest class.

  2. You can find workflows by their type using the findByType() helper method and providing the prefix for one of the packages. In this example, we do so for the ConnectionDelete. (You can also specify the maximum number of resulting workflows you want to retrieve as results.)

  3. Once you've found the workflow you want to re-run, you can simply call the rerun() helper method on the workflow search result. The WorkflowRunResponse is just a subtype of WorkflowResponse so has the same helper method to monitor progress of the workflow run. Because this operation will execute work in Atlan, you must provide it an AtlanClient through which to connect to the tenant.

    • Optionally, you can use the rerun(client, true) method with idempotency to avoid re-running a workflow that's already in running or in a pending state. This will return details of the already running workflow if found, and by default, it's set to false
    Workflows run asynchronously

Remember that workflows run asynchronously. See the packages and workflows introduction for details on how you can check the status and wait until the workflow has been completed. :::

Was this page helpful?