Created
February 4, 2016 13:10
-
-
Save relaxnow/ce462a4d2e11f0a9d7c0 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
getConnection () | |
{ | |
curl -v -k -u engine:engineblock -H "Content-Type: application/json" -X GET https://serviceregistry.demo.openconext.org/janus/app_dev.php/api/connections/15.json | |
} | |
jqModify () | |
{ | |
# jq 'def key_contains: .key | contains(":sn") | not ; def filter_key(f): f | to_entries | map(select(key_contains)) | from_entries ; .arpAttributes = filter_key(.arpAttributes)' | |
jq . | |
} | |
putConnection () | |
{ | |
curl -v -k -u engine:engineblock -H "Content-Type: application/json" -X PUT -d @- https://serviceregistry.demo.openconext.org/janus/app_dev.php/api/connections/15.json | |
} | |
jqShow() | |
{ | |
jq '.' | |
} | |
#getConnection | jqShow > /tmp/jq.first | |
getConnection | putConnection | |
#getConnection | jqModify | tee /dev/stderr | putConnection | |
#getConnection | jqShow > /tmp/jq.second | |
#diff /tmp/jq.first /tmp/jq.second | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test querying the janus REST API with jq