sagar-salvi-apptware 5d17ecb290
feat(ingest/dremio): Dremio Source Ingestion (#11598)
Co-authored-by: Jonny Dixon <jonny.dixon@acryl.io>
Co-authored-by: Jonny Dixon <45681293+acrylJonny@users.noreply.github.com>
Co-authored-by: Mayuri Nehate <33225191+mayurinehate@users.noreply.github.com>
2024-11-05 22:06:35 +05:30

35 lines
950 B
Bash
Executable File

#!/bin/bash
# Set variables
DREMIO_URL="http://localhost:9047"
ADMIN_USER="admin"
ADMIN_PASSWORD="2310Admin1234!@"
ADMIN_FIRST_NAME="Admin"
ADMIN_LAST_NAME="User"
ADMIN_EMAIL="admin@dremio.com"
# Wait for Dremio to become available
until $(curl --output /dev/null --silent --head --fail "$DREMIO_URL"); do
echo "Waiting for Dremio to start..."
sleep 5
done
# Create admin user
echo "Creating Dremio Admin User..."
RESPONSE=$(curl -s -o /dev/null -w "%{http_code}" -X PUT "$DREMIO_URL/apiv2/bootstrap/firstuser" \
-H "Content-Type: application/json" \
-d "{
\"userName\": \"$ADMIN_USER\",
\"firstName\": \"$ADMIN_FIRST_NAME\",
\"lastName\": \"$ADMIN_LAST_NAME\",
\"email\": \"$ADMIN_EMAIL\",
\"password\": \"$ADMIN_PASSWORD\"
}")
if [ $RESPONSE -eq 200 ]; then
echo "Admin user created successfully!"
else
echo "Failed to create admin user. HTTP response: $RESPONSE"
exit 1
fi