From 5c6e845593b742e661530ce7b235e28f25a804da Mon Sep 17 00:00:00 2001 From: Michael Cambria Date: Tue, 16 Apr 2019 16:15:05 -0400 Subject: [PATCH] ReST curl examples --- add-cmd.json | 7 +++++++ check-cmd.json | 7 +++++++ del-cmd.json | 7 +++++++ using-curl.txt | 14 ++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 add-cmd.json create mode 100644 check-cmd.json create mode 100644 del-cmd.json create mode 100644 using-curl.txt 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 + + -- 2.44.0