Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to engine host and new Automated Curation OMVS #8053

Merged
merged 3 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions open-metadata-distribution/omag-server-platform/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,16 @@ distributions {
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/framework-services/gaf-metadata-management" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/my-profile" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/automated-curation" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/asset-catalog" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/glossary-browser" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-implementation/view-services/glossary-workflow" }
{ include 'Egeria*.http' }
from { "$rootProject.projectDir/open-metadata-conformance-suite" }
{ include 'Egeria*.http' }
fileMode = 0755
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.odpi.openmetadata.frameworkservices.gaf.client.OpenMetadataClientBase;

/**
* OpenGovernanceClientBase provides an interface to the services that build, monitor and trigger governance actions.
* OpenGovernanceClient provides an interface to the services that build, monitor and trigger governance actions.
* This is part of the Governance Action Framework (GAF).
*/
public class OpenGovernanceClient extends OpenGovernanceClientBase
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/* SPDX-License-Identifier: Apache-2.0 */
/* Copyright Contributors to the ODPi Egeria project. */
package org.odpi.openmetadata.accessservices.governanceserver.client;

import org.odpi.openmetadata.adminservices.configuration.registration.AccessServiceDescription;
import org.odpi.openmetadata.frameworks.connectors.ffdc.InvalidParameterException;
import org.odpi.openmetadata.frameworkservices.gaf.client.OpenGovernanceClientBase;

