Skip to content

Commit

Permalink
Merge pull request #8435 from mandy-chessell/oak2024
Browse files Browse the repository at this point in the history
Sort out anchors and metadata collections for UC assets
  • Loading branch information
mandy-chessell authored Oct 8, 2024
2 parents 30ebd89 + 20a6cdd commit b3a6287
Show file tree
Hide file tree
Showing 11 changed files with 1,419 additions and 78 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,130 @@ content-packs/UnityCatalogContentPack.omarchive
@ucTableTemplateGUID=6cc1e5f5-4c1e-4290-a80e-e06643ffb13d
@ucFunctionTemplateGUID=a490ba65-6104-4213-9be9-524e16fed8aa

###
# @name initiateGovernanceActionProcess (create and survey)
# Using the named governance action process as a template, initiate a chain of engine actions.

POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/governance-action-processes/initiate
Authorization: Bearer {{token}}
Content-Type: application/json

{
"processQualifiedName": "UnityCatalogServer:CreateAndSurveyGovernanceActionProcess",
"requestParameters" : {
"hostURL" : "http://localhost",
"portNumber" : "8080",
"serverName" : "Unity Catalog 1",
"versionIdentifier" : "V1.0",
"description" : "First instance of the Unity Catalog (UC) Server.",
"serverUserId" : "uc1"
}
}


###
# @name initiateGovernanceActionProcess (create and catalog)
# Using the named governance action process as a template, initiate a chain of engine actions.

POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/governance-action-processes/initiate
Authorization: Bearer {{token}}
Content-Type: application/json

{
"processQualifiedName": "UnityCatalogServer:CreateAndCatalogGovernanceActionProcess",
"requestParameters" : {
"hostURL" : "http://localhost",
"portNumber" : "8080",
"serverName" : "Unity Catalog 1",
"versionIdentifier" : "V1.0",
"description" : "First instance of the Unity Catalog (UC) Server.",
"serverUserId" : "uc1"
}
}



###
# @name getTechnologyTypeElements (UC Server)
# Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed in the name.
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/technology-types/elements?startFrom=0&pageSize=10&getTemplates=false
Authorization: Bearer {{token}}
Content-Type: application/json

{
"filter" : "Unity Catalog Server"
}



###
# @name getTechnologyTypeElements (UC Catalog)
# Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed in the name.
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/technology-types/elements?startFrom=0&pageSize=10&getTemplates=false
Authorization: Bearer {{token}}
Content-Type: application/json

{
"filter" : "Unity Catalog Catalog"
}



###
# @name getTechnologyTypeElements (UC Schema)
# Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed in the name.
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/technology-types/elements?startFrom=0&pageSize=10&getTemplates=false
Authorization: Bearer {{token}}
Content-Type: application/json

{
"filter" : "Unity Catalog Schema"
}




###
# @name getTechnologyTypeElements (UC Volume)
# Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed in the name.
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/technology-types/elements?startFrom=0&pageSize=10&getTemplates=false
Authorization: Bearer {{token}}
Content-Type: application/json

{
"filter" : "Unity Catalog Volume"
}




###
# @name getTechnologyTypeElements (UC Table)
# Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed in the name.
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/technology-types/elements?startFrom=0&pageSize=10&getTemplates=false
Authorization: Bearer {{token}}
Content-Type: application/json

{
"filter" : "Unity Catalog Table"
}




###
# @name getTechnologyTypeElements (UC Function)
# Retrieve the elements for the requested deployed implementation type. There are no wildcards allowed in the name.
POST {{baseURL}}/servers/{{viewServer}}/api/open-metadata/automated-curation/technology-types/elements?startFrom=0&pageSize=10&getTemplates=false
Authorization: Bearer {{token}}
Content-Type: application/json

{
"filter" : "Unity Catalog Function"
}



