Class DiscoveryMetadataStoreResource

java.lang.Object
org.odpi.openmetadata.accessservices.discoveryengine.server.spring.DiscoveryMetadataStoreResource

@RestController @RequestMapping("/servers/{serverName}/open-metadata/access-services/discovery-engine/users/{userId}") public class DiscoveryMetadataStoreResource extends Object
DiscoveryMetadataStoreResource provides the generic server-side interface for the Discovery Engine Open Metadata Access Service (OMAS). This provides the support for the AssetCatalogStore, AssetStore and AnnotationsStore defined in the ODF.
  • Constructor Details

    • DiscoveryMetadataStoreResource

      public DiscoveryMetadataStoreResource()
      Default constructor
  • Method Details

    • getAssets

      @GetMapping(path="/assets") public GUIDListResponse getAssets(@PathVariable String serverName, @PathVariable String userId, @RequestParam int startFrom, @RequestParam int pageSize)
      Return the next set of assets to process.
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      startFrom - starting point of the query
      pageSize - maximum number of results to return
      Returns:
      list of unique identifiers for located assets or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • getAssetsByQualifiedName

      @PostMapping(path="/assets/by-qualified-name") public GUIDListResponse getAssetsByQualifiedName(@PathVariable String serverName, @PathVariable String userId, @RequestBody String name, @RequestParam int startFrom, @RequestParam int pageSize)
      Return the assets with the same qualified name. If all is well there should be only one returned.
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      name - the qualified name to query on
      startFrom - place to start in query
      pageSize - number of results to return
      Returns:
      list of unique identifiers for matching assets or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • getAssetsByName

      @PostMapping(path="/assets/by-name") public GUIDListResponse getAssetsByName(@PathVariable String serverName, @PathVariable String userId, @RequestBody String name, @RequestParam int startFrom, @RequestParam int pageSize)
      Return the list of matching assets that have the supplied name as either the qualified name or display name. This is an exact match retrieval.
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      name - name to query for
      startFrom - place to start in query
      pageSize - number of results to return
      Returns:
      list of unique identifiers for matching assets or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • findAssets

      @PostMapping(path="/assets/by-search-string") public GUIDListResponse findAssets(@PathVariable String serverName, @PathVariable String userId, @RequestBody String searchString, @RequestParam int startFrom, @RequestParam int pageSize)
      Return a list of assets with the requested search string in their name, qualified name or description. The search string is interpreted as a regular expression (RegEx).
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      searchString - string to search for in text
      startFrom - starting element (used in paging through large result sets)
      pageSize - maximum number of results to return
      Returns:
      list of assets that match the search string or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • findAssetsByEndpoint

      @PostMapping(path="/assets/by-endpoint-address") public GUIDListResponse findAssetsByEndpoint(@PathVariable String serverName, @PathVariable String userId, @RequestBody String networkAddress, @RequestParam int startFrom, @RequestParam int pageSize)
      Return the list of assets that have the same endpoint address.
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      networkAddress - address to query on
      startFrom - place to start in query
      pageSize - number of results to return
      Returns:
      list of unique identifiers for matching assets or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • logAssetAuditMessage

      @PostMapping(path="/assets/{assetGUID}/log-records/{discoveryService}") public VoidResponse logAssetAuditMessage(@PathVariable String serverName, @PathVariable String userId, @PathVariable String assetGUID, @PathVariable String discoveryService, @RequestBody String message)
      Log an audit message about this asset.
      Parameters:
      serverName - name of server instance to route request to
      userId - userId of user making request.
      assetGUID - unique identifier for asset.
      discoveryService - unique name for discoveryService.
      message - message to log
      Returns:
      void or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • createDiscoveryAnalysisReport

      @PostMapping(path="/assets/{assetGUID}/discovery-analysis-reports") public GUIDResponse createDiscoveryAnalysisReport(@PathVariable String serverName, @PathVariable String userId, @PathVariable String assetGUID, @RequestBody DiscoveryAnalysisReportRequestBody requestBody)
      Create a new discovery analysis report and chain it to its asset, discovery engine and discovery service.
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      assetGUID - unique identifier of the asset being analysed
      requestBody - all the other parameters
      Returns:
      the unique identifier of the new discovery report or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to access the asset and/or report or PropertyServerException there was a problem in the store whether the asset/report properties are kept.
    • updateDiscoveryAnalysisReport

      @PostMapping(path="/discovery-analysis-reports/{discoveryReportGUID}") public VoidResponse updateDiscoveryAnalysisReport(@PathVariable String serverName, @PathVariable String userId, @PathVariable String discoveryReportGUID, @RequestBody DiscoveryAnalysisReport requestBody)
      Update the properties of the discovery analysis report.
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      discoveryReportGUID - unique identifier of the report to update
      requestBody - updated report - this will replace what was previous stored
      Returns:
      the new values stored in the repository or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • getDiscoveryReport

      @GetMapping(path="/discovery-analysis-reports/{discoveryReportGUID}") public DiscoveryAnalysisReportResponse getDiscoveryReport(@PathVariable String serverName, @PathVariable String userId, @PathVariable String discoveryReportGUID)
      Request the discovery report for a discovery request that has completed.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      discoveryReportGUID - identifier of the discovery request.
      Returns:
      discovery report or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • getTypesOfAnnotation

      @GetMapping(path="/annotations/sub-types") public NameListResponse getTypesOfAnnotation(@PathVariable String serverName, @PathVariable String userId)
      Return the annotation subtype names.
      Parameters:
      serverName - name of the server instance to connect to
      userId - calling user
      Returns:
      list of type names that are subtypes of annotation or throws InvalidParameterException full path or userId is null or throws PropertyServerException problem accessing property server or throws UserNotAuthorizedException security access problem.
    • getTypesOfAnnotationWithDescriptions

      @GetMapping(path="/annotations/sub-types/descriptions") public StringMapResponse getTypesOfAnnotationWithDescriptions(@PathVariable String serverName, @PathVariable String userId)
      Return the annotation subtype names mapped to their descriptions.
      Parameters:
      serverName - name of the server instance to connect to
      userId - calling user
      Returns:
      list of type names that are subtypes of annotation or throws InvalidParameterException full path or userId is null or throws PropertyServerException problem accessing property server or throws UserNotAuthorizedException security access problem.
    • getAnnotationsForAssetByStatus

      @GetMapping(path="/assets/{assetGUID}/annotations") public AnnotationListResponse getAnnotationsForAssetByStatus(@PathVariable String serverName, @PathVariable String userId, @PathVariable String assetGUID, @RequestParam int startingFrom, @RequestParam int maximumResults, @RequestBody StatusRequestBody requestBody)
      Return the list of annotations from previous runs of the discovery service that are set to a specific status. If status is null then annotations that have been reviewed, approved and/or actioned are returned from discovery reports that are not waiting or in progress.
      Parameters:
      serverName - name of server instance to route request to
      userId - calling user
      assetGUID - unique identifier of the asset
      startingFrom - starting position in the list.
      maximumResults - maximum number of elements that can be returned
      requestBody - status value to use on the query
      Returns:
      list of annotation (or null if none are registered) or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem retrieving annotations from the annotation store.
    • getDiscoveryReportAnnotations

      @GetMapping(path="/discovery-analysis-reports/{discoveryReportGUID}/annotations") public AnnotationListResponse getDiscoveryReportAnnotations(@PathVariable String serverName, @PathVariable String userId, @PathVariable String discoveryReportGUID, @RequestParam int startingFrom, @RequestParam int maximumResults)
      Return the annotations linked directly to the report.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      discoveryReportGUID - identifier of the discovery request.
      startingFrom - initial position in the stored list.
      maximumResults - maximum number of definitions to return on this call.
      Returns:
      list of annotations or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • getExtendedAnnotations

      @GetMapping(path="/annotations/{annotationGUID}/extended-annotations") public AnnotationListResponse getExtendedAnnotations(@PathVariable String serverName, @PathVariable String userId, @PathVariable String annotationGUID, @RequestParam int startingFrom, @RequestParam int maximumResults)
      Return any annotations attached to this annotation.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      annotationGUID - parent annotation
      startingFrom - starting position in the list
      maximumResults - maximum number of annotations that can be returned.
      Returns:
      list of Annotation objects or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • getAnnotation

      @GetMapping(path="/annotations/{annotationGUID}") public AnnotationResponse getAnnotation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String annotationGUID)
      Retrieve a single annotation by unique identifier. This call is typically used to retrieve the latest values for an annotation.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      annotationGUID - unique identifier of the annotation
      Returns:
      Annotation object or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • addAnnotationToDiscoveryReport

      @PostMapping(path="/discovery-analysis-reports/{discoveryReportGUID}/annotations") public GUIDResponse addAnnotationToDiscoveryReport(@PathVariable String serverName, @PathVariable String userId, @PathVariable String discoveryReportGUID, @RequestBody Annotation requestBody)
      Add a new annotation to the annotation store as a top level annotation linked directly off of the report.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      discoveryReportGUID - unique identifier of the discovery analysis report
      requestBody - annotation object
      Returns:
      unique identifier of new annotation or InvalidParameterException the annotation is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem retrieving adding the annotation to the annotation store.
    • addAnnotationToAnnotation

      @PostMapping(path="/annotations/{parentAnnotationGUID}/extended-annotations") public GUIDResponse addAnnotationToAnnotation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String parentAnnotationGUID, @RequestBody Annotation requestBody)
      Add a new annotation and link it to an existing annotation.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      parentAnnotationGUID - unique identifier of the annotation that this new one os to be attached to
      requestBody - annotation object
      Returns:
      unique identifier of new annotation or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem saving annotations in the annotation store.
    • updateAnnotation

      @PostMapping(path="/annotations/{annotationGUID}/update") public VoidResponse updateAnnotation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String annotationGUID, @RequestBody Annotation requestBody)
      Replace the current properties of an annotation.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      annotationGUID - identifier of the annotation to change
      requestBody - new properties
      Returns:
      fully filled out annotation or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem updating the annotation in the annotation store.
    • deleteAnnotation

      @PostMapping(path="/annotations/{annotationGUID}/delete") public VoidResponse deleteAnnotation(@PathVariable String serverName, @PathVariable String userId, @PathVariable String annotationGUID, @RequestBody(required=false) NullRequestBody requestBody)
      Remove an annotation from the annotation store.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      annotationGUID - unique identifier of the annotation
      requestBody - null request body to satisfy POST semantics
      Returns:
      void or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem deleting the annotation from the annotation store.
    • getPreviousDataFieldsForAsset

      @GetMapping(path="/discovery-analysis-reports/{discoveryReportGUID}/data-fields/previous") public DataFieldListResponse getPreviousDataFieldsForAsset(@PathVariable String serverName, @PathVariable String userId, @PathVariable String discoveryReportGUID, @RequestParam int startingFrom, @RequestParam int maximumResults)
      Return the list of data fields from previous runs of the discovery service.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      discoveryReportGUID - unique identifier of the discovery analysis report
      startingFrom - starting position in the list.
      maximumResults - maximum number of elements that can be returned
      Returns:
      list of data fields (or null if none are registered) or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem retrieving data fields from the annotation store.
    • getNewDataFieldsForAsset

      @GetMapping(path="/discovery-analysis-reports/{discoveryReportGUID}/data-fields") public DataFieldListResponse getNewDataFieldsForAsset(@PathVariable String serverName, @PathVariable String userId, @PathVariable String discoveryReportGUID, @RequestParam int startingFrom, @RequestParam int maximumResults)
      Return the current list of data fields for this discovery run.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      discoveryReportGUID - unique identifier of the discovery analysis report
      startingFrom - starting position in the list.
      maximumResults - maximum number of elements that can be returned
      Returns:
      list of data fields (or null if none are registered) or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem retrieving data fields from the annotation store.
    • getNestedDataFields

      @GetMapping(path="/data-fields/{parentDataFieldGUID}/nested-data-fields") public DataFieldListResponse getNestedDataFields(@PathVariable String serverName, @PathVariable String userId, @PathVariable String parentDataFieldGUID, @RequestParam int startingFrom, @RequestParam int maximumResults)
      Return any child data fields attached to this data field.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      parentDataFieldGUID - parent data field identifier
      startingFrom - starting position in the list
      maximumResults - maximum number of data fields that can be returned.
      Returns:
      list of DataField objects or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • geLinkedDataFields

      @GetMapping(path="/data-fields/{dataFieldGUID}/linked-data-fields") public RelatedDataFieldListResponse geLinkedDataFields(@PathVariable String serverName, @PathVariable String userId, @PathVariable String dataFieldGUID, @RequestParam int startingFrom, @RequestParam int maximumResults)
      Return any peer data fields attached to this data field.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      dataFieldGUID - starting data field identifier
      startingFrom - starting position in the list
      maximumResults - maximum number of data fields that can be returned.
      Returns:
      list of DataField objects or InvalidParameterException one of the parameters is null or invalid. UserNotAuthorizedException user not authorized to issue this request. PropertyServerException there was a problem that occurred within the property server.
    • getDataField

      @GetMapping(path="/data-fields/{dataFieldGUID}") public DataFieldResponse getDataField(@PathVariable String serverName, @PathVariable String userId, @PathVariable String dataFieldGUID)
      Return a specific data field stored in the annotation store (previous or new).
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      dataFieldGUID - unique identifier of the data field
      Returns:
      data field object or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem retrieving the data field from the annotation store.
    • addDataFieldToDiscoveryReport

      @PostMapping(path="/annotations/{annotationGUID}/data-fields") public GUIDResponse addDataFieldToDiscoveryReport(@PathVariable String serverName, @PathVariable String userId, @PathVariable String annotationGUID, @RequestBody DataField dataField)
      Add a new data field to the Annotation store linked off of an annotation (typically SchemaAnalysisAnnotation).
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      annotationGUID - unique identifier of the annotation that the data field is to be linked to
      dataField - dataField object
      Returns:
      unique identifier of new data field or InvalidParameterException the dataField is invalid or the annotation GUID points to an annotation that can not be associated with a data field. UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem adding the data field to the Annotation store.
    • addDataFieldToDataField

      @PostMapping(path="/data-fields/{parentDataFieldGUID}/nested-data-fields") public GUIDResponse addDataFieldToDataField(@PathVariable String serverName, @PathVariable String userId, @PathVariable String parentDataFieldGUID, @RequestBody DataField dataField)
      Add a new data field and link it to an existing data field.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      parentDataFieldGUID - unique identifier of the data field that this new one is to be attached to
      dataField - data field object
      Returns:
      unique identifier of new data field or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem saving data fields in the annotation store.
    • linkDataFields

      @PostMapping(path="/data-fields/{linkFromDataFieldGUID}/linked-data-fields/{linkToDataFieldGUID}") public VoidResponse linkDataFields(@PathVariable String serverName, @PathVariable String userId, @PathVariable String linkFromDataFieldGUID, @PathVariable String linkToDataFieldGUID, @RequestBody(required=false) DataFieldLink relationshipProperties)
      Link two exising data fields together in a peer relationship.
      Parameters:
      userId - identifier of calling user
      linkFromDataFieldGUID - unique identifier of the data field that is at end 1 of the relationship
      relationshipProperties - optional properties for the relationship
      linkToDataFieldGUID - unique identifier of the data field that is at end 1 of the relationship
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user id not authorized to issue this request or PropertyServerException there was a problem deleting the data field from the annotation store.
    • addAnnotationToDataField

      @PostMapping(path="/data-fields/{parentDataFieldGUID}/annotations") public GUIDResponse addAnnotationToDataField(@PathVariable String serverName, @PathVariable String userId, @PathVariable String parentDataFieldGUID, @RequestBody Annotation annotation)
      Add a new annotation and link it to an existing data field.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      parentDataFieldGUID - unique identifier of the data field that this new one is to be attached to
      annotation - data field object
      Returns:
      unique identifier of new annotation or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem saving data fields in the annotation store.
    • updateDataField

      @PostMapping(path="/data-fields/{dataFieldGUID}/update") public VoidResponse updateDataField(@PathVariable String serverName, @PathVariable String userId, @PathVariable String dataFieldGUID, @RequestBody DataField dataField)
      Replace the current properties of a data field.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      dataFieldGUID - unique identifier of data field
      dataField - new properties
      Returns:
      fully filled out data field or InvalidParameterException one of the parameters is invalid UserNotAuthorizedException the user id not authorized to issue this request PropertyServerException there was a problem updating the data field in the annotation store.
    • deleteDataField

      @PostMapping(path="/data-fields/{dataFieldGUID}/delete") public VoidResponse deleteDataField(@PathVariable String serverName, @PathVariable String userId, @PathVariable String dataFieldGUID, @RequestBody(required=false) NullRequestBody requestBody)
      Remove a data field from the annotation store.
      Parameters:
      serverName - name of server instance to route request to
      userId - identifier of calling user
      dataFieldGUID - unique identifier of the data field
      requestBody - null request body
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user id not authorized to issue this request or PropertyServerException there was a problem deleting the data field from the annotation store.