Manage Google Data Studio assets
Operations on Google Data Studio assets (connections, data sources, reports).
In general, these should be:
- Created in top-down order (connection, then data sources and reports)
- Deleted in bottom-up order (data sources and reports, then connections)1
Asset structure
Connection
A Google Data Studio connection requires a name and qualifiedName. For creation, specific settings are also required to distinguish it as a Google Data Studio 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)
"gds-connection", // (3)
AtlanConnectorType.DATASTUDIO, // (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 Google Data Studio.
- 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, DataStudioAsset
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="gds-connection", # (4)
connector_type=AtlanConnectorType.DATASTUDIO, # (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 Google Data Studio.
- 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 ofadminRoles,adminGroups, oradminUsersmust be provided. It's important to note that the provided admin roles, groups, or users pertain to Atlan and not Google Data Studio. They define who has administrative control over this connection within Atlan. - 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 ofadminRoles,adminGroups, oradminUsersmust be provided. It's important to note that the provided admin roles, groups, or users pertain to Atlan and not Google Data Studio. They define who has administrative control over this connection within Atlan. - 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 ofadminRoles,adminGroups, oradminUsersmust be provided. It's important to note that the provided admin roles, groups, or users pertain to Atlan and not Google Data Studio. They define who has administrative control over this connection within Atlan. - Actually call Atlan to create the connection.
- Retrieve the qualifiedName for 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)
"gds-connection", // (3)
AtlanConnectorType.DATASTUDIO, // (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 Google Data Studio.
- 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": "gds-connection", // (2)
"connectorName": "datastudio", // (3)
"qualifiedName": "default/datastudio/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 exactlydatastudio. - The
qualifiedNameshould follow the pattern:default/datastudio/<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.
DataStudioAsset (report)
A Google Data Studio report asset requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the workspace and set the dataStudioAssetType to REPORT.
- Java
- Python
- Kotlin
- Raw REST API
DataStudioAsset report = DataStudioAsset.creator( // (1)
"gds-report", // (2)
connectionQualifiedName, // (3)
GoogleDataStudioAssetType.REPORT, // (4)
"identifier-from-gds") // (5)
.build();
AssetMutationResponse response = report.save(client); // (6)
- Build up the minimum request to create a report asset.
- Provide a human-readable name for your report asset.
- Provide the qualifiedName of the connection for this report asset.
- Specify the type of the asset, to make sure we're creating a report asset.
- (Recommended) Provide the unique identifier of this asset, from Google Data Studio itself. This will allow you to reconstruct the qualifiedName, for example if you later want to update this same asset. Alternatively, you can leave out this final parameter and a random UUID will be generated for you; however, you won't have a way to reconstruct this later for more efficient updates.
- Actually call Atlan to create the report asset. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
report = DataStudioAsset.creator( # (1)
name = "gds-report", # (2)
connection_qualified_name = connection_qualified_name # (3)
data_studio_asset_type = GoogleDataStudioAssetType.REPORT # (4)
)
response = client.asset.save(report) # (5)
- Build up the minimum request to create a report asset.
- Provide a human-readable name for your report asset.
- Provide the
qualified_nameof the connection for this report asset. - Specify the type of the asset, to make sure we're creating a report asset.
- Actually call Atlan to create the report asset.
val report = DataStudioAsset.creator( // (1)
"gds-report", // (2)
connectionQualifiedName, // (3)
GoogleDataStudioAssetType.REPORT, // (4)
"identifier-from-gds") // (5)
.build()
val response = report.save(client) // (6)
- Build up the minimum request to create a report asset.
- Provide a human-readable name for your report asset.
- Provide the qualifiedName of the connection for this report asset.
- Specify the type of the asset, to make sure we're creating a report asset.
- (Recommended) Provide the unique identifier of this asset, from Google Data Studio itself. This will allow you to reconstruct the qualifiedName, for example if you later want to update this same asset. Alternatively, you can leave out this final parameter and a random UUID will be generated for you; however, you won't have a way to reconstruct this later for more efficient updates.
- Actually call Atlan to create the report asset. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
{
"entities": [
{
"typeName": "DataStudioAsset", // (1)
"attributes": {
"name": "gds-report", // (2)
"qualifiedName": "default/datastudio/123456789/gds-report", // (3)
"connectionQualifiedName": "default/datastudio/123456789", // (4)
"connectorName": "datastudio", // (5)
"dataStudioAssetType": "REPORT" // (6)
}
}
]
}
- The
typeNamemust be exactlyDataStudioAsset. - Human-readable name for your asset.
- The
qualifiedNameshould follow the pattern:default/datastudio/<epoch>/<asset_name>, wheredefault/datastudio/<epoch>is the qualifiedName of the connection for this asset and<asset_name>is the name of the asset. - The
connectionQualifiedNamemust be the exact qualifiedName of the connection for this asset. - The
connectorNamemust be exactlydatastudio. - The
dataStudioAssetTypemust be exactlyREPORT.
DataStudioAsset (source)
A Google Data Studio data source asset requires a name and a qualifiedName. For creation, you also need to specify the connectionQualifiedName of the connection for the workspace and set the dataStudioAssetType to DATA_SOURCE.
- Java
- Python
- Kotlin
- Raw REST API
DataStudioAsset source = DataStudioAsset.creator( // (1)
"gds-source", // (2)
connectionQualifiedName, // (3)
GoogleDataStudioAssetType.DATA_SOURCE, // (4)
"identifier-from-gds") // (5)
.build();
AssetMutationResponse response = source.save(client); // (6)
- Build up the minimum request to create a data source asset.
- Provide a human-readable name for your data source asset.
- Provide the qualifiedName of the connection for this data source asset.
- Specify the type of the asset, to make sure we're creating a data source asset.
- (Recommended) Provide the unique identifier of this asset, from Google Data Studio itself. This will allow you to reconstruct the qualifiedName, for example if you later want to update this same asset. Alternatively, you can leave out this final parameter and a random UUID will be generated for you; however, you won't have a way to reconstruct this later for more efficient updates.
- Actually call Atlan to create the data source asset. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
source = DataStudioAsset.creator( # (1)
name = "gds-source", # (2)
connection_qualified_name = connection_qualified_name # (3)
data_studio_asset_type = GoogleDataStudioAssetType.DATA_SOURCE # (4)
)
response = client.asset.save(source) # (5)
- Build up the minimum request to create a data source asset.
- Provide a human-readable name for your data source asset.
- Provide the
qualified_nameof the connection for this data source asset. - Specify the type of the asset, to make sure we're creating a data source asset.
- Actually call Atlan to create the data source asset.
val source = DataStudioAsset.creator( // (1)
"gds-source", // (2)
connectionQualifiedName, // (3)
GoogleDataStudioAssetType.DATA_SOURCE, // (4)
"identifier-from-gds") // (5)
.build()
val response = source.save(client) // (6)
- Build up the minimum request to create a data source asset.
- Provide a human-readable name for your data source asset.
- Provide the qualifiedName of the connection for this data source asset.
- Specify the type of the asset, to make sure we're creating a data source asset.
- (Recommended) Provide the unique identifier of this asset, from Google Data Studio itself. This will allow you to reconstruct the qualifiedName, for example if you later want to update this same asset. Alternatively, you can leave out this final parameter and a random UUID will be generated for you; however, you won't have a way to reconstruct this later for more efficient updates.
- Actually call Atlan to create the data source asset. Because this operation will persist the asset in Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant.
{
"entities": [
{
"typeName": "DataStudioAsset", // (1)
"attributes": {
"name": "gds-source", // (2)
"qualifiedName": "default/datastudio/123456789/gds-source", // (3)
"connectionQualifiedName": "default/datastudio/123456789", // (4)
"connectorName": "datastudio", // (5)
"dataStudioAssetType": "DATA_SOURCE" // (6)
}
}
]
}
- The
typeNamemust be exactlyDataStudioAsset. - Human-readable name for your asset.
- The
qualifiedNameshould follow the pattern:default/datastudio/<epoch>/<asset_name>, wheredefault/datastudio/<epoch>is the qualifiedName of the connection for this asset and<asset_name>is the name of the asset. - The
connectionQualifiedNamemust be the exact qualifiedName of the connection for this asset. - The
connectorNamemust be exactlydatastudio. - The
dataStudioAssetTypemust be exactlyDATA_SOURCE.
Available relationships
Every level of the business intelligence structure is an Asset, and can therefore be related to the following other assets.