Tags and Labels Guide

This guide covers catalog asset tags and asset labels in ADOC using the Python SDK. Tags are named markers attached to catalog assets. Labels are key-value metadata pairs you can use for ownership, environment, or other custom attributes.

Asset Tags

Asset tags are catalog-level tags associated with a single asset. You can work with them on AdocClient (by numeric asset ID) or on an AssetResource returned from client.get_asset(...).

Method

Description

get_asset_tags(asset_id)

List tags on an asset.

add_asset_tag(asset_id, payload)

Add a tag to an asset.

Both approaches return AssetTagInfo objects with fields such as name, id, classification, enabled, and processing_status. Use tag.to_dict() for the full API-shaped payload.

List and Add Tags (Client)

from acceldata.models.api.catalog.asset_tag_request import AssetTagRequest asset_id = 77428678 tag_name = "my-tag" tags = client.get_asset_tags(asset_id) print([t.to_dict() for t in tags]) if not any(t.name == tag_name for t in tags): tag = client.add_asset_tag(asset_id, AssetTagRequest(name=tag_name)) print(tag.to_dict())

AssetTagRequest accepts name (create or reference by name) or id (reference an existing tag by numeric ID).

List and Add Tags (Asset Resource)

When you already have an AssetResource, call the same operations without passing asset_id again:

asset = client.get_asset(asset_id) tags = asset.get_asset_tags() print([t.to_dict() for t in tags]) if not any(t.name == tag_name for t in tags): tag = asset.add_asset_tag(AssetTagRequest(name=tag_name)) print(tag.to_dict())

AdocClient.get_asset_tags and AssetResource.get_asset_tags return the same tag names for a given asset.

Asset Labels

Asset labels are key-value pairs stored on a catalog asset. Read them with get_asset_labels, and set or update them with add_asset_labels.

Method

Description

get_asset_labels(asset_id)

List labels on an asset.

add_asset_labels(asset_id, payload)

Set or update labels.

Each label is a Label with key and value. The update call accepts one or more labels in a single request.

List and Add Labels (Client)

from acceldata.models.api.catalog.asset_label_request import AssetLabelRequest from acceldata.models.api.catalog.label import Label labels = client.get_asset_labels(asset_id) print([label.to_dict() for label in labels]) updated = client.add_asset_labels( asset_id, AssetLabelRequest(labels=[Label(key="team", value="data-platform")]), ) print([label.to_dict() for label in updated])

Add Multiple Labels at Once

updated = client.add_asset_labels( asset_id, AssetLabelRequest( labels=[ Label(key="team", value="data-platform"), Label(key="environment", value="production"), ] ), )

Labels via Asset Resource

asset = client.get_asset(asset_id) labels = asset.get_asset_labels() updated = asset.add_asset_labels( AssetLabelRequest(labels=[Label(key="team", value="data-platform")]), )