younifyd
Menu

Create or update a script or search template (PUT /_scripts/{id})

Create or update a script or search template

PUT/_scripts/{id}

Use it in a workflow

  1. Add a step and choose the Elasticsearch connector.
  2. Pick the Create or update a script or search template (PUT /_scripts/{id}) action (under script).
  3. Fill in the fields below, then reference the result from later steps as {{createOrUpdateAScriptOrSearchTemplatePutScriptsId.response.data}}.

Request

Path parameters

idstringrequired

The identifier for the stored script or search template. It must be unique within the cluster.

Query parameters

contextstring

The context in which the script or search template should run. To prevent errors, the API immediately compiles the script or template in this context. If you specify both this and the `<context>` path parameter, the API uses the request path parameter.

master_timeoutoneOf

The period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to `-1` to indicate that the request should never timeout.

timeoutoneOf

The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. It can also be set to `-1` to indicate that the request should never timeout.

Response

Returns 200 with an object. Read it in later steps with {{createOrUpdateAScriptOrSearchTemplatePutScriptsId.response.data.<field>}}.

acknowledgedboolean

For a successful response, this value is always true. On failure, an exception is returned instead.

json
{
  "acknowledged": false
}

Need more? See the Elasticsearch guide for connection setup and behaviour shared by every action.