Class GovernanceEngineRESTServices

java.lang.Object
org.odpi.openmetadata.tokencontroller.TokenController
org.odpi.openmetadata.viewservices.governanceengine.server.GovernanceEngineRESTServices

public class GovernanceEngineRESTServices extends TokenController
The GovernanceEngineRESTServices provides the server-side implementation of the Governance Engine Open Metadata View Service (OMVS). It is for governance engines that run outside of Egeria's engine hosts. They pick up the engine actions that are approved to run on them, run them, and report their progress and completion. Egeria then coordinates the engine actions, for example by starting the next steps of a governance action process. These are the same calls that Egeria's engine hosts make (see GovernanceCompletionInterface).
  • Constructor Details

    • GovernanceEngineRESTServices

      public GovernanceEngineRESTServices()
      Default constructor
  • Method Details

    • getApprovedEngineActions

      public EngineActionElementsResponse getApprovedEngineActions(String serverName, String governanceEngineGUID, int startFrom, int pageSize)
      Retrieve the engine actions that are approved to run on a governance engine and that no engine has claimed yet. The caller then claims the ones it is going to run.
      Parameters:
      serverName - name of server instance to route request to
      governanceEngineGUID - unique identifier of governance engine
      startFrom - starting from position
      pageSize - maximum elements to return
      Returns:
      list of engine action elements or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException the user is not authorized to issue this request. PropertyServerException there was a problem detected by the metadata store.
    • claimEngineAction

      public VoidResponse claimEngineAction(String serverName, String engineActionGUID)
      Request that execution of an engine action is allocated to the caller. This is only permitted if no other caller has claimed it.
      Parameters:
      serverName - name of server instance to route request to
      engineActionGUID - identifier of the engine action request
      Returns:
      void or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException the user is not authorized to issue this request. PropertyServerException there was a problem detected by the metadata store.
    • getActiveClaimedEngineActions

      public EngineActionElementsResponse getActiveClaimedEngineActions(String serverName, String governanceEngineGUID, int startFrom, int pageSize)
      Retrieve the engine actions that are still in process and that have been claimed by this caller's userId. This call is used when the caller restarts.
      Parameters:
      serverName - name of server instance to route request to
      governanceEngineGUID - unique identifier of governance engine
      startFrom - starting from position
      pageSize - maximum elements to return
      Returns:
      list of engine action elements or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException the user is not authorized to issue this request. PropertyServerException there was a problem detected by the metadata store.
    • updateEngineActionStatus

      public VoidResponse updateEngineActionStatus(String serverName, String engineActionGUID, EngineActionStatusRequestBody requestBody)
      Update the status of the engine action - providing the caller is permitted.
      Parameters:
      serverName - name of server instance to route request to
      engineActionGUID - identifier of the engine action request
      requestBody - new status enum
      Returns:
      void or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException the user is not authorized to issue this request. PropertyServerException there was a problem detected by the metadata store.
    • updateActionTargetStatus

      public VoidResponse updateActionTargetStatus(String serverName, ActionTargetStatusRequestBody requestBody)
      Update the status of a specific action target. By default, these values are derived from the values for the engine action. However, if the governance service has to process many target elements, then setting the status on each individual target will show the progress of the governance service.
      Parameters:
      serverName - name of server instance to route request to
      requestBody - the action target and its new status
      Returns:
      void or InvalidParameterException the action target GUID is not recognized. UserNotAuthorizedException the user is not authorized to issue this request. PropertyServerException there was a problem detected by the metadata store.
    • recordCompletionStatus

      public VoidResponse recordCompletionStatus(String serverName, String engineActionGUID, CompletionStatusRequestBody requestBody)
      Declare that all the processing for the engine action is finished and the status of the work. If the engine action is part of a governance action process, the output guards determine which steps of the process run next.
      Parameters:
      serverName - name of server instance to route request to
      engineActionGUID - unique identifier of the associated engine action
      requestBody - completion status, output guards, new action targets and completion message
      Returns:
      void or InvalidParameterException the completion status is null. UserNotAuthorizedException the user is not authorized to issue this request. PropertyServerException there was a problem detected by the metadata store.