From: Michael Cambria Date: Tue, 16 Apr 2019 20:15:05 +0000 (-0400) Subject: ReST curl examples X-Git-Url: https://git.halfball.org/?a=commitdiff_plain;h=5c6e845593b742e661530ce7b235e28f25a804da;p=demo-grpc.git ReST curl examples --- diff --git a/add-cmd.json b/add-cmd.json new file mode 100644 index 0000000..999ea2c --- /dev/null +++ b/add-cmd.json @@ -0,0 +1,7 @@ + +{"cmd":"ADD", +"ifName": "ensY", +"containerID": "ContainerTwo", +"netNS": "mcc-test-2", +"stdIn": "stdInStrTwo" +} diff --git a/check-cmd.json b/check-cmd.json new file mode 100644 index 0000000..1472257 --- /dev/null +++ b/check-cmd.json @@ -0,0 +1,7 @@ + +{"cmd":"CHECK", +"ifName": "ensY", +"containerID": "ContainerTwo", +"netNS": "mcc-test-2", +"stdIn": "stdInStrTwo" +} diff --git a/del-cmd.json b/del-cmd.json new file mode 100644 index 0000000..65cbd7d --- /dev/null +++ b/del-cmd.json @@ -0,0 +1,7 @@ + +{"cmd":"DEL", +"ifName": "ensY", +"containerID": "ContainerTwo", +"netNS": "mcc-test-2", +"stdIn": "stdInStrTwo" +} diff --git a/using-curl.txt b/using-curl.txt new file mode 100644 index 0000000..e7217f4 --- /dev/null +++ b/using-curl.txt @@ -0,0 +1,14 @@ + +curl -H "login:john" -H "password:doe" -X POST -d '{"cmd":"CHECK", "ifName": "ensY", "netNS": "mcc-test-0"}' 'http://localhost:7778/1/cni' + +curl -H "login:john" -H "password:doe" -X POST 'http://localhost:7778/1/cni' -d @add-cmd.json --header "Content-Type: application/json" + +Use these: + +curl -H "login:john" -H "password:doe" --header "Content-Type: application/json" -X POST 'http://localhost:7778/1/cni' -d @add-cmd.json + +curl -H "login:john" -H "password:doe" --header "Content-Type: application/json" -X POST 'http://localhost:7778/1/cni' -d @check-cmd.json + +curl -H "login:john" -H "password:doe" --header "Content-Type: application/json" -X POST 'http://localhost:7778/1/cni' -d @del-cmd.json + +