Skip to content

Manage data domains

Create a new data domain

1.10.10 2.0.4

To create a new data domain:

Create a data domain
1
2
3
4
5
DataDomain domain = DataDomain.creator("Marketing") // (1)
    .assetIcon(AtlanIcon.ROCKET) // (2)
    .assetThemeHex(AtlanMeshColor.MAGENTA)
    .build(); // (3)
AssetMutationResponse response = domain.save(); // (4)
  1. You must provide a human-readable name for your data domain.
  2. You can chain onto the creator any other enrichment, for example choosing a different icon or color to represent the domain.
  3. You then need to build the object.
  4. You can then save() the object you've built to create the new data domain in Atlan.
Create a data domain
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import DataDomain
from pyatlan.model.enums import AtlanIcon, AtlanMeshColor

client = AtlanClient()

domain = DataDomain.create(
    name="Marketing",  # (1)
)
domain.asset_icon = AtlanIcon.ROCKET  # (2)
domain.asset_theme_hex = AtlanMeshColor.MAGENTA

response = client.asset.save(domain)  # (3)
  1. You must provide a human-readable name for your data domain.
  2. You can apply any other enrichment, for example choosing a different icon or color to represent the domain.
  3. You can then save() the object to create the new data domain in Atlan.
Create a data domain
1
2
3
4
5
val domain = DataDomain.creator("Marketing") // (1)
    .assetIcon(AtlanIcon.ROCKET) // (2)
    .assetThemeHex(AtlanMeshColor.MAGENTA)
    .build() // (3)
val response = domain.save() // (4)
  1. You must provide a human-readable name for your data domain.
  2. You can chain onto the creator any other enrichment, for example choosing a different icon or color to represent the domain.
  3. You then need to build the object.
  4. You can then save() the object you've built to create the new data domain in Atlan.
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "entities": [
    {
      "typeName": "DataDomain", // (1)
      "attributes": {
        "name": "Marketing", // (2)
        "assetIcon": "PhRocket", // (3)
        "assetThemeHex": "#F34D77",
        "qualifiedName": "default/domain/marketing" // (4)
      }
    }
  ]
}
  1. The typeName must be exactly DataDomain.
  2. Human-readable name for your data domain.
  3. You can specify other enrichment, for example choosing a different icon or color to represent the domain.
  4. The qualifiedName should follow the pattern: default/domain/<lowerCamelCaseName>.

Create a new subdomain

1.8.4 1.8.1

To create a new subdomain:

Create a subdomain
1
2
3
4
DataDomain sub = DataDomain.creator("Social Marketing", // (1)
    DataDomain.refByQualifiedName("default/domain/marketing")) // (2)
    .build(); // (3)
AssetMutationResponse response = sub.save(); // (4)
  1. You must provide a human-readable name for your data domain.
  2. To create subdomain, you must provide the parent domain with at least its qualifiedName.
  3. You can chain on other enrichment, like above, but ultimately then need to build the object.
  4. You can then save() the object you've built to create the new data subdomain in Atlan.
Create a subdomain
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import DataDomain

client = AtlanClient()

sub_domain = DataDomain.create(
    name="Social Marketing",  # (1)
    parent_domain_qualified_name="default/domain/marketing",  # (2)
)
response = client.asset.save(sub_domain)
  1. Human-readable name for your data domain.
  2. To create subdomain, you must provide the parent domain qualifiedName.
Create a subdomain
1
2
3
4
val sub = DataDomain.creator("Social Marketing",  // (1)
    DataDomain.refByQualifiedName("default/domain/marketing")) // (2)
    .build() // (3)
val response = sub.save() // (4)
  1. You must provide a human-readable name for your data domain.
  2. To create subdomain, you must provide the parent domain with at least its qualifiedName.
  3. You can chain on other enrichment, like above, but ultimately then need to build the object.
  4. You can then save() the object you've built to create the new data subdomain in Atlan.
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
{
  "entities": [
    {
      "typeName": "DataDomain", // (1)
      "attributes": {
        "name": "Social Marketing", // (2)
        "qualifiedName": "default/domain/marketing/domain/socialMarketing", // (3)
        "parentDomainQualifiedName": "default/domain/marketing" // (4)
      },
      "relationshipAttributes": {
        "parentDomain": { // (5)
          "typeName": "DataDomain",
          "uniqueAttributes": {
            "qualifiedName": "default/domain/marketing"
          }
        }
      }
    }
  ]
}
  1. The typeName must be exactly DataDomain.
  2. Human-readable name for your data sub-domain.
  3. The qualifiedName should follow the pattern: <parentQualifiedName>/domain/<lowerCamelCaseName>.
  4. You must provide the qualifiedName of the parent domain.
  5. You must also specify a relationship to the parent domain, in this example through its qualifiedName.

Retrieve a data domain

1.8.4 1.8.1

To retrieve a data domain, use its qualified name:

Retrieve a data domain by its qualifiedName
1
DataDomain domain = DataDomain.get("default/domain/marketing"); // (1)
  1. If no exception is thrown, the returned object will be a non-null data domain.
Retrieve a data domain by its qualifiedName
1
2
3
4
5
6
7
8
9
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import DataDomain

client = AtlanClient()

