Manage App assets
Operations on App assets.
In general, these should be:
- Created in top-down order (Connection, then Application, then ApplicationField)
- Deleted in bottom-up order (ApplicationField, Application, then Connections)1
Asset structure
Connection
An App connection requires a name and qualifiedName. For creation, specific settings are also required to distinguish it as an App connection rather than another type of connection. In addition, at least one of adminRoles, adminGroups, or adminUsers must be provided.
- Java
- Python
- Kotlin
- Raw REST API
String adminRoleGuid = client.getRoleCache().getIdForName("$admin"); // (1)
Connection connection = Connection.creator( // (2)
"app-connection", // (3)
AtlanConnectorType.APP, // (4)
List.of(adminRoleGuid), // (5)
List.of("group2"), // (6)
List.of("jsmith")) // (7)
.build();
AssetMutationResponse response = connection.save(client); // (8)
String connectionQualifiedName = response.getCreatedAssets().get(0).getQualifiedName(); // (9)
- Retrieve the GUID for the admin role, to use later for defining the roles that can administer the connection.
- Build up the minimum request to create a connection.
- Provide a human-readable name for your connection, such as
productionordevelopment. - Set the type of connection to APP.
- List the workspace roles that should be able to administer the connection (or null if none). All users with that workspace role (current and future) will be administrators of the connection. Note that the values here need to be the GUIDs of the workspace roles. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - List the group names that can administer this connection (or null if none). All users within that group (current and future) will be administrators of the connection. Note that the values here are the names of the groups. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - List the user names that can administer this connection (or null if none). Note that the values here are the usernames of the users. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - Actually call Atlan to create the connection. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - Retrieve the qualifiedName for use in subsequent creation calls. (You'd probably want to do some null checking first.)
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Connection, Application, Table, Schema
from pyatlan.model.enums import AtlanConnectorType
client = AtlanClient()
admin_role_guid = client.role_cache.get_id_for_name("$admin") # (1)
connection = Connection.creator( # (2)
client=client, # (3)
name="app-connection", # (4)
connector_type=AtlanConnectorType.APP, # (5)
admin_roles=[admin_role_guid], # (6)
admin_groups=["group2"], # (7)
admin_users=["jsmith"] # (8)
)
response = client.asset.save(connection) # (9)
connection_qualified_name = response.assets_created(asset_type=Connection)[0].qualified_name # (10)
- Retrieve the GUID for the admin role, to use later for defining the roles that can administer the connection.
- Build up the minimum request to create a connection.
- You must provide a client instance.
- Provide a human-readable name for your connection, such as
productionordevelopment. - Set the type of connection to APP.
- List the workspace roles that should be able to administer the connection (or
Noneif none). All users with that workspace role (current and future) will be administrators of the connection. Note that the values here need to be the GUIDs of the workspace roles. At least one ofadmin_roles,admin_groups, oradmin_usersmust be provided. - List the group names that can administer this connection (or
Noneif none). All users within that group (current and future) will be administrators of the connection. Note that the values here are the names of the groups. At least one ofadmin_roles,admin_groups, oradmin_usersmust be provided. - List the user names that can administer this connection (or
Noneif none). Note that the values here are the usernames of the users. At least one ofadmin_roles,admin_groups, oradmin_usersmust be provided. - Actually call Atlan to create the connection.
- Retrieve the
qualified_namefor use in subsequent creation calls. (You'd probably want to do some null checking first.)
val adminRoleGuid = client.roleCache.getIdForName("\$admin") // (1)
val connection = Connection.creator( // (2)
"app-connection", // (3)
AtlanConnectorType.APP, // (4)
listOf(adminRoleGuid), // (5)
listOf("group2"), // (6)
listOf("jsmith")) // (7)
.build()
val response = connection.save(client) // (8)
val connectionQualifiedName = response.createdAssets[0].qualifiedName // (9)
- Retrieve the GUID for the admin role, to use later for defining the roles that can administer the connection.
- Build up the minimum request to create a connection.
- Provide a human-readable name for your connection, such as
productionordevelopment. - Set the type of connection to APP.
- List the workspace roles that should be able to administer the connection (or null if none). All users with that workspace role (current and future) will be administrators of the connection. Note that the values here need to be the GUIDs of the workspace roles. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - List the group names that can administer this connection (or null if none). All users within that group (current and future) will be administrators of the connection. Note that the values here are the names of the groups. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - List the user names that can administer this connection (or null if none). Note that the values here are the usernames of the users. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - Actually call Atlan to create the connection. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - Retrieve the qualifiedName for use in subsequent creation calls. (You'd probably want to do some null checking first.)
{
"entities": [
{
"typeName": "Connection", // (1)
"attributes": {
"name": "app-connection", // (2)
"connectorName": "app", // (3)
"qualifiedName": "default/app/123456789", // (4)
"category": "APP", // (5)
"adminRoles": [ // (6)
"e7ae0295-c60a-469a-bd2c-fb903943aa02"
],
"adminGroups": [ // (7)
"group2"
],
"adminUsers": [ // (8)
"jsmith"
]
}
}
]
}
- The
typeNamemust be exactlyConnection. - Human-readable name for your connection, such as
productionordevelopment. - The
connectorNamemust be exactlyapp. - The
qualifiedNameshould follow the pattern:default/app/<epoch>, where<epoch>is the time in milliseconds at which the connection is being created. - The
categorymust beAPP. - List any workspace roles that can administer this connection. All users with that workspace role (current and future) will be administrators of the connection. Note that the values here need to be the GUIDs of the workspace roles. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - List any groups that can administer this connection. All users within that group (current and future) will be administrators of the connection. Note that the values here are the names of the groups. At least one of
adminRoles,adminGroups, oradminUsersmust be provided. - List any users that can administer this connection. Note that the values here are the usernames of the users. At least one of
adminRoles,adminGroups, oradminUsersmust be provided.
Atlan creates the policies that grant access to a connection, including the ability to retrieve the connection and to create assets within it, asynchronously. It can take several seconds (even up to approximately 30 seconds) before these are in place after creating the connection.
You may therefore need to wait before you'll be able to create the assets below within the connection.
To confirm access, retrieve the connection after it has been created. The SDKs' retry loops will automatically retry until the connection can be successfully retrieved. At that point, your API token has permission to create the other assets.
Note: if you are reusing an existing connection rather than creating one via your API token, you must give your API token a persona that has access to that connection. Otherwise all attempts to create, read, update, or delete assets within that connection will fail due to a lack of permissions.
Application
An Application requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the Application. You can also provide the appId and applicationOwnedAssets for the asset.
- Java
- Python
- Kotlin
- Raw REST API
Application application = Application.creator( // (1)
"application", // (2)
connectionQualifiedName,) // (3)
.appId("1234") // (4)
.applicationOwnedAssets(List.of(
Table.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA/TABLE"),
Schema.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA"))) // (5)
.build();
AssetMutationResponse response = application.save(client); // (6)
- Build up the minimum request to create an Application.
- Provide a human-readable name for your Application.
- Provide the qualifiedName of the connection for this asset.
- (Optional) Provide the
appIdof this application in the source system. - (Optional) Provide the list of assets that exist in this application. Also update the individual assets to hold the qualifiedName of this application in the attribute
applicationQualifiedName. - Actually call Atlan to create the application. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
application = Application.creator( # (1)
name = "application", # (2)
connection_qualified_name = connection_qualified_name, # (3)
)
application.app_id = "1234", # (4)
application.application_owned_assets = [
Table.ref_by_qualified_name("default/snowflake/123456789/DATABASE/SCHEMA/TABLE"),
Schema.ref_by_qualified_name("default/snowflake/123456789/DATABASE/SCHEMA")
] # (5)
response = client.asset.save(application) # (6)
application_qualified_name = response.assets_created(asset_type=Application)[0].qualified_name # (7)
- Build up the minimum request to create an Application.
- Provide a human-readable name for your Application.
- Provide the
qualified_nameof the connection for this Application. - (Optional) Provide the
appIdof this application in the source system. - (Optional) Provide the list of assets that exist in this application. Also update the individual assets to hold the qualifiedName of this application in the attribute
applicationQualifiedName. - Actually call Atlan to create the Application.
- Retrieve the
qualified_namefor use in subsequent creation calls. (You'd probably want to do some null checking first.)
val application = Application.creator( // (1)
"application", // (2)
connectionQualifiedName,) // (3)
.appId("1234") // (4)
.applicationOwnedAssets(List.of(
Table.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA/TABLE"),
Schema.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA"))) // (5)
.build()
val response = application.save(client) // (6)
- Build up the minimum request to create an Application.
- Provide a human-readable name for your Application.
- Provide the qualifiedName of the connection for this asset.
- (Optional) Provide the
appIdof this application in the source system. - (Optional) Provide the list of assets that exist in this application. Also update the individual assets to hold the qualifiedName of this application in the attribute
applicationQualifiedName. - Actually call Atlan to create the application. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
{
"entities": [
{
"typeName": "Application", // (1)
"attributes": {
"name": "application", // (2)
"qualifiedName": "default/app/123456789/application", // (3)
"connectionQualifiedName": "default/app/123456789", // (4)
"connectorName": "app", // (5)
"appId": "1234", // (6)
"applicationOwnedAssets": [ // (7)
},
{
"typeName": "Schema",
"uniqueAttributes": {
"qualifiedName": "default/snowflake/123456789/DATABASE/SCHEMA"
}
}
]
}
}
]
}
- The
typeNamemust be exactlyApplication. - Human-readable name for your asset.
- The
qualifiedNameshould follow the pattern:default/app/<epoch>/<assetName>, wheredefault/app/<epoch>is the qualifiedName of the connection for this asset and<assetName>is the name of this asset. - The
connectionQualifiedNamemust be the exact qualifiedName of the connection for this asset. - The
connectorNamemust be exactlyapp. - (Optional) The
appIdshould be id of the application in the source system. - (Optional) The Catalog assets which are present inside this application are added in
applicationOwnedAssetsattribute. - The
typeNamefor this embedded reference must be the type of asset being embeded. - To complete the reference, you must include a
uniqueAttributesobject with the qualifiedName of the asset. Note: the asset must already exist in Atlan before creating the path.
ApplicationField
An ApplicationField requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the ApplicationField, and the applicationQualifiedName of the field's ancestor. You can also provide the applicationFieldOwnedAssets for the asset.
- Java
- Python
- Kotlin
- Raw REST API
ApplicationField applicationField = ApplicationField.creator( // (1)
"application-field", // (2)
application) // (3)
.applicationFieldOwnedAssets(List.of(
Table.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA/TABLE"),
Schema.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA"))) // (4)
.build();
AssetMutationResponse response = applicationField.save(client); // (5)
- Build up the minimum request to create an ApplicationField.
- Provide a human-readable name for your ApplicationField.
- Provide the application for this field.
- (Optional) Provide the list of assets that exist in this ApplicationField. Also update the individual assets to hold the qualifiedName of this ApplicationField in the attribute
applicationFieldQualifiedName. - Actually call Atlan to create the ApplicationField. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
applicationField = ApplicationField.creator( # (1)
name = "application-field", # (2)
application_qualified_name = application_qualified_name, # (3)
)
applicationField.application_field_owned_assets = [
Table.ref_by_qualified_name("default/snowflake/123456789/DATABASE/SCHEMA/TABLE"),
Schema.ref_by_qualified_name("default/snowflake/123456789/DATABASE/SCHEMA")
] # (4)
response = client.asset.save(applicationField) # (5)
- Build up the minimum request to create an ApplicationField.
- Provide a human-readable name for your ApplicationField.
- Provide the
qualified_nameof the application for this ApplicationField. - (Optional) Provide the list of assets that exist in this ApplicationField. Also update the individual assets to hold the
qualifiedNameof this ApplicationField in the attributeapplicationFieldQualifiedName. - Actually call Atlan to create the ApplicationField.
val applicationField = ApplicationField.creator( // (1)
"application-field", // (2)
application) // (3)
.applicationFieldOwnedAssets(List.of(
Table.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA/TABLE"),
Schema.refByQualifiedName("default/snowflake/123456789/DATABASE/SCHEMA"))) // (4)
.build()
val response = applicationField.save(client) // (5)
- Build up the minimum request to create an ApplicationField.
- Provide a human-readable name for your ApplicationField.
- Provide the application for this field.
- (Optional) Provide the list of assets that exist in this ApplicationField. Also update the individual assets to hold the
qualifiedNameof this ApplicationField in the attributeapplicationFieldQualifiedName. - Actually call Atlan to create the ApplicationField. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
{
"entities": [
{
"typeName": "ApplicationField", // (1)
"attributes": {
"name": "application-field", // (2)
"qualifiedName": "default/app/123456789/application/field", // (3)
"connectionQualifiedName": "default/app/123456789", // (4)
"connectorName": "app", // (5)
"parentApplication": { // (6)
"typeName": "Application", // (7)
"uniqueAttributes": { // (8)
"qualifiedName": "default/app/123456789/application"
}
},
"applicationParentQualifiedName": "default/app/123456789/application", // (9)
"applicationFieldOwnedAssets": [ // (10)
},
{
"typeName": "Schema",
"uniqueAttributes": {
"qualifiedName": "default/snowflake/123456789/DATABASE/SCHEMA"
}
}
]
}
}
]
}
- The
typeNamemust be exactlyApplicationField. - Human-readable name for your asset.
- The
qualifiedNameshould follow the pattern:default/app/<epoch>/<applicationName>/<fieldName>, wheredefault/app/<epoch>/<applicationName>is the qualifiedName of the application for this field and<fieldName>is the name of this asset. - The
connectionQualifiedNamemust be the exact qualifiedName of the connection for this asset. - The
connectorNamemust be exactlyapp. - The application in which this field exists is embedded in the
parentApplicationattribute. - The
typeNamefor this embedded reference must beApplication. - To complete the reference, you must include a
uniqueAttributesobject with the qualifiedName of the application. Note: the application must already exist in Atlan before creating the path. - The
applicationParentQualifiedNamemust be the qualifiedName of the application which contains this field. - (Optional) The Catalog assets which are present inside this ApplicationField are added in
applicationFieldOwnedAssetsattribute. - The
typeNamefor this embedded reference must be the type of asset being embeded. - To complete the reference, you must include a
uniqueAttributesobject with the qualifiedName of the asset. Note: the asset must already exist in Atlan before creating the path.
Available relationships
Every level of the App structure is an Asset, and can therefore be related to the following other assets.