/**
* OpenGovernanceClient provides an interface to the services that build, monitor and trigger governance actions.
* This is part of the Governance Action Framework (GAF).
*/
public class OpenGovernanceClient extends OpenGovernanceClientBase
{
private final static String serviceURLMarker = AccessServiceDescription.GOVERNANCE_SERVER_OMAS.getAccessServiceURLMarker();

/**
* Create a new client with no authentication embedded in the HTTP request.
*
* @param serverName name of the server to connect to
* @param serverPlatformURLRoot the network address of the server running the OMAS REST services
*
* @throws InvalidParameterException there is a problem creating the client-side components to issue any
* REST API calls.
*/
public OpenGovernanceClient(String serverName,
String serverPlatformURLRoot) throws InvalidParameterException
{
super(serviceURLMarker, serverName, serverPlatformURLRoot);
}


/**
* Create a new client that passes userId and password in each HTTP request. This is the
* userId/password of the calling server. The end user's userId is sent on each request.
*
* @param serverName name of the server to connect to
* @param serverPlatformURLRoot the network address of the server running the OMAS REST services
* @param serverUserId caller's userId embedded in all HTTP requests
* @param serverPassword caller's password embedded in all HTTP requests
*
* @throws InvalidParameterException there is a problem creating the client-side components to issue any
* REST API calls.
*/
public OpenGovernanceClient(String serverName,
String serverPlatformURLRoot,
String serverUserId,
String serverPassword) throws InvalidParameterException
{
super(serviceURLMarker, serverName, serverPlatformURLRoot, serverUserId, serverPassword);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public enum EngineServiceDescription
"event-action",
"Executes requested event action services to monitor, assess and maintain context events.",
"https://egeria-project.org/services/omes/event-action/overview/",
AccessServiceDescription.DATA_SCIENCE_OMAS.getAccessServiceFullName(),
AccessServiceDescription.GOVERNANCE_ENGINE_OMAS.getAccessServiceDescription(),
DeployedImplementationType.EVENT_ACTION_ENGINE.getAssociatedTypeName(),
DeployedImplementationType.EVENT_ACTION_SERVICE_CONNECTOR.getAssociatedTypeName(),
DeployedImplementationType.EVENT_ACTION_ENGINE.getDeployedImplementationType(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,25 @@ public enum ViewServiceDescription
* Build collections of asset and other metadata.
*/
COLLECTION_MANAGER (809,
ComponentDevelopmentStatus.TECHNICAL_PREVIEW,
ComponentDevelopmentStatus.IN_DEVELOPMENT,
"Collection Manager",
"Collection Manager OMVS",
"collection-manager",
"Build collections of asset and other metadata.",
"https://egeria-project.org/services/omvs/collection-manager/overview/",
AccessServiceDescription.DIGITAL_SERVICE_OMAS.getAccessServiceFullName()),

/**
* Manage Egeria's automation services.
*/
AUTOMATED_CURATION (809,
ComponentDevelopmentStatus.IN_DEVELOPMENT,
"Automated Curation",
"Automated Curation OMVS",
"automated-curation",
"Manage Egeria's automation services.",
"https://egeria-project.org/services/omvs/automated-curation/overview/",
AccessServiceDescription.ASSET_OWNER_OMAS.getAccessServiceFullName()),
;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ public AttributeTypeDefResponse getAttributeTypeDefByName(@PathVariable String
*/
@GetMapping(path = "/metadata-elements/{elementGUID}")

@Operation(summary="getMetadataElementByGUID",
description="Retrieve the metadata element using its unique identifier.",
externalDocs=@ExternalDocumentation(description="Further Information",
url="https://egeria-project.org/services/gaf-metadata-management/"))

public OpenMetadataElementResponse getMetadataElementByGUID(@PathVariable String serverName,
@PathVariable String serviceURLMarker,
@PathVariable String userId,
Expand Down Expand Up @@ -366,6 +371,11 @@ public OpenMetadataElementResponse getMetadataElementByGUID(@PathVariable String
*/
@PostMapping(path = "/metadata-elements/by-unique-name")

@Operation(summary="getMetadataElementByUniqueName",
description="Retrieve the metadata element using its unique name (typically the qualified name, but it is possible to specify a different property name in the request body as long as it is unique). If multiple matching instances are found, and exception is thrown.",
externalDocs=@ExternalDocumentation(description="Further Information",
url="https://egeria-project.org/services/gaf-metadata-management/"))

public OpenMetadataElementResponse getMetadataElementByUniqueName(@PathVariable String serverName,
@PathVariable String serviceURLMarker,
@PathVariable String userId,
Expand Down Expand Up @@ -396,6 +406,11 @@ public OpenMetadataElementResponse getMetadataElementByUniqueName(@PathVariable
*/
@PostMapping(path = "/metadata-elements/guid-by-unique-name")

@Operation(summary="getMetadataElementGUIDByUniqueName",
description="Retrieve the metadata element GUID using its unique name (typically the qualified name, but it is possible to specify a different property name in the request body as long as it is unique). If multiple matching instances are found, and exception is thrown.",
externalDocs=@ExternalDocumentation(description="Further Information",
url="https://egeria-project.org/services/gaf-metadata-management/"))

public GUIDResponse getMetadataElementGUIDByUniqueName(@PathVariable String serverName,
@PathVariable String serviceURLMarker,
@PathVariable String userId,
Expand Down Expand Up @@ -428,6 +443,11 @@ public GUIDResponse getMetadataElementGUIDByUniqueName(@PathVariable String
*/
@PostMapping(path = "/metadata-elements/by-search-string")

@Operation(summary="findMetadataElementsWithString",
description="Retrieve the metadata elements that contain the requested string.",
externalDocs=@ExternalDocumentation(description="Further Information",
url="https://egeria-project.org/services/gaf-metadata-management/"))

public OpenMetadataElementsResponse findMetadataElementsWithString(@PathVariable String serverName,
@PathVariable String serviceURLMarker,
@PathVariable String userId,
Expand Down Expand Up @@ -466,6 +486,11 @@ public OpenMetadataElementsResponse findMetadataElementsWithString(@PathVariable
*/
@GetMapping(path = "/related-elements/{elementGUID}/any-type")

@Operation(summary="getAllRelatedMetadataElements",
description="Retrieve the metadata elements connected to the supplied element.",
externalDocs=@ExternalDocumentation(description="Further Information",
url="https://egeria-project.org/services/gaf-metadata-management/"))

public RelatedMetadataElementListResponse getAllRelatedMetadataElements(@PathVariable String serverName,
@PathVariable String serviceURLMarker,
@PathVariable String userId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package org.odpi.openmetadata.governanceservers.dataengineproxy;

import io.swagger.v3.oas.annotations.ExternalDocumentation;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.odpi.openmetadata.governanceservers.dataengineproxy.model.ProcessLoadResponse;
import org.odpi.openmetadata.governanceservers.dataengineproxy.rest.DataEngineProxyRestService;
Expand All @@ -23,8 +24,15 @@ public class DataEngineProxyServicesResource {
DataEngineProxyRestService dataEngineProxyRestService = new DataEngineProxyRestService();

@GetMapping("/load")

@Operation(summary="load",
description="Force an explicit load of metadata from the connected Data Engine",
externalDocs=@ExternalDocumentation(description="Further Information",
url="https://egeria-project.org/concepts/data-engine-proxy/"))

public ProcessLoadResponse load(@PathVariable("serverName") String serverName,
@PathVariable("userId") String userId) {
@PathVariable("userId") String userId)
{
return dataEngineProxyRestService.load(serverName, userId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,16 @@ public enum EngineHostServicesAuditCode implements AuditLogMessageSet
"Review the error messages and resolve the cause of the problem. Once resolved, it is possible to " +
"retry the governance action by updating its status back to REQUESTED status."),

/**
* ENGINE-HOST-SERVICES-0035 - Failed to retrieve active engine actions. The exception was {0} with error message {1}
*/
ENGINE_ACTION_SCAN_FAILED("ENGINE-HOST-SERVICES-0035",
AuditLogRecordSeverityLevel.EXCEPTION,
"Failed to retrieve active engine actions. The exception was {0} with error message {1}",
"The engine host is unable to retrieve the active engine actions from the metadata access server as part of its regular scan for work.",
"Review the error messages and resolve the cause of the problem. Once resolved, the engine host should retry its scan as part of its normal refresh processing. " +
"However, if the problem was in hte engine host, you may need to restart it to clear the problem."),

/**
* ENGINE-HOST-SERVICES-0150 - {0} in server {1} is not configured with the platform URL root for the {2}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public GovernanceServerOutTopicListener(GovernanceEngineMap governanceEngineHand


/**
* Process an event that was published by the Governance Engine OMAS. The events cover all defined governance engines and actions.
* Process an event that was published by the Governance Server OMAS. The events cover all defined governance engines and actions.
* This method only needs to pass on the information to those governance engines hosted in this server.
* Events relating to other governance engines can be ignored. So can events that are for capabilities not supported by these engine
* services.
Expand All @@ -52,7 +52,28 @@ public void processEvent(GovernanceServerEvent event)

if (event != null)
{
if (event instanceof GovernanceServiceConfigurationEvent governanceServiceEvent)
if (event instanceof EngineActionEvent engineActionEvent)
{
GovernanceEngineHandler governanceEngineHandler = governanceEngineHandlers.getGovernanceEngineHandler(engineActionEvent.getGovernanceEngineName());

if (governanceEngineHandler != null)
{
try
{
governanceEngineHandler.executeEngineAction(engineActionEvent.getEngineActionGUID());
}
catch (Exception error)
{
auditLog.logException(actionDescription,
EngineHostServicesAuditCode.ENGINE_ACTION_FAILED.getMessageDefinition(engineActionEvent.getGovernanceEngineName(),
error.getClass().getName(),
error.getMessage()),
engineActionEvent.toString(),
error);
}
}
}
else if (event instanceof GovernanceServiceConfigurationEvent governanceServiceEvent)
{
GovernanceEngineHandler governanceEngineHandler = governanceEngineHandlers.getGovernanceEngineHandler(governanceServiceEvent.getGovernanceEngineName());

Expand Down Expand Up @@ -97,27 +118,6 @@ else if (event instanceof GovernanceEngineConfigurationEvent governanceEngineEve
}
}
}
else if (event instanceof EngineActionEvent engineActionEvent)
{
GovernanceEngineHandler governanceEngineHandler = governanceEngineHandlers.getGovernanceEngineHandler(engineActionEvent.getGovernanceEngineName());

if (governanceEngineHandler != null)
{
try
{
governanceEngineHandler.executeEngineAction(engineActionEvent.getEngineActionGUID());
}
catch (Exception error)
{
auditLog.logException(actionDescription,
EngineHostServicesAuditCode.ENGINE_ACTION_FAILED.getMessageDefinition(engineActionEvent.getGovernanceEngineName(),
error.getClass().getName(),
error.getMessage()),
engineActionEvent.toString(),
error);
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.odpi.openmetadata.accessservices.governanceserver.client.GovernanceContextClient;
import org.odpi.openmetadata.accessservices.governanceserver.client.GovernanceEngineConfigurationClient;
import org.odpi.openmetadata.accessservices.governanceserver.client.GovernanceServerEventClient;
import org.odpi.openmetadata.accessservices.governanceserver.client.OpenGovernanceClient;
import org.odpi.openmetadata.adminservices.configuration.properties.EngineHostServicesConfig;
import org.odpi.openmetadata.adminservices.configuration.properties.EngineServiceConfig;
import org.odpi.openmetadata.adminservices.configuration.registration.*;
Expand Down Expand Up @@ -127,13 +128,16 @@ else if (((configuration.getEngineList() == null) || (configuration.getEngineLis
* clients.
*/
GAFRESTClient restClient;
OpenGovernanceClient openGovernanceClient;
if (localServerPassword == null)
{
restClient = new GAFRESTClient(accessServiceServerName, accessServiceRootURL, auditLog);
openGovernanceClient = new OpenGovernanceClient(accessServiceServerName, accessServiceRootURL);
}
else
{
restClient = new GAFRESTClient(accessServiceServerName, accessServiceRootURL, localServerUserId, localServerUserId, auditLog);
openGovernanceClient = new OpenGovernanceClient(accessServiceServerName, accessServiceRootURL, localServerUserId, localServerUserId);
}

/*
Expand Down Expand Up @@ -163,6 +167,8 @@ else if (((configuration.getEngineList() == null) || (configuration.getEngineLis
restClient,
maxPageSize);



/*
* Initialize each of the integration services and accumulate the integration connector handlers for the
* integration daemon handler.
Expand Down Expand Up @@ -220,6 +226,7 @@ else if (((configuration.getEngineList() == null) || (configuration.getEngineLis
*/
EngineConfigurationRefreshThread configurationRefreshThread = new EngineConfigurationRefreshThread(governanceEngineHandlers,
eventClient,
openGovernanceClient,
auditLog,
localServerUserId,
localServerName,
Expand Down
Loading
Loading