blob: 50739f536dd47e91d3d138ae94ad4c02f9d2a9ea (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/bin/bash
set -e
HOST=${HOST:-localhost}
# Check features
curl -s -H "Content-Type: application/json" http://$HOST:8080/features \
| grep -qs '["realm"]'
# Create a host
curl -H "Content-Type: application/json" -dhostname=foo -duserclass=bar -X POST "http://$HOST:8080/realm/example.com"
echo
curl -H "Content-Type: application/json" -X DELETE "http://$HOST:8080/realm/example.com/foo"
# Removing nonexistent host is o.k.
curl -H "Content-Type: application/json" -X DELETE "http://$HOST:8080/realm/example.com/foo"
|