Is there a way for me to tell programmatically if a view is currental indexing?


#1

Our monitoring tool keeps reporting that one of our endpoints is down for a minute. I think it is the views indexing but I would like to programmatically check it when the endpoint is tested. Is there a cli or rest command I can use to check if a view or design doc is indexing currently?


#2

Admin UI is using endpoint http://localhost:8091/pools/default/tasks to find out information about tasks in progress. I don’t think it is public API, but you can quickly findout information about current background tasks on the cluster. The URL could be discovered through http://localhost:8091/pools/default

For example, if you will try to load travel-sample bucket, you will see something like this:

$ curl -Ss -u 'Administrator:password' http://localhost:8091/pools/default/tasks
[
  {
    "type": "rebalance",
    "status": "notRunning",
    "statusIsStale": false,
    "masterRequestTimedOut": false
  },
  {
    "type": "indexer",
    "recommendedRefreshPeriod": 2,
    "status": "running",
    "bucket": "travel-sample",
    "designDocument": "_design/spatial",
    "changesDone": 1,
    "totalChanges": 31591,
    "progress": 0
  },
  {
    "status": "running",
    "type": "loadingSampleBucket",
    "bucket": "travel-sample",
    "pid": "<0.6970.5>"
  },
  {
    "type": "global_indexes",
    "recommendedRefreshPeriod": 2,
    "status": "running",
    "bucket": "travel-sample",
    "index": "def_faa",
    "id": 18351375537881438000,
    "progress": 0,
    "statusIsStale": false
  }
]

#3

Thanks! That’s exactly what I needed.