I would think it may be the multipart entry. I would just post the json
data as part of the body of the post message. Here is an example curl that
works.
curl -X POST -H "Authorization: Basic bWFwcjpyb290NG1hcHI=" -H
"Content-Type: application/json" -d
'{"name":"nfl","config":{"type":"file","enabled":true,"connection":"maprfs:///","workspaces":{"views":{"location":"/mapr/
demo.mapr.com/data/views
","writable":true,"defaultInputFormat":null},"json":{"location":"/mapr/
demo.mapr.com/data/nfl/json
","writable":false,"defaultInputFormat":"json"},"csv":{"location":"/mapr/
demo.mapr.com/data/nfl/csv
","writable":false,"defaultInputFormat":"csv"},"tab":{"location":"/mapr/
demo.mapr.com/data/nfl/txt
","writable":false,"defaultInputFormat":"tsv"},"xml":{"location":"/mapr/
demo.mapr.com/data/nfl/xml
","writable":false,"defaultInputFormat":null}},"formats":{"csv":{"type":"text","extensions":["csv"],"delimiter":","},"tsv":{"type":"text","extensions":["tsv","txt"],"delimiter":"\t"},"json":{"type":"json"}}}}'
http://maprdemo:8047/storage/nfl.json
On Fri, Jul 10, 2015 at 7:41 AM, Hafiz Mujadid <[email protected]>
wrote:
> Thanks jim!
>
> I am calling this rest api from java code but getting bad request. My code
> is written as in this stackoverflow question
>
>
> http://stackoverflow.com/questions/31340731/java-api-to-add-storage-plugin-in-apache-drill
>
>
>
>
> On Fri, Jul 10, 2015 at 5:31 PM, Jim Bates <[email protected]> wrote:
>
> > Are you asking to configure a new storage plugin? Not sure abut a
> specific
> > java API process but you could easily use the REST API.
> >
> > POST /storage/my_stodrge_plugin.json HTTP/1.1
> > Host: maprdemo:8047
> > Content-Type: application/json
> >
> > {
> > "name" : "my_plugin",
> > "config" : {
> > "type" : "file",
> > "enabled" : false,
> > "connection" : "maprfs:///",
> > "workspaces" : null,
> > "formats" : null
> > }
> > }
> >
> > On Fri, Jul 10, 2015 at 7:13 AM, Hafiz Mujadid <[email protected]
> >
> > wrote:
> >
> > > Hi all!
> > >
> > > Is there any way to add a new storage plugin using java api?
> > >
> > >
> > > Thanks
> > >
> >
>
>
>
> --
> Regards: HAFIZ MUJADID
>