mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-13 17:58:36 +00:00
GEN-2891 - Add ingestion agent relationship to service entities (#19946)
* GEN-2891 - Add ingestion agent relationship to service entities * Revert relationship storing * Centralize ingestion entity relationship logic * Add default implementation * Change relationship type
This commit is contained in:
parent
36f939af5f
commit
fc90a13e08
@ -159,7 +159,7 @@ public class IngestionPipelineRepository extends EntityRepository<IngestionPipel
|
||||
ingestionPipeline.getIngestionAgent().getId(),
|
||||
entityType,
|
||||
ingestionPipeline.getIngestionAgent().getType(),
|
||||
Relationship.HAS);
|
||||
Relationship.USES);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@ import org.openmetadata.schema.ServiceEntityInterface;
|
||||
import org.openmetadata.schema.entity.services.ServiceType;
|
||||
import org.openmetadata.schema.entity.services.connections.TestConnectionResult;
|
||||
import org.openmetadata.schema.type.Include;
|
||||
import org.openmetadata.schema.type.Relationship;
|
||||
import org.openmetadata.service.secrets.SecretsManager;
|
||||
import org.openmetadata.service.secrets.SecretsManagerFactory;
|
||||
import org.openmetadata.service.util.EntityUtil;
|
||||
@ -81,7 +82,18 @@ public abstract class ServiceEntityRepository<
|
||||
|
||||
@Override
|
||||
public void storeRelationships(T service) {
|
||||
// No relationships to store beyond what is stored in the super class
|
||||
addIngestionAgentRelationship(service);
|
||||
}
|
||||
|
||||
private void addIngestionAgentRelationship(T service) {
|
||||
if (service.getIngestionAgent() != null) {
|
||||
addRelationship(
|
||||
service.getId(),
|
||||
service.getIngestionAgent().getId(),
|
||||
entityType,
|
||||
service.getIngestionAgent().getType(),
|
||||
Relationship.USES);
|
||||
}
|
||||
}
|
||||
|
||||
public T addTestConnectionResult(UUID serviceId, TestConnectionResult testConnectionResult) {
|
||||
|
@ -32,4 +32,8 @@ public interface ServiceEntityInterface extends EntityInterface {
|
||||
void setTestConnectionResult(TestConnectionResult testConnectionResult);
|
||||
|
||||
EnumInterface getServiceType();
|
||||
|
||||
default EntityReference getIngestionAgent() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -133,6 +133,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the API service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -232,6 +232,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the Dashboard service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -435,6 +435,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the Database service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -151,6 +151,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the Messaging service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -154,6 +154,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the asset belongs to. When not set, the asset inherits the domain from the parent it belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -149,6 +149,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the MLModel service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -248,6 +248,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the Pipeline service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
|
@ -143,6 +143,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the search service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -150,6 +150,10 @@
|
||||
"domain" : {
|
||||
"description": "Domain the Storage service belongs to.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
},
|
||||
"ingestionAgent" : {
|
||||
"description": "The ingestion agent responsible for executing the ingestion pipeline.",
|
||||
"$ref": "../../type/entityReference.json"
|
||||
}
|
||||
},
|
||||
"required": ["id", "name", "serviceType"],
|
||||
|
@ -56,6 +56,10 @@ export interface APIService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this API service.
|
||||
*/
|
||||
@ -189,6 +193,8 @@ export enum RESTType {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the API service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
@ -55,6 +55,10 @@ export interface DashboardService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this dashboard service.
|
||||
*/
|
||||
@ -1185,6 +1189,8 @@ export enum DashboardServiceType {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the Dashboard service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
@ -57,6 +57,10 @@ export interface DatabaseService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this database service.
|
||||
*/
|
||||
@ -1986,6 +1990,8 @@ export enum VerifySSL {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the Database service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
@ -56,6 +56,10 @@ export interface MessagingService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this messaging service.
|
||||
*/
|
||||
@ -363,6 +367,8 @@ export enum MessagingServiceType {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the Messaging service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
@ -52,6 +52,10 @@ export interface MetadataService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this database service.
|
||||
*/
|
||||
@ -852,6 +856,8 @@ export enum VerifySSL {
|
||||
* example, a table has an attribute called database of type EntityReference that captures
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*
|
||||
* Owners of this database service.
|
||||
*
|
||||
* This schema defines the EntityReferenceList type used for referencing an entity.
|
||||
|
@ -56,6 +56,10 @@ export interface MlmodelService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this pipeline service.
|
||||
*/
|
||||
@ -382,6 +386,8 @@ export enum MlModelServiceType {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the MLModel service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
@ -56,6 +56,10 @@ export interface PipelineService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this pipeline service.
|
||||
*/
|
||||
@ -880,6 +884,8 @@ export enum VerifySSL {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the Pipeline service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
@ -55,6 +55,10 @@ export interface SearchService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this search service.
|
||||
*/
|
||||
@ -321,6 +325,8 @@ export enum SearchServiceType {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the search service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
@ -55,6 +55,10 @@ export interface StorageService {
|
||||
* Change that lead to this version of the entity.
|
||||
*/
|
||||
incrementalChangeDescription?: ChangeDescription;
|
||||
/**
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
ingestionAgent?: EntityReference;
|
||||
/**
|
||||
* Name that identifies this storage service.
|
||||
*/
|
||||
@ -405,6 +409,8 @@ export enum StorageServiceType {
|
||||
* the relationship of a table `belongs to a` database.
|
||||
*
|
||||
* Domain the Storage service belongs to.
|
||||
*
|
||||
* The ingestion agent responsible for executing the ingestion pipeline.
|
||||
*/
|
||||
export interface EntityReference {
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user