This project has retired. For details please refer to its Attic page.
Lens Server: SavedQueryResource

SavedQueryResource Resource

GET /queryapi/savedqueries/health

Response Body
media type data type
text/plain (custom)

Example

Request
GET /queryapi/savedqueries/health
Accept: text/plain

              
Response
HTTP/1.1 200 OK
Content-Type: text/plain

                
...
                
              

GET /queryapi/savedqueries

Gets a list of saved queries matching the criteria (url parameters) windowed by count and start.

Request Parameters
name type description default constraints
count query Number of records to fetch from start    
sessionid query The sessionid in which user is working    
start query Offset to start from the search result 0 int
Request Body
media type data type
application/x-www-form-urlencoded (custom)
Response Body
media type data type description
application/json ListResponse (JSON) org.apache.lens.api.query.save.ListResponse ListResponse object
application/json ListResponse (JSON)
application/xml listResponse (XML)

Example

Request
GET /queryapi/savedqueries
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "offsetAppplied" : 12345,
  "totalCount" : 12345,
  "resoures" : [ [ {
    "id" : 12345,
    "name" : "...",
    "description" : "...",
    "query" : "...",
    "parameters" : [ [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "STRING",
      "collectionType" : "MULTIPLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "BOOLEAN",
      "collectionType" : "MULTIPLE"
    } ], [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "DECIMAL",
      "collectionType" : "MULTIPLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "STRING",
      "collectionType" : "MULTIPLE"
    } ] ]
  }, {
    "id" : 12345,
    "name" : "...",
    "description" : "...",
    "query" : "...",
    "parameters" : [ [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "BOOLEAN",
      "collectionType" : "MULTIPLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "STRING",
      "collectionType" : "SINGLE"
    } ], [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "DECIMAL",
      "collectionType" : "SINGLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "NUMBER",
      "collectionType" : "MULTIPLE"
    } ] ]
  } ], [ {
    "id" : 12345,
    "name" : "...",
    "description" : "...",
    "query" : "...",
    "parameters" : [ [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "NUMBER",
      "collectionType" : "SINGLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "BOOLEAN",
      "collectionType" : "MULTIPLE"
    } ], [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "NUMBER",
      "collectionType" : "MULTIPLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "BOOLEAN",
      "collectionType" : "SINGLE"
    } ] ]
  }, {
    "id" : 12345,
    "name" : "...",
    "description" : "...",
    "query" : "...",
    "parameters" : [ [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "BOOLEAN",
      "collectionType" : "SINGLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "DECIMAL",
      "collectionType" : "MULTIPLE"
    } ], [ {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "DECIMAL",
      "collectionType" : "SINGLE"
    }, {
      "name" : "...",
      "displayName" : "...",
      "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
      "dataType" : "BOOLEAN",
      "collectionType" : "MULTIPLE"
    } ] ]
  } ] ]
}
                
              

GET /queryapi/savedqueries/{id}

Gets the saved query with the given id.

Request Parameters
name type description constraints
id path id of the saved query long
sessionid query The sessionid in which user is working  
Response Body
media type data type description
application/json SavedQuery (JSON) org.apache.lens.api.query.save.SavedQuery SavedQuery object
application/json SavedQuery (JSON)
application/xml savedQuery (XML)

Example

Request
GET /queryapi/savedqueries/{id}
Accept: application/json

              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "description" : "...",
  "query" : "...",
  "parameters" : [ [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "STRING",
    "collectionType" : "MULTIPLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "BOOLEAN",
    "collectionType" : "SINGLE"
  } ], [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "DECIMAL",
    "collectionType" : "MULTIPLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "NUMBER",
    "collectionType" : "MULTIPLE"
  } ] ]
}
                
              

DELETE /queryapi/savedqueries/{id}

Deletes the saved query with the given id.

Request Parameters
name type description constraints
id path id of the saved query long
sessionid query The sessionid in which user is working  
Response Body
media type data type description
application/json ResourceModifiedResponse (JSON) org.apache.lens.api.query.save.ResourceModifiedResponse ResourceModifiedResponse object
application/json ResourceModifiedResponse (JSON)
application/xml resourceModifiedResponse (XML)

Example

Request
DELETE /queryapi/savedqueries/{id}
Accept: application/json

              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "id" : 12345,
  "resource" : "...",
  "status" : "UPDATED"
}
                
              

POST /queryapi/savedqueries

Creates a new saved query.

Request Parameters
name type description
sessionid query The sessionid in which user is working
Request Body
media type data type description
application/json SavedQuery (JSON) Saved query object
application/json SavedQuery (JSON)
application/xml savedQuery (XML)
Response Body
media type data type description
application/json ResourceModifiedResponse (JSON) org.apache.lens.api.query.save.ResourceModifiedResponse ResourceModifiedResponse object
application/json ResourceModifiedResponse (JSON)
application/xml resourceModifiedResponse (XML)

Example

Request
POST /queryapi/savedqueries
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "description" : "...",
  "query" : "...",
  "parameters" : [ [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "BOOLEAN",
    "collectionType" : "SINGLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "STRING",
    "collectionType" : "MULTIPLE"
  } ], [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "STRING",
    "collectionType" : "MULTIPLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "NUMBER",
    "collectionType" : "MULTIPLE"
  } ] ]
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "id" : 12345,
  "resource" : "...",
  "status" : "DELETED"
}
                
              

PUT /queryapi/savedqueries/{id}

Updates the saved query {id} with the new payload.

Request Parameters
name type description constraints
id path long
sessionid query The sessionid in which user is working  
Request Body
media type data type description
application/json SavedQuery (JSON) Saved query object
application/json SavedQuery (JSON)
application/xml savedQuery (XML)
Response Body
media type data type description
application/json ResourceModifiedResponse (JSON) org.apache.lens.api.query.save.ResourceModifiedResponse ResourceModifiedResponse object
application/json ResourceModifiedResponse (JSON)
application/xml resourceModifiedResponse (XML)

Example

Request
PUT /queryapi/savedqueries/{id}
Content-Type: application/json
Accept: application/json

                
{
  "id" : 12345,
  "name" : "...",
  "description" : "...",
  "query" : "...",
  "parameters" : [ [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "STRING",
    "collectionType" : "SINGLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "DECIMAL",
    "collectionType" : "MULTIPLE"
  } ], [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "NUMBER",
    "collectionType" : "MULTIPLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "STRING",
    "collectionType" : "SINGLE"
  } ] ]
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{
  "id" : 12345,
  "resource" : "...",
  "status" : "CREATED"
}
                
              

POST /queryapi/savedqueries/parameters

Parses the query and returns parameters that are found in the query.

Request Parameters
name type description
query formdata The HQL query
sessionid query The sessionid in which user is working
Response Body
media type data type description
application/json ParameterParserResponse (JSON) org.apache.lens.api.query.save.ParameterParserResponse ParameterParserResponse object
application/json ParameterParserResponse (JSON)
application/xml parameterParserResponse (XML)

Example

Request
POST /queryapi/savedqueries/parameters
Accept: application/json

              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "valid" : true,
  "message" : "...",
  "parameters" : [ [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "STRING",
    "collectionType" : "MULTIPLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "BOOLEAN",
    "collectionType" : "MULTIPLE"
  } ], [ {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "NUMBER",
    "collectionType" : "MULTIPLE"
  }, {
    "name" : "...",
    "displayName" : "...",
    "defaultValue" : [ [ "...", "..." ], [ "...", "..." ] ],
    "dataType" : "DECIMAL",
    "collectionType" : "MULTIPLE"
  } ] ]
}
                
              

POST /queryapi/savedqueries/{id}

Runs the saved query with the given id and returns a query handle.

Request Parameters
name type description constraints
conf formdata Lens configuration overrides for the query  
sessionid formdata The sessionid in which user is working  
id path id of the saved query long
Response Body
media type data type description
application/json LensAPIResult (JSON) LensAPIResult containing the query handle
application/json LensAPIResult (JSON)
application/xml lensAPIResult (XML)

Example

Request
POST /queryapi/savedqueries/{id}
Accept: application/json

              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{
  "httpStatusCode" : { },
  "successResult" : true,
  "errorResult" : true,
  "errorCode" : 12345,
  "errorMessage" : "...",
  "id" : "...",
  "data" : { },
  "lensErrorTO" : {
    "payload" : { },
    "childErrors" : [ [ { }, { } ], [ { }, { } ] ],
    "message" : "...",
    "code" : 12345
  }
}