SessionResource
Session resource api
This provides api for all things in session.The following resources are applicable:
/session
Mount Point: /session
The following operations are supported on this resource:
GET
API to know if session service is up and running
Response Body
element: | (custom) |
media types: | text/plain |
Simple text saying it up
POST
Create a new session with Lens server.
Parameters
name | description | type | default |
---|---|---|---|
username | User name of the Lens server user | formdata | |
password | Password of the Lens server user | formdata | |
database | Set current database to the supplied value, if provided | formdata | |
sessionconf | Key-value properties which will be used to configure this session | formdata |
Response Body
element: | lensSessionHandle |
media types: | application/xml text/plain application/json |
A Session handle unique to this session
DELETE
Close a Lens server session.
Parameters
name | description | type | default |
---|---|---|---|
sessionid | Session handle object of the session to be closed | query |
Response Body
element: | result |
media types: | application/xml text/plain application/json |
APIResult object indicating if the operation was successful (check result.getStatus())
/session/params
Mount Point: /session/params
GET
Get a list of key=value parameters set for this session.
Parameters
name | description | type | default |
---|---|---|---|
sessionid | session handle object | query | |
verbose | If true, all the parameters will be returned. If false, configuration parameters will be returned | query | false |
key | if this is empty, output will contain all parameters and their values, if it is non empty parameters will be filtered by key | query |
Response Body
element: | stringList |
media types: | application/xml text/plain application/json |
List of Strings, one entry per key-value pair
PUT
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.Parameters
name | description | type | default |
---|---|---|---|
sessionid | session handle object | formdata | |
key | parameter key | formdata | |
value | parameter value | formdata |
Response Body
element: | result |
media types: | application/xml text/plain application/json |
APIResult object indicating if set operation was successful
/session/resources/add
Mount Point: /session/resources/add
PUT
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.
Parameters
name | description | type | default |
---|---|---|---|
sessionid | session handle object | formdata | |
type | The type of resource. Valid types are 'jar', 'file' and 'archive' | formdata | |
path | path of the resource | formdata |
Response Body
element: | result |
media types: | application/xml text/plain application/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
/session/resources/delete
Mount Point: /session/resources/delete
PUT
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.
Parameters
name | description | type | default |
---|---|---|---|
sessionid | session handle object | formdata | |
type | The type of resource. Valid types are 'jar', 'file' and 'archive' | formdata | |
path | path of the resource to be deleted | formdata |
Response Body
element: | result |
media types: | application/xml text/plain application/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
/session/resources/list
Mount Point: /session/resources/list
GET
Lists resources from the session for a given resource type.
Parameters
name | description | type | default |
---|---|---|---|
sessionid | session handle object | query | |
type | resource type. It can be jar, file or null | query |
Response Body
element: | stringList |
media types: | application/xml text/plain application/json |
Lists all resources for a given resource type Lists all resources if the resource type is not specified