domain = client.asset.get_by_qualified_name(
    asset_type=DataDomain,  # (1)
    qualified_name="default/domain/marketing"
)
  1. If no exception is thrown, the returned object will be non-null and of the type requested.
Retrieve a data domain by its qualifiedName
1
val domain = DataDomain.get("default/domain/marketing") // (1)
  1. If no exception is thrown, the returned object will be a non-null data domain.
GET /api/meta/entity/uniqueAttribute/type/DataDomain/attr:qualifiedName=default/domain/marketing&ignoreRelationships=false&minExtInfo=false
1
// (1)
  1. In the case of retrieving an asset, all necessary information is included in the URL of the request. There is no payload for the body of the request.

Update a data domain

1.8.4 1.8.1

To update a data domain or subdomain:

Update a data domain
1
2
3
4
5
DataDomain domain = DataDomain.updater("default/domain/marketing", // (1)
        "Marketing")
    .userDescription("Now with a description!") // (2)
    .build(); // (3)
AssetMutationResponse response = domain.save(); // (4)
  1. Use the updater() method to update a data domain, providing the qualifiedName and name of the data domain.
  2. You can chain onto the updater any other enrichment, for example changing the domain's description.
  3. You then need to build the object.
  4. You can then save() the object you've built to update the data domain in Atlan.
Update a data domain
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import DataDomain

client = AtlanClient()

data_domain = DataDomain.create_for_modification( # (1)
    qualified_name="default/domain/marketing", # (2)
    name="Marketing", # (3)
)
data_domain.user_description = "Now with a description!" # (4)

response = client.asset.save(data_domain)  # (5)
  1. Use the create_for_modification() method to update a data domain.
  2. You must provide the qualifiedName of the data domain.
  3. You must provide the name of the data domain.
  4. You can then add on any other updates, such as changing the user description of the data domain.
  5. To update the data domain in Atlan, call the save() method with the object you've built.
Update a data domain
1
2
3
4
5
val domain = DataDomain.updater("default/domain/marketing",  // (1)
        "Marketing")
    .userDescription("Now with a description!") // (2)
    .build() // (3)
val response = domain.save() // (4)
  1. Use the updater() method to update a data domain, providing the qualifiedName and name of the data domain.
  2. You can chain onto the updater any other enrichment, for example changing the domain's description.
  3. You then need to build the object.
  4. You can then save() the object you've built to update the data domain in Atlan.
POST /api/meta/entity/bulk
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
{
  "entities": [
    {
      "typeName": "DataDomain", // (1)
      "attributes": {
        "name": "Marketing", // (2)
        "qualifiedName": "default/domain/marketing", // (3)
        "userDescription": "Now with a description!" // (4)
      },
    }
  ]
}
  1. The typeName must be exactly DataDomain.
  2. Human-readable name for your data domain.
  3. You must provide the the qualifiedName of the domain to update.
  4. You can add on any other updates, such as changing the user description of the data domain.

Delete a data domain

1.8.4 1.8.1

Soft-delete (archive)

To soft-delete, or archive, a data domain:

Delete a data domain
1
AssetDeletionResponse response = DataDomain.delete("218c8144-dc39-43a5-b0c0-9eeb4d11e74a"); // (1)
  1. To archive a data domain in Atlan, call the DataDomain.delete() method with the GUID of the data domain.
Delete a data domain
1
2
3
4
5
from pyatlan.client.atlan import AtlanClient

client = AtlanClient()

client.asset.delete_by_guid("218c8144-dc39-43a5-b0c0-9eeb4d11e74a") # (1)
  1. To archive a data domain in Atlan, call the asset.delete_by_guid() method with the GUID of the data domain.
Delete a data domain
1
val response = DataDomain.delete("218c8144-dc39-43a5-b0c0-9eeb4d11e74a") // (1)
  1. To archive a data domain in Atlan, call the DataDomain.delete() method with the GUID of the data domain.
DELETE /api/meta/entity/bulk?guid=218c8144-dc39-43a5-b0c0-9eeb4d11e74a&deleteType=SOFT
1
// (1)
  1. All the details for deleting the data domain are specified in the URL directly. Note that you must provide the GUID of the data domain to delete it.

Hard-delete (purge)

To permanently delete (purge) a data domain:

Purge a data domain
1
AssetDeletionResponse response = DataDomain.purge("218c8144-dc39-43a5-b0c0-9eeb4d11e74a"); // (1)
  1. To permanently delete a data domain in Atlan, call the DataDomain.purge() method with the GUID of the data domain.
Purge a data domain
1
2
3
4
5
from pyatlan.client.atlan import AtlanClient

client = AtlanClient()

client.asset.purge_by_guid("218c8144-dc39-43a5-b0c0-9eeb4d11e74a") # (1)
  1. To permanently delete a data domain in Atlan, call the asset.purge_by_guid() method with the GUID of the data domain.
Purge a data domain
1
val response = DataDomain.purge("218c8144-dc39-43a5-b0c0-9eeb4d11e74a") // (1)
  1. To permanently delete a data domain in Atlan, call the DataDomain.purge() method with the GUID of the data domain.
DELETE /api/meta/entity/bulk?guid=218c8144-dc39-43a5-b0c0-9eeb4d11e74a&deleteType=PURGE
1
// (1)
  1. All the details for deleting the data domain are specified in the URL directly. Note that you must provide the GUID of the data domain to delete it.