Class APIManagerRESTServices

java.lang.Object
org.odpi.openmetadata.accessservices.datamanager.server.APIManagerRESTServices

public class APIManagerRESTServices extends Object
APIManagerRESTServices is the server-side implementation of the Data Manager OMAS's support for apis. It matches the APIManagerClient.
  • Constructor Details

    • APIManagerRESTServices

      public APIManagerRESTServices()
      Default constructor
  • Method Details

    • createAPI

      public GUIDResponse createAPI(String serverName, String userId, boolean apiManagerIsHome, String endpointGUID, APIRequestBody requestBody)
      Create a new metadata element to represent a api.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiManagerIsHome - should the API be marked as owned by the event broker so others can not update?
      endpointGUID - unique identifier of the endpoint where this API is located
      requestBody - properties to store
      Returns:
      unique identifier of the new metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • createAPIFromTemplate

      public GUIDResponse createAPIFromTemplate(String serverName, String userId, String endpointGUID, String templateGUID, boolean apiManagerIsHome, TemplateRequestBody requestBody)
      Create a new metadata element to represent a API using an existing metadata element as a template.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      endpointGUID - unique identifier of the endpoint where this API is located
      templateGUID - unique identifier of the metadata element to copy
      apiManagerIsHome - should the API be marked as owned by the event broker so others can not update?
      requestBody - properties that override the template
      Returns:
      unique identifier of the new metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • updateAPI

      public VoidResponse updateAPI(String serverName, String userId, String apiGUID, boolean isMergeUpdate, APIRequestBody requestBody)
      Update the metadata element representing a api.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiGUID - unique identifier of the metadata element to update
      isMergeUpdate - should the new properties be merged with the existing properties of overlay them?
      requestBody - new properties for this element
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • publishAPI

      public VoidResponse publishAPI(String serverName, String userId, String apiGUID, NullRequestBody nullRequestBody)
      Update the zones for the API asset so that it becomes visible to consumers. (The zones are set to the list of zones in the publishedZones option configured for each instance of the Data Manager OMAS).
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiGUID - unique identifier of the metadata element to publish
      nullRequestBody - empty request body
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • withdrawAPI

      public VoidResponse withdrawAPI(String serverName, String userId, String apiGUID, NullRequestBody nullRequestBody)
      Update the zones for the API asset so that it is no longer visible to consumers. (The zones are set to the list of zones in the defaultZones option configured for each instance of the Data Manager OMAS. This is the setting when the API is first created).
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiGUID - unique identifier of the metadata element to withdraw
      nullRequestBody - empty request body
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • removeAPI

      public VoidResponse removeAPI(String serverName, String userId, String apiGUID, String qualifiedName, MetadataSourceRequestBody requestBody)
      Remove the metadata element representing an api.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiGUID - unique identifier of the metadata element to remove
      qualifiedName - unique name of the metadata element to remove
      requestBody - external source identifiers
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • findAPIs

      public APIsResponse findAPIs(String serverName, String userId, SearchStringRequestBody requestBody, int startFrom, int pageSize)
      Retrieve the list of API metadata elements that contain the search string. The search string is treated as a regular expression.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      requestBody - string to find in the properties
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIsByName

      public APIsResponse getAPIsByName(String serverName, String userId, NameRequestBody requestBody, int startFrom, int pageSize)
      Retrieve the list of API metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      requestBody - name to search for
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIsForAPIManager

      public APIsResponse getAPIsForAPIManager(String serverName, String userId, String apiManagerGUID, String apiManagerName, int startFrom, int pageSize)
      Retrieve the list of apis created by this caller.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiManagerGUID - unique identifier of software server capability representing the event broker
      apiManagerName - unique name of software server capability representing the event broker
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIsByEndpoint

      public APIsResponse getAPIsByEndpoint(String serverName, String userId, String endpointGUID, int startFrom, int pageSize)
      Retrieve the list of API metadata elements linked to the requested endpoint.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      endpointGUID - endpointGUID to search for
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIByGUID

      public APIResponse getAPIByGUID(String serverName, String userId, String guid)
      Retrieve the API metadata element with the supplied unique identifier.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      guid - unique identifier of the requested metadata element
      Returns:
      matching metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • createAPIOperation

      public GUIDResponse createAPIOperation(String serverName, String userId, String apiGUID, APIOperationRequestBody requestBody)
      Create a new metadata element to represent a API operation.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiGUID - unique identifier of the topic where the schema is located
      requestBody - properties about the API operation
      Returns:
      unique identifier of the new API operation or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • createAPIOperationFromTemplate

      public GUIDResponse createAPIOperationFromTemplate(String serverName, String userId, String templateGUID, String apiGUID, TemplateRequestBody requestBody)
      Create a new metadata element to represent an API operation using an existing metadata element as a template.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      templateGUID - unique identifier of the metadata element to copy
      apiGUID - unique identifier of the topic where the schema is located
      requestBody - properties that override the template
      Returns:
      unique identifier of the new API operation or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • updateAPIOperation

      public VoidResponse updateAPIOperation(String serverName, String userId, String apiOperationGUID, boolean isMergeUpdate, APIOperationRequestBody requestBody)
      Update the metadata element representing a API operation.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiOperationGUID - unique identifier of the metadata element to update
      isMergeUpdate - are unspecified properties unchanged (true) or removed?
      requestBody - new properties for the metadata element
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • removeAPIOperation

      public VoidResponse removeAPIOperation(String serverName, String userId, String apiOperationGUID, String qualifiedName, MetadataSourceRequestBody requestBody)
      Remove the metadata element representing an API operation.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiOperationGUID - unique identifier of the metadata element to remove
      qualifiedName - unique name of the metadata element to remove
      requestBody - external source identifiers
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • findAPIOperations

      public APIOperationsResponse findAPIOperations(String serverName, String userId, SearchStringRequestBody requestBody, int startFrom, int pageSize)
      Retrieve the list of API operation metadata elements that contain the search string. The search string is treated as a regular expression.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      requestBody - string to find in the properties
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIOperationsForAPI

      public APIOperationsResponse getAPIOperationsForAPI(String serverName, String userId, String apiGUID, int startFrom, int pageSize)
      Return the list of operation associated with an API.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiGUID - unique identifier of the asset to query
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of metadata elements describing the schemas associated with the requested topic or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIOperationsByName

      public APIOperationsResponse getAPIOperationsByName(String serverName, String userId, NameRequestBody requestBody, int startFrom, int pageSize)
      Retrieve the list of API operation metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      requestBody - name to search for
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIOperationByGUID

      public APIOperationResponse getAPIOperationByGUID(String serverName, String userId, String guid)
      Retrieve the API operation metadata element with the supplied unique identifier.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      guid - unique identifier of the requested metadata element
      Returns:
      requested metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • createAPIParameterList

      public GUIDResponse createAPIParameterList(String serverName, String userId, String apiOperationGUID, APIParameterListType parameterListType, APIParameterListRequestBody requestBody)
      Create a new metadata element to represent a API parameter list.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiOperationGUID - unique identifier of the topic where the schema is located
      parameterListType - is this a header, request or response
      requestBody - properties about the API parameter list
      Returns:
      unique identifier of the new API parameter list or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • createAPIParameterListFromTemplate

      public GUIDResponse createAPIParameterListFromTemplate(String serverName, String userId, String templateGUID, String apiOperationGUID, APIParameterListType parameterListType, TemplateRequestBody requestBody)
      Create a new metadata element to represent an API parameter list using an existing metadata element as a template.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      templateGUID - unique identifier of the metadata element to copy
      apiOperationGUID - unique identifier of the topic where the schema is located
      parameterListType - is this a header, request or response
      requestBody - properties that override the template
      Returns:
      unique identifier of the new API parameter list or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • updateAPIParameterList

      public VoidResponse updateAPIParameterList(String serverName, String userId, String apiParameterListGUID, boolean isMergeUpdate, APIParameterListRequestBody requestBody)
      Update the metadata element representing an API parameter list.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiParameterListGUID - unique identifier of the metadata element to update
      isMergeUpdate - are unspecified properties unchanged (true) or removed?
      requestBody - new properties for the metadata element
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • removeAPIParameterList

      public VoidResponse removeAPIParameterList(String serverName, String userId, String apiParameterListGUID, String qualifiedName, MetadataSourceRequestBody requestBody)
      Remove the metadata element representing an API parameter list.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiParameterListGUID - unique identifier of the metadata element to remove
      qualifiedName - unique name of the metadata element to remove
      requestBody - external source identifiers
      Returns:
      void or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • findAPIParameterLists

      public APIParameterListsResponse findAPIParameterLists(String serverName, String userId, SearchStringRequestBody requestBody, int startFrom, int pageSize)
      Retrieve the list of API parameter list metadata elements that contain the search string. The search string is treated as a regular expression.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      requestBody - string to find in the properties
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIParameterListsForOperation

      public APIParameterListsResponse getAPIParameterListsForOperation(String serverName, String userId, String apiOperationGUID, int startFrom, int pageSize)
      Return the list of schemas associated with a topic.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      apiOperationGUID - unique identifier of the topic to query
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of metadata elements describing the schemas associated with the requested topic or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIParameterListsByName

      public APIParameterListsResponse getAPIParameterListsByName(String serverName, String userId, NameRequestBody requestBody, int startFrom, int pageSize)
      Retrieve the list of API parameter list metadata elements with a matching qualified or display name. There are no wildcards supported on this request.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      requestBody - name to search for
      startFrom - paging start point
      pageSize - maximum results that can be returned
      Returns:
      list of matching metadata elements or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)
    • getAPIParameterListByGUID

      public APIParameterListResponse getAPIParameterListByGUID(String serverName, String userId, String guid)
      Retrieve the API parameter list metadata element with the supplied unique identifier.
      Parameters:
      serverName - name of the service to route the request to.
      userId - calling user
      guid - unique identifier of the requested metadata element
      Returns:
      requested metadata element or InvalidParameterException one of the parameters is invalid or UserNotAuthorizedException the user is not authorized to issue this request or PropertyServerException there is a problem reported in the open metadata server(s)