Spaces API not working

I've just upgraded to Kibana 6.7.1 on Elastic Cloud in order to use spaces. I'm following https://www.elastic.co/guide/en/kibana/6.7/spaces-api-post.html

So I run the following command:

POST api/spaces/space
{
  "id": "se",
  "name": "se"
} 

Which returns 200 and

{
  "_index" : "api",
  "_type" : "spaces",
  "_id" : "space",
  "_version" : 25,
  "result" : "updated",
  "_shards" : {
    "total" : 2,
    "successful" : 1,
    "failed" : 0
  },
  "_seq_no" : 24,
  "_primary_term" : 1
}

Which has not created a space. There's no space in management -> Kibana -> spaces and GET api/spaces/space/se returns

{
  "error": "no handler found for uri [/api/spaces/space/se?pretty] and method [GET]"
}

However a careful read of the response lead me to believe that an index named "API" had been created. Which I confirmed by running GET /api/_search

{
  "took" : 1,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : 1,
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "api",
        "_type" : "spaces",
        "_id" : "space",
        "_score" : 1.0,
        "_source" : {
          "id" : "se",
          "name" : "se"
        }
      }
    ]
  }
}

I've tried this with and without the leading / which makes no difference.

So how to I create a space?

Steven

@Larry_Gregory

Right, so the problem is that I was connecting to the elasticsearch cluster at its hostname and port. This command needs be be sent to the Kibana cluster. That really needs to be said in BIG BOLD LETTERS on every one of the Kibana REST API pages given that all of the other documentation with HTTP verbs refers to Elasticsearch.

1 Like

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