REST API object definitions

I'm trying to use the Create Object REST API I want to pass what I have obtained from a find call...

        "attributes": {
            "title": "ohip_request",
            "timeFieldName": "createdTime",
            "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false}...... lots more....

but this fails with:
{"error":"no handler found for uri [/api/saved_objects/index-pattern/a492d940-9407-11e9-bb2b-65c8f6e0978d?overwrite=true] and method [POST]"}

Where can I find the definition of the "attributes" object, so I can see what properties it has and how they should be set...

Hi Matheu,

Here is our API documentation: https://www.elastic.co/guide/en/kibana/master/api.html

Thanks,
Liza

Sorry, but this documentation is so basic, it tells me nothing I need to know... All I can find from this document is that attributes has a title property...

Am I even able to pass a fields property in a create object call..? If so what does it look like?
Is the example above correct..?
Why is the above failing with a "no handler" error.
Is the payload incorrect..

At the moment I'm just guessing at what is wrong...

Hi Matheu:

I don't find much detail on it either, maybe @joshdover can help share some info on what that error means.

I did try the following short example using curl, it is not fully like yours, but it did not throw that error:

-H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d'
{
"attributes": {
"title": "my-pattern2-*",
"timeFieldName": "createdTime",
"fields": "[{"name":"_id"}]"
}
}
'

Also what version of Kibana are you using?

i need exactly the same info. The docs are of no use at best. I shouldn't have to search through the code in order to get such a basic answer.
As well, I create index with documents from logstash. I want to do visual after they have been created. Kibana does not create a useful index unless you manually select it and specify the timestamp format via kibana index management. How can I do this via REST?

I understand Peter and agree the documentation can be improved, it is possibly lacking information since it is still listed as experimental, let's see what @joshdover thinks and how we can help.

Nothing is jumping out at me as obviously incorrect here. Some details that would help:

  • Which version of Kibana are you using?
  • Do you have Security enabled?
  • What is the full curl command (without any auth credentials) that you are using?
  • Do you have server.basePath configured in your kibana.yml? If so, you may need to include the basePath in the beginning of the URL.

Josh,
Maybe i need to open another thread to get answers to my questions ? I'm using 7.1.
No security , no mods whatsover to installation.

As well, I create index with documents from logstash. I want to do visual after they have been created. Kibana does not create a useful index unless you manually select it and specify the timestamp format via kibana index management. How can I do this via REST?

Ah I think I just figured it out. It appears you're sending this request to Elasticsearch rather than Kibana. (localhost:5601 if running locally).

If you're using the Console app in the Kibana Dev Tools, this tool can only send requests to Elasticsearch. You'll need to use another way of sending requests other than Console.

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