Manage Superset assets
Operations on Superset assets (connections, dashboards, charts, datasets).
In general, these should be:
- Created in top-down order (connection, then dashboards, then charts and datasets)
- Deleted in bottom-up order (charts and datasets, then dashboards, then connections)1
Asset structure
Connection
A Superset connection requires a name and qualifiedName. For creation, specific settings are also required to distinguish it as a Superset 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)
"superset-connection", // (3)
AtlanConnectorType.SUPERSET, // (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 Superset.
- 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, SupersetDashboard, SupersetChart, SupersetDataset
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="superset-connection", # (4)
connector_type=AtlanConnectorType.SUPERSET, # (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 Superset.
- 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)
"superset-connection", // (3)
AtlanConnectorType.SUPERSET, // (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 Superset.
- 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": "superset-connection", // (2)
"connectorName": "superset", // (3)
"qualifiedName": "default/superset/123456789", // (4)
"category": "bi", // (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 exactlysuperset. - The
qualifiedNameshould follow the pattern:default/superset/<epoch>, where<epoch>is the time in milliseconds at which the connection is being created. - The
categorymust bebi. - 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.
SupersetDashboard
A Superset dashboard requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the dashboard.
- Java
- Python
- Kotlin
- Raw REST API
SupersetDashboard dashboard = SupersetDashboard.creator( // (1)
"ss-dashboard", // (2)
connectionQualifiedName) // (3)
.build();
AssetMutationResponse response = dashboard.save(client); // (4)
dashboard = response.getResult(dashboard); // (5)
- Build up the minimum request to create a dashboard.
- Provide a human-readable name for your dashboard.
- Provide the qualifiedName of the connection for this dashboard.
- Actually call Atlan to create the dashboard. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - Retrieve the created dashboard for use in subsequent creation calls. (You'd probably want to do some null checking first.)
dashboard = SupersetDashboard.creator( # (1)
name = "ss-dashboard", # (2)
connection_qualified_name = connection_qualified_name # (3)
)
response = client.asset.save(dashboard) # (4)
superset_dashboard_qualified_name = response.assets_created(asset_type=SupersetDashboard)[0].qualified_name # (5)
- Build up the minimum request to create a dashboard.
- Provide a human-readable name for your dashboard.
- Provide the
qualified_nameof the Superset connection for this dashboard. - Actually call Atlan to create the dashboard.
- Retrieve the created dashboard for use in subsequent creation calls. (You'd probably want to do some null checking first.)
var dashboard = SupersetDashboard.creator( // (1)
"ss-dashboard", // (2)
connectionQualifiedName) // (3)
.build()
val response = dashboard.save(client) // (4)
dashboard = response.getResult(dashboard) // (5)
- Build up the minimum request to create a dashboard.
- Provide a human-readable name for your dashboard.
- Provide the qualifiedName of the connection for this dashboard.
- Actually call Atlan to create the dashboard. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - Retrieve the created dashboard for use in subsequent creation calls. (You'd probably want to do some null checking first.)
{
"entities": [
{
"typeName": "SupersetDashboard", // (1)
"attributes": {
"name": "ss-dashboard", // (2)
"qualifiedName": "default/superset/123456789/ss-dashboard", // (3)
"connectionQualifiedName": "default/superset/123456789", // (4)
"connectorName": "superset" // (5)
}
}
]
}
- The
typeNamemust be exactlySupersetDashboard. - Human-readable name for your dashboard.
- The
qualifiedNameshould follow the pattern:default/superset/<epoch>/<dashboard_name>, wheredefault/superset/<epoch>is the qualifiedName of the connection for this dashboard and<dashboard_name>is the name for this dashboard. - The
connectionQualifiedNamemust be the exact qualifiedName of the connection for this dashboard. - The
connectorNamemust be exactlysuperset.
SupersetChart
A Superset chart requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the chart, and the names and qualifiedNames of the chart's ancestors.
- Java
- Python
- Kotlin
- Raw REST API
SupersetChart chart = SupersetChart.creator( // (1)
"ss-chart", // (2)
dashboard) // (3)
.build();
AssetMutationResponse response = chart.save(client); // (4)
- Build up the minimum request to create a chart.
- Provide a human-readable name for your chart.
- Provide the dashboard for this chart.
- Actually call Atlan to create the chart. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
chart = SupersetChart.creator( # (1)
name = "ss-chart ", # (2)
superset_dashboard_qualified_name = superset_dashboard_qualified_name, # (3)
connection_qualified_name = connection_qualified_name # (4)
)
response = client.asset.save(chart) # (5)
- Build up the minimum request to create a chart.
- Provide a human-readable name for your chart.
- Provide the
qualified_nameof the dashboard. - Optional, provide the
qualified_nameof the connection for the chart. - Actually call Atlan to create the chart.
val chart = SupersetChart.creator( // (1)
"ss-chart", // (2)
dashboard) // (3)
.build()
val response = chart.save(client) // (4)
- Build up the minimum request to create a chart.
- Provide a human-readable name for your chart.
- Provide the dashboard for this chart.
- Actually call Atlan to create the chart. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
{
"entities": [
{
"typeName": "SupersetChart", // (1)
"attributes": {
"name": "ss-chart", // (2)
"qualifiedName": "default/superset/123456789/ss-dashboard/ss-chart", // (3)
"connectionQualifiedName": "default/superset/123456789", // (4)
"connectorName": "superset", // (5)
"SupersetDashboard": { // (6)
"typeName": "SupersetDashboard", // (7)
"uniqueAttributes": { // (8)
"qualifiedName": "default/superset/123456789/ss-dashboard"
}
},
"supersetDashboardQualifiedName": "default/superset/123456789/ss-dashboard" // (9)
}
}
]
}
- The
typeNamemust be exactlySupersetChart. - Human-readable name for your chart.
- The
qualifiedNameshould follow the pattern:default/superset/<epoch>/<dashboard_name>/<chart_name>, wheredefault/superset/<epoch>/<dashboard_name>is the qualifiedName of the dashboard for this chart and<chart_name>is the name for this chart. - The
connectionQualifiedNamemust be the exact qualifiedName of the connection for this chart. - The
connectorNamemust be exactlysuperset. - The dashboard in which this chart exists is embedded in the
SupersetDashboardattribute. - The
typeNamefor this embedded reference must beSupersetDashboard. - To complete the reference, you must include a
uniqueAttributesobject with the qualifiedName of the dashboard. Note: the dashboard must already exist in Atlan before creating the chart. - The
supersetDashboardQualifiedNameshould be the qualifiedName of the dashboard.
SupersetDataset
A Superset dataset requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the dataset, and the names and qualifiedNames of the dataset's ancestors.
- Java
- Python
- Kotlin
- Raw REST API
SupersetDataset dataset = SupersetDataset.creator( // (1)
"ss-dataset", // (2)
dashboard) // (3)
.build();
AssetMutationResponse response = dataset.save(client); // (4)
- Build up the minimum request to create a dataset.
- Provide a human-readable name for your dataset.
- Provide the dashboard for this dataset.
- Actually call Atlan to create the dataset. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
dataset = SupersetDataset.creator( # (1)
name = "ss-dataset ", # (2)
superset_dashboard_qualified_name = superset_dashboard_qualified_name, # (3)
connection_qualified_name = connection_qualified_name # (4)
)
response = client.asset.save(dataset) # (5)
- Build up the minimum request to create a dataset.
- Provide a human-readable name for your dataset.
- Provide the
qualified_nameof the dashboard. - Optional, provide the
qualified_nameof the connection for the dataset. - Actually call Atlan to create the dataset.
val dataset = SupersetDataset.creator( // (1)
"ss-dataset", // (2)
dashboard) // (3)
.build()
val response = dataset.save(client) // (4)
- Build up the minimum request to create a dataset.
- Provide a human-readable name for your dataset.
- Provide the dashboard for this dataset.
- Actually call Atlan to create the dataset. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
{
"entities": [
{
"typeName": "SupersetDataset", // (1)
"attributes": {
"name": "ss-dataset", // (2)
"qualifiedName": "default/superset/123456789/ss-dashboard/ss-dataset", // (3)
"connectionQualifiedName": "default/superset/123456789", // (4)
"connectorName": "superset", // (5)
"SupersetDashboard": { // (6)
"typeName": "SupersetDashboard", // (7)
"uniqueAttributes": { // (8)
"qualifiedName": "default/superset/123456789/ss-dashboard"
}
},
"supersetDashboardQualifiedName": "default/superset/123456789/ss-dashboard" // (9)
}
}
]
}
- The
typeNamemust be exactlySupersetDataset. - Human-readable name for your dataset.
- The
qualifiedNameshould follow the pattern:default/superset/<epoch>/<dashboard_name>/<dataset_name>, wheredefault/superset/<epoch>/<dashboard_name>is the qualifiedName of the dashboard for this dataset and<dataset_name>is the name for this dataset. - The
connectionQualifiedNamemust be the exact qualifiedName of the connection for this dataset. - The
connectorNamemust be exactlysuperset. - The dashboard in which this dataset exists is embedded in the
SupersetDashboardattribute. - The
typeNamefor this embedded reference must beSupersetDashboard. - To complete the reference, you must include a
uniqueAttributesobject with the qualifiedName of the dashboard. Note: the dashboard must already exist in Atlan before creating the dataset. - The
supersetDashboardQualifiedNameshould be the qualifiedName of the dashboard.
Available relationships
Every level of the business intelligence structure is an Asset, and can therefore be related to the following other assets.