Trying to get create snapshot working with elasticsearch javascript

Hi,
I am capable of creating a snapshot using sense or curl using the command:

PUT /_snapshot/gridshore-repo/gridshore_4
{
"indices": "gridshore*"
}

The problem is when I start doing something like this using the javascript
library in angularjs.

es.snapshot.create({"repository":"gridshore-repo","snapshot":"gridshore_4","indices":"gridshore*"}).then(function(data)
{
callback();
}, logErrors);

I get back errors like this:
StatusCodeError: InvalidIndexNameException[[_snapshot] Invalid index name
[snapshot], must not start with ''] {message:
"InvalidIndexNameException[[_snapshot] Invalid index name [snapshot], must
not start with '
']", body: Object, status: 400, stack: (...)}

Does anyone have a clue how to fix this?

thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/319912c1-711d-4d40-b5b6-8ba751091a9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

The problem was partly because I was doing it wrong. You need to provide
additional parameters in a body element. And there is a bug in the snapshot
creation, needs to be a PUT instead of a POST.

See issue:

Op vrijdag 12 december 2014 01:12:28 UTC+1 schreef Jettro Coenradie:

Hi,
I am capable of creating a snapshot using sense or curl using the command:

PUT /_snapshot/gridshore-repo/gridshore_4
{
"indices": "gridshore*"
}

The problem is when I start doing something like this using the javascript
library in angularjs.

es.snapshot.create({"repository":"gridshore-repo","snapshot":"gridshore_4","indices":"gridshore*"}).then(function(data)
{
callback();
}, logErrors);

I get back errors like this:
StatusCodeError: InvalidIndexNameException[[_snapshot] Invalid index name
[snapshot], must not start with ''] {message:
"InvalidIndexNameException[[_snapshot] Invalid index name [snapshot], must
not start with '
']", body: Object, status: 400, stack: (...)}

Does anyone have a clue how to fix this?

thanks

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/3a3614eb-6e07-41ce-82bd-2010ba2d25d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.