Use a Predix Search Service Instance

Index and Query the Predix Search Cluster

To read and write data to and from the Predix Search cluster, use the standard Elasticsearch REST API endpoints.

When making an API request, you must include the following request headers:
HeaderValue
predix-zone-idProvide the value of predix-search[0].credentials.zone_id from the VCAP_SERVICES environment variable for your application. See Bind an Application to a Predix Search Service Instance.
authorizationProvide the UAA authentication token, which must be set as the bearer in the request header.

For example:


curl https://<predix_search_url>/index_name/type_name/id_num \
-H "predix-zone-id: 73138xyz-aea7-4b25-8970-4abc1ba4eb09" \
-H "authorization: bearer eyJhbGciOiJSUzI1NiIsImtpZCI6ImxlZ2FjeS10b2tlbi1rZXkiLCJ0eXAiOiJKV1QifQ.eyJqdGkiOiIzNGQwZWNlYmNmMmU0YjkyOWYwOTkyY2VkNDQzNTY4MyIsInN1YiI6IjA2ODY2NTdlLTM4OWItNDNkNi1
iNzNmLTIzYWMzNzhhYWI2NCIsInNjb3BlIjpbInByZWRpeC1lbGFzdGljc2VhcmNoLnpvbmVzLjczMTM4ZmZlLWFlYTctNGIyNS04OTcwLTRjYWUxYmE0ZWIwOS51c2VyIl0sImNsaWVudF9pZCI6InRlc3RjbGllbnQiLCJjaWQiOi
J0ZXN0Y2xpZW50IiwiYXpwIjoidGVzdGNsaWVudCIsImdyYW50X3R5cGUiOiJhdXRob3JpemF0aW9uX2NvXYZiLCJ1c2VyX2lkIjoiMDY4NjY1N2UtMzg5Yi00M2Q2LWI3M2YtMjNhYzM3OGFhYjY0Iiwib3JpZ2luIjoidWFhIiwidXNlcl9uYW1lIjoi
dGVzdCIsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsImF1dGhfdGltZSI6MTUwNDM0OTQwMywicmV2X3NpZyI6IjE5YmNmNjdjIiwiaWF0IjoxNTA0MzQ5NDA2LCJleHAiOjE1MDQzOTI2MDYsImlzcyI6Imh0dHBzOi8vZWxhc3RpY3NlYXJjai10ZXN0LnByZWRpeC11YWEucnVuLmF3cy1
1c3cwMi1kZXYuaWNlLnByZWRpeC5pby9vYXV0aC90b2tlbiIsInppZCI6IjAzNmVlMmUxLWQzOGMtNDNlZS04YjVlLWUzODZlM2E0YWZlYSIsImF1ZCI6WyJwcmVkaXgtZWxhc3RpY3NlYXJjaC56b25lcy43MzEzOGZmZS1hZWE3LTRiMjUtODk3MC00Y2FlMWJhNGViMDkiL
CJ0ZXN0Y2xpZW50IiwidWFhdGVzdCJdfQ.EG9Qe6nM_kW6JMpO4Wj5ZH55f4TsUX6J2BHWawCPdo4zKJWxGY9lXcrBeWqIw7W-Ck3kexEImgEnvAcxwfsS23yrjfPAkNHSuO5uB1YGAQAD1Znm9oqx5ZT08oBNi
8y2GVFr1qKqRCHr_z8nHmw_LGyZmHo9-EuTvuxD3Q1KDvf9vmOP8wM3CtY34lr4KVlQ-9SvN98LKwAPgj-ozT5ueXg90tVjxujAT9jTI1fWVsMAuMn-P5Oi1IcW1mJIuj1TiLp1BgRnRLOeJo6YaaHGjwFrLh_SwhKs5jUshLrq0kkoAw7iipOCzGxwHHWiDFwaTikYABCAI7SXUc5n_18gWA"
Note: For information about obtaining UAA authentication tokens, see Understanding UAA and OAuth2 Access Token Flows.

Use Snapshot and Restore

Predix Search enables you to take snapshots of indices, view information about snapshots, and restore from snapshots any indices that have been closed or deleted in the Predix Search cluster.

Snapshot

Predix Search takes an automated snapshot of all the indices in the cluster once every 24 hours.

To view all available automated snapshots, use the following endpoint:

GET /_snapshot/cs-automated/_all

… where cs-automated is the repository where automated snapshots are stored.

To take a snapshot of all open and started indices in the cluster, use the following endpoint:

PUT /_snapshot/<repository_name>/<snapshot_name>
  • <repository_name> — Specify the name of the repository where the snapshot will be stored.
  • <snapshot_name> — Provide a unique name for the snapshot.

Restore

To restore all of the indices contained in a snapshot, use the following endpoint:

POST /_snapshot/<snapshot_repository>/<snapshot_name>/_restore

For example, to restore the snapshot named daily-20170101 from the cs_automated repository:

POST /_snapshot/cs-automated/daily-20170101/_restore

You can also restore individual indices from a snapshot by specifying the names of the indices in the body of the POST request. For more information, see Elasticsearch Snapshot and Restore.

API Documentation

Predix Search supports an assortment of Elasticsearch operations.

Supported API Endpoints — Elasticsearch 6.2

  • /_alias
  • /_aliases
  • /_all
  • /_analyze
  • /_bulk
  • /_cache/clear (Index only)
  • /_cat
  • /_cluster/allocation/explain
  • /_cluster/health
  • /_cluster/pending_tasks
  • /_cluster/settingsfor several properties:
    • action.auto_create_index
    • action.search.shard_count.limit
    • indices.breaker.fielddata.limit
    • indices.breaker.request.limit
    • indices.breaker.total.limit
  • /_cluster/state
  • /_cluster/stats
  • /_count
  • /_delete_by_query
  • /_explain
  • /_field_stats
  • /_flush
  • /_forcemerge (Index only)
  • /_ingest
  • /_mapping
  • /_mget
  • /_msearch
  • /_mtermvectors
  • /_nodes
  • /_plugin/kibana
  • /_rank_eval
  • /_recovery (Index only)
  • /_refresh
  • /_reindex
  • /_rollover
  • /_scripts
  • /_search
  • /_search profile
  • /_segments (Index only)
  • /_shard_stores
  • /_shrink
  • /_snapshot
  • /_split
  • /_stats
  • /_status
  • /_tasks
  • /_template
  • /_termvectors (Index only)
  • /update
  • /_update_by_query
  • /_validate