PUT /v1/dataProducts/{fqn}/assets/add
from metadata.generated.schema.type.entityReference import EntityReference
from metadata.sdk import configure
from metadata.sdk.entities import DataProducts
configure(
host="https://your-company.getcollate.io/api",
jwt_token="your-jwt-token"
)
# Identify the data product by its name, which is also its fully qualified name, and each asset by its UUID.
# Add input ports
DataProducts.add_input_ports(
"CustomerInsights",
[EntityReference(id="table-uuid-1", type="table")]
)
# Remove input ports
DataProducts.remove_input_ports(
"CustomerInsights",
[EntityReference(id="table-uuid-1", type="table")]
)
# Add output ports
DataProducts.add_output_ports(
"CustomerInsights",
[EntityReference(id="dashboard-uuid-1", type="dashboard")]
)
# Remove output ports
DataProducts.remove_output_ports(
"CustomerInsights",
[EntityReference(id="dashboard-uuid-1", type="dashboard")]
)
# Add assets
DataProducts.add_assets(
"CustomerInsights",
[EntityReference(id="table-uuid-2", type="table")]
)
# Remove assets
DataProducts.remove_assets(
"CustomerInsights",
[EntityReference(id="table-uuid-2", type="table")]
)
import java.util.List;
import java.util.UUID;
import org.openmetadata.schema.type.EntityReference;
import org.openmetadata.schema.type.api.BulkAssets;
// client is an initialized OpenMetadataClient.
var dataProduct = "CustomerInsights";
var tables = new BulkAssets().withAssets(List.of(
new EntityReference()
.withId(UUID.fromString("5b3d9f0e-1c7a-4d2e-9a61-3f8e2b7c4d10"))
.withType("table")));
// Identify the data product by its name, which is also its fully qualified name, and each asset by its UUID.
// Add assets
var added = client.dataProducts().bulkAddAssets(dataProduct, tables);
System.out.println(added.getStatus());
// Remove assets
var removed = client.dataProducts().bulkRemoveAssets(dataProduct, tables);
// Add and remove input ports
client.dataProducts().bulkAddInputPorts(dataProduct, tables);
client.dataProducts().bulkRemoveInputPorts(dataProduct, tables);
// Add and remove output ports
client.dataProducts().bulkAddOutputPorts(dataProduct, tables);
client.dataProducts().bulkRemoveOutputPorts(dataProduct, tables);
# The path identifier is the data product's fully qualified name. URL-encode it if it contains spaces.
# Add assets
curl -X PUT "{base_url}/api/v1/dataProducts/CustomerInsights/assets/add" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"assets": [
{"id": "table-uuid-1", "type": "table"},
{"id": "topic-uuid-1", "type": "topic"}
]
}'
# Remove assets
curl -X PUT "{base_url}/api/v1/dataProducts/CustomerInsights/assets/remove" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"assets": [
{"id": "table-uuid-1", "type": "table"}
]
}'
{
"id": "b1839f98-f046-5f35-bdef-20f9b3395cb2",
"name": "CustomerInsights",
"fullyQualifiedName": "CustomerInsights",
"description": "Curated customer analytics data product",
"version": 0.3,
"updatedAt": 1769984330261,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/dataProducts/b1839f98-f046-5f35-bdef-20f9b3395cb2",
"domains": [
{
"id": "a0729e98-e946-4e25-acde-10e8a2294ba1",
"type": "domain",
"name": "Marketing",
"fullyQualifiedName": "Marketing",
"deleted": false
}
],
"deleted": false,
"owners": [],
"experts": []
}
Ports & Assets
Manage input ports, output ports, and assets for a data product
PUT
/
v1
/
dataProducts
/
{fqn}
/
assets
/
add
PUT /v1/dataProducts/{fqn}/assets/add
from metadata.generated.schema.type.entityReference import EntityReference
from metadata.sdk import configure
from metadata.sdk.entities import DataProducts
configure(
host="https://your-company.getcollate.io/api",
jwt_token="your-jwt-token"
)
# Identify the data product by its name, which is also its fully qualified name, and each asset by its UUID.
# Add input ports
DataProducts.add_input_ports(
"CustomerInsights",
[EntityReference(id="table-uuid-1", type="table")]
)
# Remove input ports
DataProducts.remove_input_ports(
"CustomerInsights",
[EntityReference(id="table-uuid-1", type="table")]
)
# Add output ports
DataProducts.add_output_ports(
"CustomerInsights",
[EntityReference(id="dashboard-uuid-1", type="dashboard")]
)
# Remove output ports
DataProducts.remove_output_ports(
"CustomerInsights",
[EntityReference(id="dashboard-uuid-1", type="dashboard")]
)
# Add assets
DataProducts.add_assets(
"CustomerInsights",
[EntityReference(id="table-uuid-2", type="table")]
)
# Remove assets
DataProducts.remove_assets(
"CustomerInsights",
[EntityReference(id="table-uuid-2", type="table")]
)
import java.util.List;
import java.util.UUID;
import org.openmetadata.schema.type.EntityReference;
import org.openmetadata.schema.type.api.BulkAssets;
// client is an initialized OpenMetadataClient.
var dataProduct = "CustomerInsights";
var tables = new BulkAssets().withAssets(List.of(
new EntityReference()
.withId(UUID.fromString("5b3d9f0e-1c7a-4d2e-9a61-3f8e2b7c4d10"))
.withType("table")));
// Identify the data product by its name, which is also its fully qualified name, and each asset by its UUID.
// Add assets
var added = client.dataProducts().bulkAddAssets(dataProduct, tables);
System.out.println(added.getStatus());
// Remove assets
var removed = client.dataProducts().bulkRemoveAssets(dataProduct, tables);
// Add and remove input ports
client.dataProducts().bulkAddInputPorts(dataProduct, tables);
client.dataProducts().bulkRemoveInputPorts(dataProduct, tables);
// Add and remove output ports
client.dataProducts().bulkAddOutputPorts(dataProduct, tables);
client.dataProducts().bulkRemoveOutputPorts(dataProduct, tables);
# The path identifier is the data product's fully qualified name. URL-encode it if it contains spaces.
# Add assets
curl -X PUT "{base_url}/api/v1/dataProducts/CustomerInsights/assets/add" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"assets": [
{"id": "table-uuid-1", "type": "table"},
{"id": "topic-uuid-1", "type": "topic"}
]
}'
# Remove assets
curl -X PUT "{base_url}/api/v1/dataProducts/CustomerInsights/assets/remove" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"assets": [
{"id": "table-uuid-1", "type": "table"}
]
}'
{
"id": "b1839f98-f046-5f35-bdef-20f9b3395cb2",
"name": "CustomerInsights",
"fullyQualifiedName": "CustomerInsights",
"description": "Curated customer analytics data product",
"version": 0.3,
"updatedAt": 1769984330261,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/dataProducts/b1839f98-f046-5f35-bdef-20f9b3395cb2",
"domains": [
{
"id": "a0729e98-e946-4e25-acde-10e8a2294ba1",
"type": "domain",
"name": "Marketing",
"fullyQualifiedName": "Marketing",
"deleted": false
}
],
"deleted": false,
"owners": [],
"experts": []
}
Ports & Assets
Manage the input ports, output ports, and associated assets of a data product. These endpoints allow you to add or remove data assets from a data product without replacing the entire entity. An asset can be either an input port or an output port of a data product, not both. If every asset in the request is rejected, the request returns400. If only some are rejected, it returns 200 and lists each rejected asset with its reason in failedRequest. Ports must reference a data asset, so column-level entities such as tableColumn are rejected.
Add Assets
UsePUT /v1/dataProducts/{fqn}/assets/add to add assets to a data product.
string
required
Fully qualified name of the data product, such as
CustomerInsights.array
required
Remove Assets
UsePUT /v1/dataProducts/{fqn}/assets/remove to remove assets from a data product.
string
required
Fully qualified name of the data product, such as
CustomerInsights.array
required
PUT /v1/dataProducts/{fqn}/assets/add
from metadata.generated.schema.type.entityReference import EntityReference
from metadata.sdk import configure
from metadata.sdk.entities import DataProducts
configure(
host="https://your-company.getcollate.io/api",
jwt_token="your-jwt-token"
)
# Identify the data product by its name, which is also its fully qualified name, and each asset by its UUID.
# Add input ports
DataProducts.add_input_ports(
"CustomerInsights",
[EntityReference(id="table-uuid-1", type="table")]
)
# Remove input ports
DataProducts.remove_input_ports(
"CustomerInsights",
[EntityReference(id="table-uuid-1", type="table")]
)
# Add output ports
DataProducts.add_output_ports(
"CustomerInsights",
[EntityReference(id="dashboard-uuid-1", type="dashboard")]
)
# Remove output ports
DataProducts.remove_output_ports(
"CustomerInsights",
[EntityReference(id="dashboard-uuid-1", type="dashboard")]
)
# Add assets
DataProducts.add_assets(
"CustomerInsights",
[EntityReference(id="table-uuid-2", type="table")]
)
# Remove assets
DataProducts.remove_assets(
"CustomerInsights",
[EntityReference(id="table-uuid-2", type="table")]
)
import java.util.List;
import java.util.UUID;
import org.openmetadata.schema.type.EntityReference;
import org.openmetadata.schema.type.api.BulkAssets;
// client is an initialized OpenMetadataClient.
var dataProduct = "CustomerInsights";
var tables = new BulkAssets().withAssets(List.of(
new EntityReference()
.withId(UUID.fromString("5b3d9f0e-1c7a-4d2e-9a61-3f8e2b7c4d10"))
.withType("table")));
// Identify the data product by its name, which is also its fully qualified name, and each asset by its UUID.
// Add assets
var added = client.dataProducts().bulkAddAssets(dataProduct, tables);
System.out.println(added.getStatus());
// Remove assets
var removed = client.dataProducts().bulkRemoveAssets(dataProduct, tables);
// Add and remove input ports
client.dataProducts().bulkAddInputPorts(dataProduct, tables);
client.dataProducts().bulkRemoveInputPorts(dataProduct, tables);
// Add and remove output ports
client.dataProducts().bulkAddOutputPorts(dataProduct, tables);
client.dataProducts().bulkRemoveOutputPorts(dataProduct, tables);
# The path identifier is the data product's fully qualified name. URL-encode it if it contains spaces.
# Add assets
curl -X PUT "{base_url}/api/v1/dataProducts/CustomerInsights/assets/add" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"assets": [
{"id": "table-uuid-1", "type": "table"},
{"id": "topic-uuid-1", "type": "topic"}
]
}'
# Remove assets
curl -X PUT "{base_url}/api/v1/dataProducts/CustomerInsights/assets/remove" \
-H "Authorization: Bearer {access_token}" \
-H "Content-Type: application/json" \
-d '{
"assets": [
{"id": "table-uuid-1", "type": "table"}
]
}'
{
"id": "b1839f98-f046-5f35-bdef-20f9b3395cb2",
"name": "CustomerInsights",
"fullyQualifiedName": "CustomerInsights",
"description": "Curated customer analytics data product",
"version": 0.3,
"updatedAt": 1769984330261,
"updatedBy": "admin",
"href": "http://localhost:8585/api/v1/dataProducts/b1839f98-f046-5f35-bdef-20f9b3395cb2",
"domains": [
{
"id": "a0729e98-e946-4e25-acde-10e8a2294ba1",
"type": "domain",
"name": "Marketing",
"fullyQualifiedName": "Marketing",
"deleted": false
}
],
"deleted": false,
"owners": [],
"experts": []
}
Returns
Returns the updated data product object with the new version number reflecting the asset changes.Error Handling
| Code | Error Type | Description |
|---|---|---|
400 | BAD_REQUEST | Invalid request body, asset references, or every asset rejected (for example an asset already in the opposite port type) |
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to modify this data product |
404 | NOT_FOUND | Data product or referenced asset does not exist |
Was this page helpful?