orange-flag-48535
09/30/2022, 11:23 AMDataMap dataMap = new DataMap();
dataMap.put("entityType", "dataset");
dataMap.put("entityUrn", "urn:li:dataset:(urn:li:dataPlatform:myDp,myDB.myTable,DEV)");
dataMap.put("changeType", "UPSERT");
dataMap.put("aspectName", "status");
DataMap aspectMap = new DataMap();
DataMap aspectValueMap = new DataMap();
aspectValueMap.put("removed", true);
aspectMap.put("value", aspectValueMap);
aspectMap.put("contentType", "application/json");
dataMap.put("aspect", aspectMap);
MetadataChangeProposal mcp = new MetadataChangeProposal(dataMap);
RestEmitter client = RestEmitter.create(b -> b.server("<http://localhost:8080>"));
client.emit(mcp, callback);
My alternative would be to fallback to the OpenAPI endpoint (https://demo.datahubproject.io/openapi/swagger-ui/index.html#/Entities/deleteEntities), but I'd rather use RestEmitter and avoid doing raw Http myself. Thanks.mammoth-bear-12532
MetadataChangeProposalWrapper
class as shown here: https://datahubproject.io/docs/metadata-integration/java/as-a-library/#usageorange-flag-48535
10/03/2022, 9:44 AM