###
# =====================================================================================================================
# Create a server asset for Unity Catalog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public abstract class OSSUnityCatalogInsideCatalogSyncBase
protected final String connectorName;
protected final CatalogIntegratorContext context;
protected final String catalogGUID;
protected final String catalogQualifiedName;
protected final String catalogName;
protected final String catalogTargetName;
protected final PermittedSynchronization targetPermittedSynchronization;
protected final OSSUnityCatalogResourceConnector ucConnector;
protected final String ucServerEndpoint;
Expand All @@ -64,9 +64,9 @@ public abstract class OSSUnityCatalogInsideCatalogSyncBase
*
* @param connectorName name of this connector
* @param context context for the connector
* @param catalogTargetName the catalog target name
* @param catalogName the catalog target name
* @param catalogGUID guid of the catalog
* @param catalogName name of the catalog
* @param catalogQualifiedName name of the catalog
* @param ucFullNameToEgeriaGUID map of full names from UC to the GUID of the entity in Egeria.
* @param targetPermittedSynchronization the policy that controls the direction of metadata exchange
* @param ucConnector connector for accessing UC
Expand All @@ -80,9 +80,9 @@ public abstract class OSSUnityCatalogInsideCatalogSyncBase
*/
public OSSUnityCatalogInsideCatalogSyncBase(String connectorName,
CatalogIntegratorContext context,
String catalogTargetName,
String catalogName,
String catalogGUID,
String catalogName,
String catalogQualifiedName,
Map<String, String> ucFullNameToEgeriaGUID,
PermittedSynchronization targetPermittedSynchronization,
OSSUnityCatalogResourceConnector ucConnector,
Expand All @@ -96,9 +96,9 @@ public OSSUnityCatalogInsideCatalogSyncBase(String
{
this.connectorName = connectorName;
this.context = context;
this.catalogTargetName = catalogTargetName;
this.catalogGUID = catalogGUID;
this.catalogName = catalogName;
this.catalogGUID = catalogGUID;
this.catalogQualifiedName = catalogQualifiedName;
this.ucFullNameToEgeriaGUID = ucFullNameToEgeriaGUID;
this.targetPermittedSynchronization = targetPermittedSynchronization;
this.ucConnector = ucConnector;
Expand Down Expand Up @@ -212,7 +212,7 @@ protected void deleteElementInEgeria(MemberElement memberElement) throws Invalid
PropertyServerException,
UserNotAuthorizedException
{
openMetadataAccess.deleteMetadataElementInStore(memberElement.getElement().getElementGUID());
openMetadataAccess.deleteMetadataElementInStore(catalogGUID, catalogQualifiedName, memberElement.getElement().getElementGUID());
}


Expand Down Expand Up @@ -299,7 +299,7 @@ protected void addPropertyFacet(String parentGUID,
fullFacetProperties);

openMetadataAccess.createMetadataElementInStore(catalogGUID,
catalogName,
catalogQualifiedName,
OpenMetadataType.PROPERTY_FACET.typeName,
ElementStatus.ACTIVE,
null,
Expand Down Expand Up @@ -375,7 +375,7 @@ protected String getUCCatalogFromMember(MemberElement memberElement)

ElementProperties elementProperties = memberElement.getElement().getElementProperties();

String fullName = propertyHelper.getStringProperty(catalogTargetName,
String fullName = propertyHelper.getStringProperty(catalogName,
OpenMetadataProperty.RESOURCE_NAME.name,
elementProperties,
methodName);
Expand All @@ -396,7 +396,7 @@ protected String getUCSchemaFromMember(MemberElement memberElement)

ElementProperties elementProperties = memberElement.getElement().getElementProperties();

String fullName = propertyHelper.getStringProperty(catalogTargetName,
String fullName = propertyHelper.getStringProperty(catalogName,
OpenMetadataProperty.RESOURCE_NAME.name,
elementProperties,
methodName);
Expand All @@ -418,7 +418,7 @@ protected String getUCNameFromMember(MemberElement memberElement)

ElementProperties elementProperties = memberElement.getElement().getElementProperties();

String fullName = propertyHelper.getStringProperty(catalogTargetName,
String fullName = propertyHelper.getStringProperty(catalogName,
OpenMetadataProperty.RESOURCE_NAME.name,
elementProperties,
methodName);
Expand All @@ -439,7 +439,7 @@ protected String getUCCommentFomMember(MemberElement memberElement)

ElementProperties elementProperties = memberElement.getElement().getElementProperties();

return propertyHelper.getStringProperty(catalogTargetName,
return propertyHelper.getStringProperty(catalogName,
OpenMetadataProperty.DESCRIPTION.name,
elementProperties,
methodName);
Expand All @@ -458,10 +458,10 @@ protected Map<String, String> getUCPropertiesFomMember(MemberElement memberEleme

ElementProperties elementProperties = memberElement.getElement().getElementProperties();

return propertyHelper.getStringMapFromProperty(catalogTargetName,
return propertyHelper.getStringMapFromProperty(catalogName,
OpenMetadataProperty.ADDITIONAL_PROPERTIES.name,
elementProperties,
methodName);
methodName);
}


Expand Down
Loading

0 comments on commit b3a6287

Please sign in to comment.