diff --git a/ci/serverless/kibana_api_tests.sh b/ci/serverless/kibana_api_tests.sh index 52f3f0f9b31..86e6f6df008 100755 --- a/ci/serverless/kibana_api_tests.sh +++ b/ci/serverless/kibana_api_tests.sh @@ -10,7 +10,7 @@ export EXIT_CODE="0" create_pipeline() { RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X PUT -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME" \ - -H 'Content-Type: application/json' -H 'kbn-xsrf: logstash' \ + -H 'Content-Type: application/json' -H 'kbn-xsrf: logstash' -H 'x-elastic-product-origin: logstash' \ --data-binary @"$CURRENT_DIR/test_data/$PIPELINE_NAME.json") if [[ RESP_CODE -ge '400' ]]; then @@ -20,7 +20,8 @@ create_pipeline() { } get_pipeline() { - RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME") + RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' \ + "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME") \ SOURCE_BODY=$(cat "$CURRENT_DIR/test_data/$PIPELINE_NAME.json") RESP_PIPELINE_NAME=$(echo "$RESP_BODY" | jq -r '.id') @@ -41,7 +42,8 @@ get_pipeline() { } list_pipeline() { - RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipelines" | jq --arg name "$PIPELINE_NAME" '.pipelines[] | select(.id==$name)' ) + RESP_BODY=$(curl -s -X GET -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' \ + "$KB_ENDPOINT/api/logstash/pipelines" | jq --arg name "$PIPELINE_NAME" '.pipelines[] | select(.id==$name)' ) if [[ -z "$RESP_BODY" ]]; then EXIT_CODE=$(( EXIT_CODE + 1 )) echo "Fail to list pipeline." @@ -49,7 +51,8 @@ list_pipeline() { } delete_pipeline() { - RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X DELETE -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME" \ + RESP_CODE=$(curl -s -w "%{http_code}" -o /dev/null -X DELETE -H "Authorization: ApiKey $TESTER_API_KEY_ENCODED" -H 'x-elastic-product-origin: logstash' \ + "$KB_ENDPOINT/api/logstash/pipeline/$PIPELINE_NAME" \ -H 'Content-Type: application/json' -H 'kbn-xsrf: logstash' \ --data-binary @"$CURRENT_DIR/test_data/$PIPELINE_NAME.json")