[PMSH] Add ip to example event
[dcaegen2.git] / docs / sections / services / tca-cdap / development_info.rst
1 Compiling TCA
2 =============
3
4 TCA code is maintained under https://gerrit.onap.org/r/#/admin/projects/dcaegen2/analytics/tca 
5 To build just the TCA component, run the following maven command
6 `mvn clean install`   
7
8  
9 Maven GroupId
10 -------------
11
12 org.onap.dcaegen2.analytics.tca
13
14 Maven Parent ArtifactId
15 -----------------------
16 dcae-analytics
17
18 Maven Children Artifacts
19 ------------------------
20 1. dcae-analytics-test: Common test code for all DCAE Analytics Modules
21 2. dcae-analytics-model: Contains models (e.g. Common Event Format) which are common to DCAE Analytics
22 3. dcae-analytics-common: Contains Components common to all DCAE Analytics Modules - contains high level abstractions
23 4. dcae-analytics-dmaap: DMaaP(Data Movement as a Platform) MR (Message Router)API using AAF(Authentication and Authorization Framework)
24 5. dcae-analytics-tca: DCAE Analytics TCA (THRESHOLD CROSSING ALERT) Core
25 6. dcae-analytics-cdap-common: Common code for all cdap modules
26 7. dcae-analytics-cdap-tca: CDAP Flowlet implementation for TCA
27 8. dcae-analytics-cdap-plugins: CDAP Plugins
28 9. dcae-analytics-cdap-it: Cucumber and CDAP Pipeline integration tests
29
30
31 API Endpoints
32 -------------
33
34 For deployment into CDAP,  following API's can be used to deploy TCA application.
35
36 # create namespace
37 curl -X PUT http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo
38
39 # load artifact
40 curl -X POST --data-binary @/c/usr/tmp/dcae-analytics-cdap-tca-2.0.0-SNAPSHOT.jar http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/artifacts/dcae-analytics-cdap-tca
41
42 # create app
43 curl -X PUT -d @/c/usr/docs/ONAP/tca_app_config.json http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca
44
45 # load preferences
46 curl -X PUT -d @/c/usr/docs/ONAP/tca_app_preferences.json http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/preferences
47
48 # start program
49 curl -X POST http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/start
50 curl -X POST http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/start
51 curl -X POST http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/start
52
53 # check status
54 curl http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRPublisherWorker/status
55 curl http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/workers/TCADMaaPMRSubscriberWorker/status
56 curl http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/apps/dcae-tca/flows/TCAVESCollectorFlow/status
57
58 # Delete namespace (and all its content)
59 # curl -X DELETE http://<k8s-clusterIP>:11015/v3/unrecoverable/namespaces/cdap_tca_hi_lo
60
61 # Delete artifact
62 # curl -X DELETE http://<k8s-clusterIP>:11015/v3/namespaces/cdap_tca_hi_lo/artifacts/dcae-analytics-cdap-tca/versions/2.0.0.SNAPSHOT
63
64
65 TCA CDAP Container
66 ------------------
67 If new jar is generated, corresponding version should be updated into https://git.onap.org/dcaegen2/deployments/tree/tca-cdap-container.
68
69 Following files should be revised
70 - tca_app_config.json
71 - tca_app_preferences.json
72 - restart.sh
73