The Konnect Search API provides selectors, reserved characters, and logical operators that you can use to narrow your entity search.
By combining these selectors, reserved characters, and logical operators, you can construct complex and precise queries to effectively use the Konnect Search API.
To perform a simple search, you can just search by the name of an entity, like a Service, API product, or name of a team.
You can also perform an advanced search using Konnect’s query syntax to get more granular results.
The following is an example advanced search query syntax:
type:team AND NOT label.department:eng AND name:*_qa
In this example, the query syntax is made up of the following components:
- Selectors:
type
, label
, and name
. They define what you are searching by.
- Entity type:
team
. These define what Konnect entity you want to search for.
- Logical operator:
AND NOT
and AND
. These are used to combine multiple criteria in a query.
- Wildcard:
*
to denote any a suffix match.
- Search values:
eng
and _qa
. These are the values that the search service is matching for.
The following Konnect entity types are supported:
api_product
api_product_version
application
ca_certificate
certificate
consumer
consumer_group
control_plane
data_plane
developer
developer_team
gateway_service
key
key_set
mesh
mesh_control_plane
plugin
portal
report
route
sni
system_account
target
team
upstream
user
vault
zone
Additional entities may be added in future releases. You can view a list of all the supported entities by sending the following API request:
curl -X GET "https://global.api.konghq.com/v1/search/types" \
-H "Accept: application/json"\
-H "Authorization: Bearer $KONNECT_TOKEN"
For each entity type, there is a list of entity specific attributes that are searchable.
These attributes are returned in the attributes object in the search response, while the schema of the searchable attributes can be found in the /types
endpoint.
Selectors are used to define the criteria of the search.
The following table describes the different selectors and their functions:
Selector
|
Function
|
Example
|
type:{entity_type}
|
Searches for a specific entity type.
|
type:control_plane
|
{value}
|
Searches for a match in {value} on any all searchable attributes.
|
foobar
|
id:{value}
|
Searches for a match on id .
|
id:df968c45-3f20-4b80-8980-e223b250dec5
|
name:{value}
|
Searches for a match on name .
|
name:default
|
description:{value}
|
Searches for a match on description .
|
description:temporary
|
labels.{label_key}:{label_value}
|
Searches for an exact match for a labeled entity.
|
labels.env:prod
|
@public_labels.{label_key}:{label_value}
|
Searches for an exact match for a labeled entity in Dev Portal.
|
@public_labels.env:prod
|
@{attribute_key}:{attribute_value}
|
Searches for an exact match for an entity specific attribute.
|
@email:"admin@domain.com"
|
The following table describes the characters with special meanings in the query syntax:
Character
|
Function
|
*
|
Use as a wildcard.
|
""
|
Denotes an exact match. This is case insensitive and includes spaces.
|
Logical operators are used to combine multiple criteria in a search query.
Operators are case-sensitive.
The following table describes each operator and how it functions in the query syntax:
Operator
|
Function
|
AND
|
Searches for entities that are in all of the listed fields.
|
OR
|
Searches for entities that are in one or more of the listed fields.
|
NOT
|
Searches for entities that are not in a field.
|