ReST curl examples
authorMichael Cambria <mcambria@redhat.com>
Tue, 16 Apr 2019 20:15:05 +0000 (16:15 -0400)
committerMichael Cambria <mcambria@redhat.com>
Tue, 16 Apr 2019 20:15:05 +0000 (16:15 -0400)
add-cmd.json [new file with mode: 0644]
check-cmd.json [new file with mode: 0644]
del-cmd.json [new file with mode: 0644]
using-curl.txt [new file with mode: 0644]

diff --git a/add-cmd.json b/add-cmd.json
new file mode 100644 (file)
index 0000000..999ea2c
--- /dev/null
@@ -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 (file)
index 0000000..1472257
--- /dev/null
@@ -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 (file)
index 0000000..65cbd7d
--- /dev/null
@@ -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 (file)
index 0000000..e7217f4
--- /dev/null
@@ -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 
+
+