Exception while creating a template


(Satish Anupindi) #1

Hello,
I am trying to create a template which I deleted. I am using the below curl command :

curl -X PUT -H "Content-Type: application/json" -i "http://172.31.38.157:9200/_template/couchbase" -d '{  "couchbase" : {
    "order" : 10,
    "template" : "*",
    "settings" : { },
    "mappings" : {
      "_default_" : {
        "_source" : {
          "includes" : [
            "meta.*"
          ]
        },
        "properties" : {
          "meta" : {
            "include_in_all" : false,
            "type" : "object"
          }
        }
      },
      "couchbaseCheckpoint" : {
        "_source" : {
          "includes" : [
            "doc.*"
          ]
        },
        "dynamic_templates" : [
          {
            "store_no_index" : {
              "mapping" : {
                "include_in_all" : false,
                "index" : "no",
                "store" : "no"
              },
              "match" : "*"
            }
          }
        ]
      }
    },
    "aliases" : { }
  }
}'

Getting a response as below :
HTTP/1.1 400 Bad Request
content-type: application/json; charset=UTF-8
content-length: 239

{"error":{"root_cause":[{"type":"action_request_validation_exception","reason":"Validation Failed: 1: template is missing;"}],"type":"action_request_validation_exception","reason":"Validation Failed: 1: template is missing;"},"status":400}

What is missing? I recreating the template with the same exact settings as was present in the original template


(system) #2

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