Cdap REST apis for load artifact

333 views
Skip to first unread message

djsharma

unread,
May 9, 2017, 4:28:02 AM5/9/17
to CDAP User
Hi,

I am trying to use cdap rest apis to load artifact jar and json. Some automation i am trying to do thats why not using anyother way. I gone through the document but its not clear where to keep artifact jar and json files and then use the rest api for USER as well as SYSTEM artifacts. 
I kept jar and json in /artifacts of cdap and made rest api request POST /v3/namespaces/<namespace-id>/artifacts/<artifact-name>
as specified in documentation. Response is 400 "Artifact is not in zip format. Please make sure it is a jar file".


Thanks and regards
Dhananjay 

Nitin Motgi

unread,
May 9, 2017, 4:36:55 AM5/9/17
to cdap...@googlegroups.com
Hi Dhananjay,

If you have placed the jar and json in the artifact directory of CDAP, then the artifacts are automatically considered SYSTEM by CDAP and they available across all the namespaces. They will be loaded during the start of the system or you can use the API to trigger the load. 

Here is the API to do so : 


Note : you dont need load the individual artifact using REST if in artifact directory. 

But, please remember that if you are in development stage of plugin this might be might not be an efficient way. 

Another way is to deploy artifact as USER using the rest APIs in which case the jar and json can be in any directory. Using the API you would upload it to CDAP. 

Could you please the list of files in the artifact directory ?

Thanks,
Nitin 
--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To post to this group, send email to cdap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/80c17df0-3bb4-4516-87e8-174dc8345d5d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

djsharma

unread,
May 9, 2017, 5:14:01 AM5/9/17
to CDAP User
Below are the list of artifacts in directory. I want to load custombox plugin via rest api. Can you help me out to sketch api request for this case.


cdap-data-pipeline-4.1.1.jar  hashing-tf-feature-generator-
plugin-1.0.0.jar   kafka-plugins-1.6.1.jar                          spark-plugins-1.6.1.jar
cdap-data-quality-4.1.1.jar   hashing-tf-feature-generator-plugin-1.0.0.json  kafka-plugins-1.6.1.json                         spark-plugins-1.6.1.json
cdap-data-streams-4.1.1.jar   hbase-plugins-1.6.1.jar                         logistic-regression-analytics-plugin-1.0.0.jar   tokenizer-plugin-1.0.0.jar
cdap-etl-batch-4.1.1.jar      hbase-plugins-1.6.1.json                        logistic-regression-analytics-plugin-1.0.0.json  tokenizer-plugin-1.0.0.json
cdap-etl-realtime-4.1.1.jar   hdfs-plugins-1.6.1.jar                          naive-bayes-analytics-plugin-1.0.0.jar           tracker-0.4.0.jar
core-plugins-1.6.1.jar        hdfs-plugins-1.6.1.json                         naive-bayes-analytics-plugin-1.0.0.json          transform-plugins-1.6.1.jar
core-plugins-1.6.1.json       http-plugins-1.6.1.jar                          navigator-0.5.0.jar                              transform-plugins-1.6.1.json
database-plugins-1.6.1.jar    http-plugins-1.6.1.json                         RealtimeSource-sparkSource-1.0.0.jar             wrangler-core-1.3.0.jar
database-plugins-1.6.1.json   hydrator-common-1.6.1.jar                       RealtimeSource-sparkSource-1.0.0.json            wrangler-service-1.3.0.jar
custombox-1.0-SNAPSHOT.jar       hydrator-common-1.6.1.json                      skipgram-analytics-plugin-1.0.0.jar              wrangler-transform-1.3.0.jar
custombox-1.0-SNAPSHOT.json      hydrator-plugins-1.6.1.json                     skipgram-analytics-plugin-1.0.0.json             wrangler-transform-1.3.0.json

Sreevatsan Raman

unread,
May 9, 2017, 8:49:44 PM5/9/17
to cdap...@googlegroups.com
Hi Dhananjay,

Below are the list of artifacts in directory. I want to load custombox plugin via rest api. Can you help me out to sketch api request for this case.

As Nitin mentioned, if you place the plugin jar and json in artifacts directory - upon restarting CDAP the plugins are automatically loaded. You can also reload the artifacts without having to restart CDAP by hitting the following end point - 


Hope it helps. 

Thanks,
Sree


To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+unsubscribe@googlegroups.com.

To post to this group, send email to cdap...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages