- Home
 
          - Resources
 
          - SessionResource
 
        
      
      Session resource api
This provides api for all things in session.
      
        GET /session 
        API to know if session service is up and running
        
          Response Body
          
          
            | media type | 
            data type | 
            description | 
          
          
          
          
            | text/plain | 
            (custom)
 | 
            Simple text saying it up | 
          
          
        
       
      
        POST /session 
        Create a new session with Lens server.
        
          Request Parameters
          
          
            | name | 
            type | 
            description | 
            default | 
          
          
          
          
            | database | 
            formdata | 
            Set current database to the supplied value, if provided | 
             | 
          
          
            | password | 
            formdata | 
            Password of the Lens server user | 
              | 
          
          
            | sessionconf | 
            formdata | 
            Key-value properties which will be used to configure this session | 
              | 
          
          
            | username | 
            formdata | 
            User name of the Lens server user | 
              | 
          
          
        
        
       
      
        DELETE /session 
        Close a Lens server session.
        
          Request Parameters
          
          
            | name | 
            type | 
            description | 
          
          
          
          
            | sessionid | 
            query | 
            Session handle object of the session to be closed | 
          
          
        
        
          Response Body
          
          
            | media type | 
            data type | 
            description | 
          
          
          
          
            | application/json | 
            APIResult
 (JSON) | 
            APIResult object indicating if the operation was successful (check result.getStatus()) | 
          
          
            | application/json | 
            APIResult
 (JSON) | 
          
          
            | application/xml | 
            APIResult
 (XML) | 
          
          
            | text/plain | 
            (custom)
 | 
          
          
        
       
      
        PUT /session/resources/add 
        Add a resource to the session to all LensServices running in this Lens server
The returned @{link APIResult} will have status SUCCEEDED only if the add operation was successful for all
services running in this Lens server.
        
          Request Parameters
          
          
            | name | 
            type | 
            description | 
          
          
          
          
            | path | 
            formdata | 
            path of the resource | 
          
          
            | sessionid | 
            formdata | 
            session handle object | 
          
          
            | type | 
            formdata | 
            The type of resource. Valid types are 'jar', 'file' and 'archive' | 
          
          
        
        
          Response Body
          
          
            | media type | 
            data type | 
            description | 
          
          
          
          
            | application/json | 
            APIResult
 (JSON) | 
            APIResult with state Status#SUCCEEDED, if add was successful. APIResult with state
Status#PARTIAL, if add succeeded only for some services. APIResult with state
Status#FAILED, if add has failed | 
          
          
            | application/json | 
            APIResult
 (JSON) | 
          
          
            | application/xml | 
            APIResult
 (XML) | 
          
          
            | text/plain | 
            (custom)
 | 
          
          
        
       
      
        GET /session/resources/list 
        Lists resources from the session for a given resource type.
        
          Request Parameters
          
          
            | name | 
            type | 
            description | 
          
          
          
          
            | sessionid | 
            query | 
            session handle object | 
          
          
            | type | 
            query | 
            resource type. It can be jar, file or null | 
          
          
        
        
          Response Body
          
          
            | media type | 
            data type | 
            description | 
          
          
          
          
            | application/json | 
            StringList
 (JSON) | 
            Lists all resources for a given resource type
Lists all resources if the resource type is not specified | 
          
          
            | application/json | 
            StringList
 (JSON) | 
          
          
            | application/xml | 
            stringList
 (XML) | 
          
          
            | text/plain | 
            (custom)
 | 
          
          
        
       
      
        PUT /session/resources/delete 
        Delete a resource from sesssion from all the @{link LensService}s running in this Lens server
Similar to addResource, this call is successful only if resource was deleted from all services.
        
          Request Parameters
          
          
            | name | 
            type | 
            description | 
          
          
          
          
            | path | 
            formdata | 
            path of the resource to be deleted | 
          
          
            | sessionid | 
            formdata | 
            session handle object | 
          
          
            | type | 
            formdata | 
            The type of resource. Valid types are 'jar', 'file' and 'archive' | 
          
          
        
        
          Response Body
          
          
            | media type | 
            data type | 
            description | 
          
          
          
          
            | application/json | 
            APIResult
 (JSON) | 
            APIResult with state Status#SUCCEEDED, if delete was successful. APIResult with
state Status#PARTIAL, if delete succeeded only for some services. APIResult with state
Status#FAILED, if delete has failed | 
          
          
            | application/json | 
            APIResult
 (JSON) | 
          
          
            | application/xml | 
            APIResult
 (XML) | 
          
          
            | text/plain | 
            (custom)
 | 
          
          
        
       
      
        GET /session/params 
        Get a list of key=value parameters set for this session.
        
          Request Parameters
          
          
            | name | 
            type | 
            description | 
            default | 
            constraints | 
          
          
          
          
            | key | 
            query | 
            if this is empty, output will contain all parameters and their values,
if it is non empty parameters will be filtered by key | 
             | 
              | 
          
          
            | sessionid | 
            query | 
            session handle object | 
              | 
              | 
          
          
            | verbose | 
            query | 
            If true, all the parameters will be returned. If false, configuration parameters will be returned | 
            false | 
            boolean | 
          
          
        
        
          Response Body
          
          
            | media type | 
            data type | 
            description | 
          
          
          
          
            | application/json | 
            StringList
 (JSON) | 
            List of Strings, one entry per key-value pair | 
          
          
            | application/json | 
            StringList
 (JSON) | 
          
          
            | application/xml | 
            stringList
 (XML) | 
          
          
            | text/plain | 
            (custom)
 | 
          
          
        
       
      
        PUT /session/params 
        Set value for a parameter specified by key
The parameters can be a hive variable or a configuration. To set key as a hive variable, the key should be prefixed
with 'hivevar:'. To set key as configuration parameter, the key should be prefixed with 'hiveconf:' If no prefix is
attached, the parameter is set as configuration.
        
          Request Parameters
          
          
            | name | 
            type | 
            description | 
          
          
          
          
            | key | 
            formdata | 
            parameter key | 
          
          
            | sessionid | 
            formdata | 
            session handle object | 
          
          
            | value | 
            formdata | 
            parameter value | 
          
          
        
        
          Response Body
          
          
            | media type | 
            data type | 
            description | 
          
          
          
          
            | application/json | 
            APIResult
 (JSON) | 
            APIResult object indicating if set operation was successful | 
          
          
            | application/json | 
            APIResult
 (JSON) | 
          
          
            | application/xml | 
            APIResult
 (XML) | 
          
          
            | text/plain | 
            (custom)
 |