Introduction

The search service is a global and shared resource properties repository that is integrated in the IBM Cloud Platform. It's used for storing and searching cloud resource attributes. It categorizes and classifies resources. A resource is controlled and owned by resource providers within the IBM Cloud platform, such as Cloud Foundry, IBM Containers, or Resource Controller. Resources are uniquely identified by a Cloud Resource Naming identifier (CRN). The properties of a resource include tags and system properties. Both properties are defined within an IBM Cloud billing account, and span across many regions.

API endpoint

api.global-search-tagging.cloud.ibm.com

API endpoint

api.global-search-tagging.cloud.ibm.com

API endpoint

api.global-search-tagging.cloud.ibm.com

API endpoint

api.global-search-tagging.cloud.ibm.com

Authentication

REST APIs require the user to specify an OAuth2 security token in the header to be authorized by the IBM Cloud IAM service. You can obtain a bearer token by using the IBM Cloud command-line command ibmcloud iam oauth-tokens. Another way to obtain a bearer token is through an API key. For more information, see Getting an IBM Cloud IAM token by using an API key.

Error handling

The resource manager uses standard HTTP response codes to indicate whether a method completed successfully. A 200 type response always indicates success. A 400 type response is a failure, and a 500 type response is an internal system error.

HTTP Error Code Description Recovery
200 Success The request was successful.
400 Bad Request The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request.
401 Unauthorized You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.
403 Forbidden The supplied authentication is not authorized to access '{namespace}'.
404 Not Found The requested resource could not be found.
409 Conflict The entity is already in the requested state.
410 Gone The resource is valid but has been removed already in a previous call
500 Internal Server Error offering_name is currently unavailable. Your request could not be processed. Wait a few minutes and try again.

Methods

Find instances of resources

Find resources in the internal search platform for a specific account ID. You can optionally apply query strings. To filter results, you can insert a string using the Lucene syntax and the query string is parsed into a series of terms and operators. A term can be a single word or a phrase, in which case the search is performed for all the words, in the same order. To filter for a specific value regardless of the property that contains it, use an asterisk as the key name. Results are filtered by the account ID and IAM subsystem. Only resources that belong to the account ID and that are accessible by the client are returned.

POST /v2/resources/search
Request

Query Parameters

  • The IBM Cloud billing account id to filter resources. If left empty, the account id extracted from the IAM token will be used. Only authorized users can use the special character ‘*’ as account id to perform search cross accounts.

    Constraints: Value must match regular expression ^[a-f0-9]{32}$|^[*]{1}$

  • The offset is the index of the item from which you want to start returning data from. Default is 0.

    Default: 0

  • The number of hits to return. Defaults to 10.

    Default: 10

  • The search timeout, in milliseconds, limits the search request to be executed within the specified time value and combines the hits accumulated up to that point when the search expired. The system defined timeout is the default.

    Default: 120000

  • Comma separated properties name used for sorting

  • Search providers. Supported values are ghost and ims. If not specified, the defaults to ghost only. Specify a single provider.

    Constraints: length ≥ 1

It contains the query filters, the list of fields to be returned, and the search token (initally set to null or undefined)

Response

Status Code

  • A result paging with the list of resources matching the provided filters.

  • Bad Request

  • Unauthorized / Wrong auth token type IAM / Auth token not valid

  • Unauthorized operation

  • Internal Server Error / IAM not initialized / Malformed IAM credentials

  • Search IAM error

  • System problem or unexpected error

Example responses

Get all supported resource types

Retrieves a list of all the resource types supported by GhoST.

GET /v2/resources/supported_types
Request

No Request Parameters

This method does not accept any request parameters.

Response

Status Code

  • List of supported resource types

  • System problem or unexpected error

Example responses