NOTE: elasticsearch and hbase should be running first.
$ sbt/sbt "tools/compile" $ set -a $ source conf/pio-env.sh $ set +a $ sbt/sbt "tools/runMain org.apache.predictionio.tools.admin.AdminRun"
$ set -a $ source conf/pio-env.sh $ set +a $ sbt/sbt "tools/testOnly org.apache.predictionio.tools.admin.AdminAPISpec"
$ pio adminserver
Admin Server url defaults to http://localhost:7071
The host and port can be specified by using the ‘ip’ and ‘port’ parameters
$ pio adminserver --ip 127.0.0.1 --port 7080
$ curl -i http://localhost:7071/ {"status":"alive"}
$ curl -i -X GET http://localhost:7071/cmd/app {"status":1,"message":"Successful retrieved app list.","apps":[{"id":12,"name":"scratch","keys":[{"key":"gtPgVMIr3uthus1QJWFBcIjNf6d1SNuhaOWQAgdLbOBP1eRWMNIJWl6SkHgI1OoN","appid":12,"events":[]}]},{"id":17,"name":"test-ecommercerec","keys":[{"key":"zPkr6sBwQoBwBjVHK2hsF9u26L38ARSe19QzkdYentuomCtYSuH0vXP5fq7advo4","appid":17,"events":[]}]}]}
$ curl -i -X POST http://localhost:7071/cmd/app \ -H "Content-Type: application/json" \ -d '{ "name" : "my_new_app" }' {"status":1,"message":"App created successfully.","id":19,"name":"my_new_app","keys":[{"key":"","appid":19,"events":[]}]}
$ curl -i -X DELETE http://localhost:7071/cmd/app/my_new_app/data
$ curl -i -X DELETE http://localhost:7071/cmd/app/my_new_app {"status":1,"message":"App successfully deleted"}
GET http://localhost:7071/cmd/app
OK Response: { “status”: , “message”: , “apps” : [ { “name': “<APP_NAME>”, “id': <APP_ID>, “accessKey' : “<ACCESS_KEY>” }, { “name': “<APP_NAME>”, “id': <APP_ID>, “accessKey' : “<ACCESS_KEY>” }, ... ] }
Error Response: {“status”: , “message” : “”}
POST http://localhost:7071/cmd/app Request Body: { name”: “<APP_NAME>”, // required “id”: <APP_ID>, // optional “description”: “” } // optional
OK Response: { “status”: , “message”: , “app” : { “name”: “<APP_NAME>”, “id”: <APP_ID>, “accessKey” : “<ACCESS_KEY>” } }
Error Response: { “status”: , “message” : “”}
DELETE http://localhost:7071/cmd/app/{appName}
OK Response: { “status”: , “message” : “”}
Error Response: { “status”: , “message” : “”}
DELETE http://localhost:7071/cmd/app/{appName}/data
OK Response: { “status”: , “message” : “”}
Error Response: { “status”: , “message” : “” }
POST http://localhost:7071/cmd/train Request body: TBD
OK Response: TBD
Error Response: TBD
GET http://localhost:7071/cmd/train/{engineInstanceId}
OK Response: TBD INIT TRAINING DONE ERROR
Error Response: TBD