Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
@relaxnow
Copy link
Author

relaxnow commented Feb 4, 2016

Test querying the janus REST API with jq

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment