Last active
November 26, 2017 21:17
-
-
Save garystafford/e22d40c2846727842ec2e94ba0366d14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Demostrate API calls for REST HTTP IPC and RPC IPC via API Gateway | |
# Requires HTTPie | |
# Requires all services are running | |
set -e | |
HOST=${1:-localhost:8080} | |
API_GATEWAY="http://${HOST}" | |
ELECTION="2016%20Presidential%20Election" | |
echo "Simulating candidates..." | |
http ${API_GATEWAY}/candidate/simulation && sleep 2 | |
http ${API_GATEWAY}/candidate/candidates/summary/${ELECTION} && sleep 2 | |
echo "Simulating voting using REST HTTP IPC..." | |
http ${API_GATEWAY}/voter/simulation/http/${ELECTION} && sleep 2 | |
http ${API_GATEWAY}/voter/results && sleep 4 | |
http ${API_GATEWAY}/voter/winners && sleep 2 | |
echo "Simulating voting using message-based RPC IPC..." | |
http ${API_GATEWAY}/voter/simulation/rpc/${ELECTION} && sleep 2 | |
http ${API_GATEWAY}/voter/results && sleep 4 | |
http ${API_GATEWAY}/voter/winners && sleep 2 | |
echo "Script completed..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment