Session resource api
This provides api for all things in session.API to know if session service is up and running
media type | data type | description |
---|---|---|
text/plain | (custom) | Simple text saying it up |
GET /session Accept: text/plain
HTTP/1.1 200 OK
Content-Type: text/plain
...
Create a new session with Lens server.
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 |
media type | data type |
---|---|
multipart/form-data | (custom) |
media type | data type | description |
---|---|---|
application/json | LensSessionHandle (JSON) | A Session handle unique to this session |
application/json | LensSessionHandle (JSON) | |
application/xml | lensSessionHandle (XML) | |
text/plain | (custom) |
POST /session Accept: application/json
HTTP/1.1 201 Created
Content-Type: application/json
{
"publicId" : "...",
"secretId" : "..."
}
Close a Lens server session.
name | type | description |
---|---|---|
sessionid | query | Session handle object of the session to be closed |
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) |
DELETE /session Accept: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
{
"status" : "PARTIAL",
"message" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
}
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.
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' |
media type | data type |
---|---|
multipart/form-data | (custom) |
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) |
PUT /session/resources/add Accept: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
{
"status" : "SUCCEEDED",
"message" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
}
Lists resources from the session for a given resource type.
name | type | description |
---|---|---|
sessionid | query | session handle object |
type | query | resource type. It can be jar, file or null |
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) |
GET /session/resources/list Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"elements" : [ [ "...", "..." ], [ "...", "..." ] ]
}
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.
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' |
media type | data type |
---|---|
multipart/form-data | (custom) |
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) |
PUT /session/resources/delete Accept: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
{
"status" : "SUCCEEDED",
"message" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
}
Get a list of key=value parameters set for this session.
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 |
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) |
GET /session/params Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"elements" : [ [ "...", "..." ], [ "...", "..." ] ]
}
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.name | type | description |
---|---|---|
key | formdata | parameter key |
sessionid | formdata | session handle object |
value | formdata | parameter value |
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) |
PUT /session/params Accept: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
{
"status" : "SUCCEEDED",
"message" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
}
Returns a list of all sessions
media type | data type |
---|---|
application/json | array of array of UserSessionInfo (JSON) |
application/json | array of array of UserSessionInfo (JSON) |
application/xml | list of userSessionInfo (XML) |
text/plain | (custom) |
GET /session/sessions Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"handle" : "...",
"userName" : "...",
"activeQueries" : [ [ {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
}, {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
} ], [ {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
}, {
"handleIdString" : "...",
"handleId" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
} ] ],
"creationTime" : 12345,
"lastAccessTime" : 12345
}
Clears idle sessions. response will contain how many sessions were cleared.
media type | data type |
---|---|
application/json | APIResult (JSON) |
application/json | APIResult (JSON) |
application/xml | APIResult (XML) |
text/plain | (custom) |
DELETE /session/sessions Accept: application/json
HTTP/1.1 204 No Content
Content-Type: application/json
{
"status" : "FAILED",
"message" : "...",
"fieldsToAppend" : [ [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ], [ {
"name" : "...",
"value" : { }
}, {
"name" : "...",
"value" : { }
} ] ]
}