Created
November 15, 2020 19:43
-
-
Save marcelometal/40c4117b39a1178304c614e52ef784e7 to your computer and use it in GitHub Desktop.
Importar YAML para finance wallet API
This file contains hidden or 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
PURCHASES_TYPE="stocks fiis treasuries-direct certificates-of-deposit stocks-funds ficfi" | |
for X in $PURCHASES_TYPE; do | |
echo "Inserting $X data..."; | |
DATA=$(python3 -c 'import sys, yaml, json; json.dump(yaml.safe_load(sys.stdin), sys.stdout)' < $X.yaml | jq -c '.[]') | |
for ITEM in $DATA; do | |
curl -X POST "http://localhost:8889/api/v1/$X/operations" -H 'Content-Type: application/json' -d "$ITEM"; | |
done | |
echo "done!"; | |
echo ""; | |
echo ""; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment