mirror of
https://github.com/alibaba/arthas.git
synced 2026-10-21 08:04:33 +00:00
Add http api test scripts
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
###
|
||||
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "init_session"
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "join_session",
|
||||
"sessionId":"c8940459-dacb-4798-b721-7f58728b76c8"
|
||||
}
|
||||
|
||||
###
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "async_exec",
|
||||
"command": "watch demo.MathGame primeFactors 'params' -n 3 ",
|
||||
"sessionId":"8132aa34-3e9a-477d-b20d-488032ba76b2"
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "async_exec",
|
||||
"command": "version ",
|
||||
"sessionId":"c8940459-dacb-4798-b721-7f58728b76c8"
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "async_exec",
|
||||
"command": "session ",
|
||||
"sessionId":"c8940459-dacb-4798-b721-7f58728b76c8"
|
||||
}
|
||||
|
||||
###
|
||||
### SYNC REST API
|
||||
###
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "exec",
|
||||
"command": "watch demo.MathGame primeFactors 'params' -n 3 ",
|
||||
"sessionId":"8132aa34-3e9a-477d-b20d-488032ba76b2"
|
||||
}
|
||||
|
||||
###
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "exec",
|
||||
"command": "session",
|
||||
"sessionId":"8132aa34-3e9a-477d-b20d-488032ba76b2"
|
||||
}
|
||||
|
||||
###
|
||||
POST http://localhost:8563/api
|
||||
Accept: */*
|
||||
Cache-Control: no-cache
|
||||
|
||||
{
|
||||
"action": "exec",
|
||||
"command": "version",
|
||||
"sessionId":"8132aa34-3e9a-477d-b20d-488032ba76b2"
|
||||
}
|
||||
|
||||
###
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
sum=0
|
||||
i=1
|
||||
while(( i <= 100 ))
|
||||
do
|
||||
let "i += 1"
|
||||
curl -XPOST http://localhost:8563/api -d @<(cat << EOF
|
||||
{
|
||||
"action": "pull_results",
|
||||
"sessionId":"$1",
|
||||
"consumerId": "$2"
|
||||
}
|
||||
EOF)
|
||||
|
||||
echo ""
|
||||
|
||||
done
|
||||
|
||||
echo "count=$i"
|
||||
Reference in New Issue
Block a user