
This change updates the logic in our create-elasticsearch-templates job to support creation of a variety of different API objects. Change-Id: I380a55b93e7aabb606e713c21d71a383fef78b3f
11 lines
354 B
Smarty
11 lines
354 B
Smarty
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
{{ range $object := .Values.conf.api_objects }}
|
|
curl -K- <<< "--user ${ELASTICSEARCH_USERNAME}:${ELASTICSEARCH_PASSWORD}" \
|
|
-X{{ $object.method | default "PUT" | upper }} \
|
|
"${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/{{ $object.endpoint }}" \
|
|
-H 'Content-Type: application/json' -d '{{ $object.body | toJson }}'
|
|
{{ end }}
|