Hi Vinod,

The value for the "conf" key has to be a key/value list itself. So for your
case it would look like this:

"conf": {"path": "/user/mydir"}

This is because everything is parsed as json by the rest api.

I hope that helps,
                                                                                
   
 Alex Bozarth                                                                   
   
 Software Engineer                                                              
   
 Spark Technology Center                                                        
   
                                                                                
   
                                                                                
     
                                                                                
     
                                                                                
     
 E-mail: [email protected]                                                    
     
 GitHub: github.com/ajbozarth                                                   
     
                                                                   505 Howard 
Street 
                                                             San Francisco, CA 
94105 
                                                                       United 
States 
                                                                                
     








From:   "Kaggal, Vinod C." <[email protected]>
To:     "[email protected]"
            <[email protected]>
Date:   01/17/2018 02:33 PM
Subject:        using conf parameter via REST



Hi!

In the “POST /batches” section, the documentation suggests that we can have
“conf” as part of the request body. Would you be able to direct me to an
example of how to post key=value as part of conf parameter?

This command works:

curl -X POST -u me https://<server>/knox/livy/v1/batches -H
'X-Requested-By: livy' -H 'cache-control: no-cache' -H 'content-type:
application/json' -d '{ "className": "mySparkClass", "file":
"/user/me/spark-utils/spark-utils-1.0.1-SNAPSHOT.jar", "executorMemory":
"512m", "driverMemory": "512m", "proxyUser": "me" }'


This is how I tried to add a conf parameter as step one which did not work:
curl -X POST -u me https://<server>/knox/livy/v1/batches -H
'X-Requested-By: livy' -H 'cache-control: no-cache' -H 'content-type:
application/json' -d '{ "className": "mySparkClass", "file":
"/user/me/spark-utils/spark-utils-1.0.1-SNAPSHOT.jar", "executorMemory":
"512m", "driverMemory": "512m", "proxyUser": "me",  "conf":
"path=/user/mydir"}'

How would I submit a map of key=val? Your help would be appreciated!

Thanks,
Vinod




Reply via email to