search


SoftLayer_Search::search

Search for SoftLayer Resources by simple phrase.

Description

This method allows for searching for SoftLayer resources by simple phrase. It returns a collection or array of SoftLayer_Container_Search_Result objects that have search metadata for each result and the resulting resource found.

This method recognizes the special _objectType: quantifier in search strings. This quantifier can be used to restrict a search to specific object types. Example usage:

_objectType:Type_1 (other search terms…)

A search string can specify multiple object types, separated by commas (no spaces are permitted between the type names). Example:

_objectType:Type_1,Type_2,Type_3 (other search terms…)

If the list of object types is prefixed with a hyphen or minus sign (-), then the specified types are excluded from the search. Example:

_objectType:-Type_4,Type_5 (other search terms…)

A collection of available object types can be retrieved by calling the SoftLayer_Search::getObjectTypes method.

Exact Match on Text Fields

To enforce an exact match on text fields, encapsulate the term in double quotes. For example, given a set of device host names:

  • baremetal-a
  • baremetal-b
  • a-virtual-guest
  • b-virtual-guest
  • edge-router

An exact search (double-quote) for “baremetal-a” will return only the exact match of baremetal-a.

A fuzzy search (no double-quote) for baremetal-a will return baremetal-a, baremetal-b, a-virtual-guest, b-virtual-guest but will omit edge-router.


Parameters

Name Type Description
searchString string A string with search terms.

Required Headers

Optional Headers

Return Values

curl -g -u $SL_USER:$SL_APIKEY -X POST -d '{"parameters": [string]}' \
'https://api.softlayer.com/rest/v3.1/SoftLayer_Search/search'