No handler found for uri curl -XPOST

Hi,

I'm having problems closing snapshot.

I'm going by https://github.com/elastic/examples/tree/master/kibana_nyc_restaurants
The command curl -XPOST "localhost:9200/_snapshot/restaurants_backup/snapshot_1/_restore" works fine
and returns me that cannot restore index because it's open

So I tried to close it
curl -XPOST "localhost:9200/_snapshot/restaurants_backup/snapshot_1/_close"
But I got: No handler found for uri[/snapshot/restaurants_backup/snapshot_1/_close] and method [POST]

Can't find any solution or information and this thing keeps bugging me.

You have to close the index itself, not the _snapshot endpoint. Try this to close:

curl -XPOST "localhost:9200/restaurants_backup/_close"

Hmmm. Commands works but in the end I'm getting this.

$ curl -XPOST "localhost:9200/restaurants_backup/_close"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 355 100 355 0 0 355 0 0:00:01 --:--:-- 0:00:01 346k{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"restaurants_backup","index":"restaurants_backup"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"restaurants_backup","index":"restaurants_backup"},"status":404}

This tells you that the index you are trying to close doesn't exist. If it should (maybe you just used it), the next step would be to figure out why. But maybe its just a typo? You can check the names (and the open/closed) status of the indices using the _cat/indices endpoint:

curl -XGET localhost:9200/_cat/indices

Aaaah. Got it now. Yea, was wrong name.

$ curl 'localhost:9200/_cat/indices?v'
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 267 100 267 0 0 16687 0 --:--:-- --:--:-- --:--:-- 16687health status index pri rep docs.count docs.deleted store.size pri.store.size
yellow open .kibana 1 1 18 1 58.8kb 58.8kb
yellow open nyc_restaurants 5 1 473039 0 176.9mb 176.9mb

So this worked:
curl -XPOST "localhost:9200/nyc_restaurants/_close"