Skip to content

Connection delete package

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

Soft-delete (archive) assets

2.2.3 1.9.0

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

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

WorkflowResponse response = workflow.run(); // (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.

    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.

Archive assets
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.packages import ConnectionDelete

client = AtlanClient()

workflow = ConnectionDelete( # (1)
    qualified_name="default/snowflake/1234567890", purge=False # (2)
).to_workflow() # (3)

response = client.workflow.run(workflow) # (4)
  1. The ConnectionDelete package will create a workflow to delete a connection and its assets.
  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. Convert the package into a Workflow object.

  4. Run the workflow by invoking the run() method on the workflow client, passing the created object.

    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.

Create the workflow via UI only

We recommend creating the workflow only via the UI. To rerun an existing workflow, see the steps below.

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!

2.2.3 1.9.0

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

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

WorkflowResponse response = workflow.run(); // (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.

    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.

Purge assets
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.packages import ConnectionDelete

client = AtlanClient()

workflow = ConnectionDelete( # (1)
    qualified_name="default/snowflake/1234567890", purge=True # (2)
).to_workflow() # (3)

response = client.workflow.run(workflow) # (4)
  1. The ConnectionDelete package will create a workflow to delete a connection and its assets.
  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. Convert the package into a Workflow object.

  4. Run the workflow by invoking the run() method on the workflow client, passing the created object.

    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.

Create the workflow via UI only

We recommend creating the workflow only via the UI. To rerun an existing workflow, see the steps below.