API Gateway Search

The webMethods API Gateway search run a search query in webMethods API Gateway and retrieve search results that match the search query.

Note: When your search involves many records, the process takes a considerable memory space from the server, which in turn affects other business transactions. You can do large search operations when you expect lesser business transactions so that the regular business is not affected.

webMethods API Gateway provides the following REST API resources:

  • POST/rest/apigateway/search
    Runs a search query in webMethods API Gateway and returns the results that match your query. You can search across various objects that include
    • APIs,
    • Applications, Aliases
    • Assertions
    • Policies
    • Administration Settings
    • Policy properties
    • Packages
    • Plans
    • Subscriptions
    • Users
    • User groups
    • Transactional events
    • Lifecycle events
    • Policy violation events
    • Monitor events
    • Error events
    • Threat protection events
    • Performance metrics

To do a search operation, specify the following information in your REST request:

REST Request Section Description
Types Objects for which you want to perform the search operation. You can specify one or more of the listed objects.
Note: When you specify Users and User Groups in the Types section, it returns the list of users and user groups from the Integration Server. In this case, you do not need to specify any search criteria.
Scope Search Criteria. Specify your search attribute and a keyword (value of the attribute) or one of the following points as your search criteria:
  • Time range
    • From a specified date to the current date
    • Until a specified date
    • For a defined period (seconds, minutes, hours, days, weeks, months, quarters, or years)
  • Value range. To retrieve results for an integer value range (from and to values), from a provided value to the maximum value, and from 0 to the provided value.
You can specify multiple attributes.
Note: The search operation is performed based on the criteria that are specified here. It applies to all objects listed in the Types section.
Condition One of the following
  • and - to return results that match all search criteria.
  • or - to return results that match any of the given criteria.
Fields Fields to be returned in the response. You can specify only the necessary fields, instead of viewing all fields in your response. If you want to view only the API Names and Versions that match your search criteria, you can specify apiName and apiVersion in your REST request.
  • POST/rest/apigateway/search/_count

    Retrieves the total number of records for the specified scope and types.

    To retrieve the count of records, you can specify the required types and scope similar to the search query. If you do not specify any search criteria in the Scope section, then the query returns the total number of assets for the objects that are specified in the Types section.

  • POST/rest/apigateway/search/_aggregations

    Executes a search query and groups the results for the specified scope and types.

To perform an aggregations search, specify the following information in your REST request:

REST Request Section Description
Types Objects for which you want to perform the search operation. You can specify one or more of the listed objects.
Scope Search Criteria. Specify your search attribute and a keyword (value of the attribute) or one of the following point as your search criteria:
  • Time range
    • From a specified date to the current date
    • Until a specified date
    • For a defined period (seconds, minutes, hours, days, weeks, months, quarters, or years)
  • Value range - to retrieve results for an integer value range (from and to values), from provided value to the maximum value, and from 0 to the provided value.
Condition One of the following
  • and - to return results that match all search criteria.
  • or - to return results that match any of the given criteria.
Aggregations Values for the following
  • Name Specify a name used to group the required results. For example, you can specify information by API, if you are grouping the results by APIs.
  • Type One of the following
    • group to group the results based on the provided fields.
    • timeseries to group results based on a provided interval value. The interval can be seconds, minutes, hours, days, weeks, months, quarters, or years.
    • metrics to find the average, minimum, maximum and sum of given fields.
    • Fields Fields to be considered for the aggregation. If the type is group and have multiple fields, separate the field names with commas.
Note: The number of transactions that are returned for a search is based on the value that is specified in the defaultSearchSize extended setting. If your search result exceeds the value of this setting, then you can navigate through your search results by specifying the range of records that you want to view. For example, if the value that is specified in the defaultSearchSize setting is 1000 and the count of your search result is 5000, then only the first 1000 records are displayed. To view the consequent records, you can specify the number of the record from which you want to view, and the number of records that must be displayed. That is, to view the records from 1001 to 2000, you can specify the range as follows.

POST http://localhost:5555/rest/apigateway/search

{ 
"types": [
 "TRANSACTION_EVENTS"    ],
 "scope": [
     {  "attributeName": "responseCode",
         "keyword": "304"        
							> },     
					> ],
 "from": "1001"
 “size”: “1000”
}