-
Notifications
You must be signed in to change notification settings - Fork 8
cURL Script for Test Teams
echo THIS SCRIPT WILL CREATE A SMALL SUBSET OF THE TEAMS IN THE HARRY POTTER UNIVERSE
echo TO USE - CHANGE THE SERVER URL AS DESIRED AND COPY/PASTE THE ENTIRE FILE CONTENTS TO A CMD WINDOW ON A PC THAT HAS cURL INSTALLED
SET SERVER_URL="http://localhost:9000"
echo CREATING TEAMS
curl %SERVER_URL%/api/teams -H "Content-Type: application/json" -X POST -d "{"name":"Gryffindor","path":"/Gryffindor"}"
curl %SERVER_URL%/api/teams -H "Content-Type: application/json" -X POST -d "{"name":"Ravenclaw","path":"/Ravenclaw"}"
curl %SERVER_URL%/api/teams -H "Content-Type: application/json" -X POST -d "{"name":"Hufflepuff","path":"/Hufflepuff"}"
curl %SERVER_URL%/api/teams -H "Content-Type: application/json" -X POST -d "{"name":"Slytherin","path":"/Slytherin"}"
curl %SERVER_URL%/api/teams -H "Content-Type: application/json" -X POST -d "{"name":"Hogwarts","path":"/Hogwarts"}"
curl %SERVER_URL%/api/teams -H "Content-Type: application/json" -X POST -d "{"name":"Teachers","path":"/Hogwarts/Teachers"}"
echo CREATING PLAYERS
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Harry Potter","email":"harry.potter@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Hermione Granger","email":"hermione.granger@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Ron Weasley","email":"ron.weasley@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Neville Longbottom","email":"neville.longbottom@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Penelope Clearwater","email":"penelope.clearwater@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Marietta Edgecombe","email":"marietta.edgecombe@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Justin Finch-Fletchley","email":"justin.finch.fletchley@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Ernie Macmillan","email":"ernie.macmillan@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Draco Malfoy","email":"draco.malfoy@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Gregory Goyle","email":"gregory.goyle@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Pansy Parkinson","email":"pansy.parkinson@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Filius Flitwick","email":"filius.flitwick@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Rubeus Hagrid","email":"rubeus.hagrid@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Gilderoy Lockhart","email":"gilderoy.lockhart@gmail.com"}"
curl %SERVER_URL%/api/players -H "Content-Type: application/json" -X POST -d "{"name":"Albus Dumbledore","email":"albus.dumbledore@gmail.com"}"
echo ASSIGNING PLAYERS TO TEAMS
curl %SERVER_URL%/api/players/harry.potter@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Gryffindor"}"
curl %SERVER_URL%/api/players/hermione.granger@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Gryffindor"}"
curl %SERVER_URL%/api/players/ron.weasley@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Gryffindor"}"
curl %SERVER_URL%/api/players/neville.longbottom@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Gryffindor"}"
curl %SERVER_URL%/api/players/penelope.clearwater@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Ravenclaw"}"
curl %SERVER_URL%/api/players/marietta.edgecombe@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Ravenclaw"}"
curl %SERVER_URL%/api/players/justin.finch.fletchley@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Hufflepuff"}"
curl %SERVER_URL%/api/players/ernie.macmillan@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Hufflepuff"}"
curl %SERVER_URL%/api/players/draco.malfoy@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Slytherin"}"
curl %SERVER_URL%/api/players/gregory.goyle@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Slytherin"}"
curl %SERVER_URL%/api/players/pansy.parkinson@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Slytherin"}"
curl %SERVER_URL%/api/players/filius.flitwick@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Hogwarts/Teachers"}"
curl %SERVER_URL%/api/players/rubeus.hagrid@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Hogwarts/Teachers"}"
curl %SERVER_URL%/api/players/gilderoy.lockhart@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Hogwarts/Teachers"}"
curl %SERVER_URL%/api/players/albus.dumbledore@gmail.com -H "Content-Type: application/json" -X PUT -d "{"_team":"/Hogwarts"}"
echo done :)