echo "Register Schema"
curl --digest -u user:user -XPUT --data-binary "@schema.proto" -H "Content-type: text/plain"  http://127.0.0.1:11222/rest/v2/schemas/schema.proto

echo "Creating cache"
curl --digest -u user:user -H "Content-Type: application/json" --data-binary "@cache.json"  http://127.0.0.1:11222/rest/v2/caches/players-shots

for i in {0..600}
do
  human=false
  shot=HIT
  if (( $i % 2 )); then
       human=true 
       shot=MISS
  fi
  curl -v --digest -u user:user -H "Content-type: application/json" -XPOST -d '{"_type": "com.redhat.Shot","userId": "'"$i"'","matchId": "6Sqs_Vq3cUCLUBhbR23L_'"$i"'","gameId": "d8c5c07a6db67c89'"$i"'","human": '"$human"',"timestamp": '"$i"',"shotType": "'"$shot"'"}' http://127.0.0.1:11222/rest/v2/caches/players-shots/$i

  #echo  '{"_type": "com.redhat.Shot","userId": "'"$i"'","matchId": "6Sqs_Vq3cUCLUBhbR23L_'"$i"'","gameId": "d8c5c07a6db67c89'"$i"'","human": '"$human"',"timestamp": '"$i"',"shotType": "'"$shot"'"}'
done
