测试Eagle自定义Application

参考Eagle文档测试自定义Application
文档:https://eagle.apache.org/docs/latest/developing-application/

文档中介绍了自定义Application的代码结构,以及通过curl方式新建site和安装Application

1、新建Site:

  curl -H "Content-Type: application/json" -X POST  http://localhost:9090/rest/sites --data '{
       "siteId":"test_site",
       "siteName":"Test Site",
       "description":"This is a sample site for test",
       "context":{
            "type":"FAKE_CLUSTER",
            "url":"http://localhost:9090",
            "version":"2.6.4",
            "additional_attr":"Some information about the face cluster site"
       }
  }'

2、添加Application

 curl -H "Content-Type: application/json" -X POST http://localhost:9090/rest/apps/install --data '{
       "siteId":"test_site",
       "appType":"EXAMPLE_APPLICATION",
       "mode":"LOCAL"
  }'

3、改为页面中存在的Application创建成功:


添加HDFS_AUDIT_LOG_MONITOR_APP成功

curl -H "Content-Type: application/json" -X POST http://localhost:9090/rest/apps/install --data '{
       "siteId":"test_site",
       "appType":"HDFS_AUDIT_LOG_MONITOR_APP",
       "mode":"LOCAL"
  }'

4、删除site,要先把site中的Application先删除

curl -XDELETE http://localhost:9090/rest/sites/test_site

5、删除Application:

curl  -H "Content-Type: application/json"  -XDELETE http://localhost:9090/rest/apps/uninstall --data '{
 "uuid": "cce81cb9-2692-4405-b5c1-f395a95c5c29"
}'
注意: -H "Content-Type: application/json"  不能少,否则没效果

6、启动

curl -H "Content-Type: application/json" –XPOST http://localhost:9090/rest/apps/start --data '{
     "uuid":"cce81cb9-2692-4405-b5c1-f395a95c5c29"
}'

7、停止

curl -H "Content-Type: application/json"  -XPOST http://localhost:9090/rest/apps/stop --data '{
 "uuid":"cce81cb9-2692-4405-b5c1-f395a95c5c29"
}'

猜你喜欢

转载自blog.csdn.net/zwahut/article/details/90603159