"error": "no handler found for uri

Hi,

I'm trying to create a new index pattern using the Kibana API and from Dev tools I'm executing this simple code reproduced from the documentation:

POST api/saved_objects/index-pattern/testpattern
{
  "attributes": {
    "title": "testpattern-*"
  }
}

The response I'm getting is the following:

{
  "error": "no handler found for uri [/api/saved_objects/index-pattern/testpattern] and method [POST]"
}

Any ideas what I'm doing wrong please? My apologizes for my ignorance but this is the first time using this command and with other I've worked but with this one I can't quite get the hold of it. My final goal is to import a whole index-pattern.

Any help is appreciated.

Thanks

Hi @ccutmt

The Dev Tools app is only for communicating with Elasticsearch. It doesn't work with Kibana's APIs. You'll need to use something like cURL or Postman to work with the Kibana APIs.

Hi @Bargs,

What I've done to work is altered POST method to be as follows:

POST api/saved_objects/index-pattern/
{
  "id" : "my-pattern",
  "attributes": {
"title": "my-pattern-*"

  }

} 

And the response was the following:

{
  "_index": "api",
  "_type": "saved_objects",
  "_id": "index-pattern",
  "_version": 1,
  "result": "created",
  "_shards": {
    "total": 2,
    "successful": 1,
    "failed": 0
  },
  "_seq_no": 0,
  "_primary_term": 1
} 

In this case the index-pattern will be named as

api

Therefore, to have an index pattern named 'my-pattern' , the POST request should be as follows:

POST my-pattern/saved_objects/index-pattern/
{
  "id" : "my-pattern",
  "attributes": {
    "title": "my-pattern-*"

  }

}

The response was the following:

{
  "_index": "my-pattern",
  "_type": "saved_objects",
  "_id": "index-pattern",
  "_version": 1,
  "result": "created",
  "_shards": {
    "total": 2,
    "successful": 1,
    "failed": 0
  },
  "_seq_no": 0,
  "_primary_term": 1
}

Then, for my specific index pattern, I've added my specific index mappings in the POST request.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.