Method: projects.locations.searchResources

Search across API-Hub resources.

HTTP request

POST https://apihub.googleapis.com/v1/{location=projects/*/locations/*}:searchResources

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
location

string

Required. The resource name of the location which will be of the type projects/{projectId}/locations/{locationId}. This field is used to identify the instance of API-Hub in which resources should be searched.

Request body

The request body contains data with the following structure:

JSON representation
{
  "query": string,
  "filter": string,
  "pageSize": integer,
  "pageToken": string
}
Fields
query

string

Required. The free text search query. This query can contain keywords which could be related to any detail of the API-Hub resources such display names, descriptions, attributes etc.

filter

string

Optional. An expression that filters the list of search results.

A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string, a number, or a boolean. The comparison operator must be =. Filters are not case sensitive.

The following field names are eligible for filtering: * resource_type - The type of resource in the search results. Must be one of the following: Api, ApiOperation, Deployment, Definition, Spec or Version. This field can only be specified once in the filter.

Here are is an example:

  • resource_type = Api - The resource_type is Api.
pageSize

integer

Optional. The maximum number of search results to return. The service may return fewer than this value. If unspecified at most 10 search results will be returned. If value is negative then INVALID_ARGUMENT error is returned. The maximum value is 25; values above 25 will be coerced to 25. While paginating, you can specify a new page size parameter for each page of search results to be listed.

pageToken

string

Optional. A page token, received from a previous [locations.searchResources][locations.searchResources] call. Specify this parameter to retrieve the next page of transactions.

When paginating, you must specify the pageToken parameter and all the other parameters except pageSize should be specified with the same value which was used in the previous call. If the other fields are set with a different value than the previous call then INVALID_ARGUMENT error is returned.

Response body

Response for the locations.searchResources method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "searchResults": [
    {
      object (SearchResult)
    }
  ],
  "nextPageToken": string
}
Fields
searchResults[]

object (SearchResult)

List of search results according to the filter and search query specified. The order of search results represents the ranking.

nextPageToken

string

Pass this token in the SearchResourcesRequest to continue to list results. If all results have been returned, this field is an empty string or not present in the response.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

IAM Permissions

Requires the following IAM permission on the location resource:

  • apihub.apis.list

For more information, see the IAM documentation.

SearchResult

Represents the search results.

JSON representation
{
  "resource": {
    object (ApiHubResource)
  }
}
Fields
resource

object (ApiHubResource)

This represents the ApiHubResource. Note: Only selected fields of the resources are populated in response.

ApiHubResource

ApiHubResource is one of the resources such as Api, Operation, Deployment, Definition, Spec and Version resources stored in API-Hub.

JSON representation
{

  // Union field resource can be only one of the following:
  "api": {
    object (Api)
  },
  "operation": {
    object (ApiOperation)
  },
  "deployment": {
    object (Deployment)
  },
  "spec": {
    object (Spec)
  },
  "definition": {
    object (Definition)
  },
  "version": {
    object (Version)
  }
  // End of list of possible types for union field resource.
}
Fields

Union field resource.

resource can be only one of the following:

api

object (Api)

This represents Api resource in search results. Only name, displayName, description and owner fields are populated in search results.

operation

object (ApiOperation)

This represents ApiOperation resource in search results. Only name, description, spec and details fields are populated in search results.

deployment

object (Deployment)

This represents Deployment resource in search results. Only name, displayName, description, deploymentType and apiVersions fields are populated in search results.

spec

object (Spec)

This represents Spec resource in search results. Only name, displayName, description, specType and documentation fields are populated in search results.

definition

object (Definition)

This represents Definition resource in search results. Only name field is populated in search results.

version

object (Version)

This represents Version resource in search results. Only name, displayName, description, lifecycle, compliance and accreditation fields are populated in search results.