Commit a072e7b8 authored by Pavel Spirek's avatar Pavel Spirek

Errors properly reported for all HTTP methods, many improvements and stability fixes

parent 33f7f36e
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
CLIENT_CERT="/home/pspirek/sslclient/pavel_curl.pem"
echo "--- conf-start 1"
POST_DATA='{ "jetconf:input": {"name": "Edit 1", "options": "config"} }'
URL="https://127.0.0.1:8443/restconf/operations/jetconf:conf-start"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST -d "$POST_DATA" "$URL" 2>/dev/null
echo "--- POST new zone"
POST_DATA='{"zone": {"domain": "newzone.cz"}}'
URL="https://127.0.0.1:8443/restconf/data/dns-server:dns-server/zones"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST -d "$POST_DATA" "$URL" 2>/dev/null
echo "--- conf-commit"
URL="https://127.0.0.1:8443/restconf/operations/jetconf:conf-commit"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST "$URL" 2>/dev/null
sleep 2
echo "--- zone conf-start 1"
POST_DATA='{ "jetconf:input": {"name": "Zone data edit 1", "options": "zone"} }'
URL="https://127.0.0.1:8443/restconf/operations/jetconf:conf-start"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST -d "$POST_DATA" "$URL" 2>/dev/null
echo "--- POST new zone SOA"
POST_DATA='{"zone": {"name": "newzone.cz", "class": "IN", "default-ttl": 3611, "SOA": {"mname": "dns1.newzone.cz","rname": "hostmaster.newzone.cz","serial": 20160622,"refresh": 200,"retry": 300,"expire": 400,"minimum": 500}}}'
URL="https://127.0.0.1:8443/restconf/data/dns-zones:zone-data"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST -d "$POST_DATA" "$URL" 2>/dev/null
echo "--- POST new zone A"
POST_DATA='{"rrset": {"owner": "sub", "type": "iana-dns-parameters:A", "rdata": [{"id": "1", "A": { "address": "192.168.100.100"}}]}}'
URL="https://127.0.0.1:8443/restconf/data/dns-zones:zone-data/zone=newzone.cz,IN"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST -d "$POST_DATA" "$URL" 2>/dev/null
echo "--- POST new zone A 2"
POST_DATA='{"rdata": {"id": "2", "A": { "address": "192.168.100.101"}}}'
URL="https://127.0.0.1:8443/restconf/data/dns-zones:zone-data/zone=newzone.cz,IN/rrset=sub,iana-dns-parameters:A"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST -d "$POST_DATA" "$URL" 2>/dev/null
echo "--- conf-list"
URL="https://127.0.0.1:8443/restconf/operations/jetconf:conf-list"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST "$URL" 2>/dev/null
echo "--- conf-commit"
URL="https://127.0.0.1:8443/restconf/operations/jetconf:conf-commit"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST "$URL" 2>/dev/null
echo "--- GET zones"
URL="https://127.0.0.1:8443/restconf/data/dns-zones:zone-data/zone=newzone.cz,IN"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X GET "$URL" 2>/dev/null
#!/bin/bash
CLIENT_CERT="/home/pspirek/sslclient/pavel_curl.pem"
echo "--- zone conf-start 1"
POST_DATA='{ "dns-server:input": {"name": "Zone data edit 1"} }'
URL="https://127.0.0.1:8443/restconf/operations/dns-server:conf-start"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST -d "$POST_DATA" "$URL" 2>/dev/null
#echo "--- DEL new zone A"
#URL="https://127.0.0.1:8443/restconf/data/dns-zones:zone-data/zone=newzone.cz,IN/rrset=sub,iana-dns-parameters:A"
#curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X DELETE "$URL" 2>/dev/null
echo "--- DEL new zone A"
URL="https://127.0.0.1:8443/restconf/data/dns-zones:zone-data/zone=newzone.cz,IN/rrset=sub,iana-dns-parameters:A/rdata=1"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X DELETE "$URL" 2>/dev/null
echo "--- zone conf-commit"
URL="https://127.0.0.1:8443/restconf/operations/dns-server:conf-commit"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X POST "$URL" 2>/dev/null
echo "--- GET new zone"
URL="https://127.0.0.1:8443/restconf/data/dns-zones:zone-data/zone=newzone.cz,IN"
curl -v --http2 -k --cert-type PEM -E $CLIENT_CERT -X GET "$URL" 2>/dev/null
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment