%DeepSee.REST.v2
class %DeepSee.REST.v2 extends %DeepSee.REST.REST
This class provides validation and dispatch for version 2 of the DeepSee REST services For /Command calls, required arguments are expected in the request body. Every request is treated as a POST request (including those that only fetch values) This is to prevent running into the error where the number of characters in the URL exceeds the limit. For /Data and /Info calls, required arguments are expected in the URL. The exceptions to this rule are /Data/MDXExecute and /Data/PivotExecute, which require an argument POSTed to the the body of the request. For some services, the client may POST additional parameters in the body of the request. The description for each service outlines the parameters accepted for that particular service. In all services, unknown parameters that are included in the request body are ignored.Example: Execute an MDX query using an HTTP POST request, sent to a web application with Dispatch class %DeepSee.REST.v2.
var request = {}; var mdx = 'SELECT ' + ' NON EMPTY [Product].[P1].[Product Category].Members ON 0,' + ' NON EMPTY [Outlet].[H1].[Region].Members ON 1 ' + 'FROM [HoleFoods]' request.method = 'POST'; request.user = 'user'; request.passwd = 'pass'; request.acceptType = 'JSON'; request.contentType = 'JSON'; request.body = '{"MDX":"' + mdx + '"}'; request.callback = custom.queryCallBack request.async = true; request.url = 'http://host/port/restApplication/v2/Data/MDX'; // run the query var xhr = new XMLHttpRequest(); xhr.open(request.method,request.url,request.async); // kick off the request xhr.send(contents);
- /Data/TestConnection or /Info/TestConnection - get test info to confirm connection to the server.
- /Data/MDXExecute - get result in JSON format for MDX query. POST the query in the required property "MDX". The server will assume
the client wishes to wait for complete results before sending a response. The default timeout for this wait
is 2 seconds less than the session's timeout setting. This can be set using the TIMEOUT property in the
request.
The client can optionally instruct the server to send partial results by POSTing "WAIT":0.request.body = '{ "MDX": "SELECT FROM PATIENTS",' + ' "FILTERS": [' + ' "[HomeD].[H1].[ZIP].&[32006]",' + ' "%OR({[PatGrpD].[H1].[Patient Group].&[Group A],[PatGrpD].[H1].[Patient Group].&[Group B]})"' + ' ]' + ' "WAIT":1' + ' "TIMEOUT":30' + '};'
- /Data/PivotExecute - get result in JSON format for a stored pivot table. POST the full name (Folder/SubFolder/Name) of the
table in the required property "PIVOT". Filters may be
optionally be POSTed in the FILTERS property of the request. These filters take the identical
form as described in /Data/MDXExecute. This service also supports the WAIT and TIMEOUT options. A pivot
table that supports pivot variables may have those variables set using the VARIABLES array in the request.
request.body = '{ "PIVOT":"Pivot Variables/Commission Calculator",' + ' "VARIABLES": [' + ' "name":"commissionpercentage",' + ' "value":15' + ' ]' + '};'
- /Data/KPIExecute - execute a KPI. POST the logical name of KPI in "KPI". Filters may be added as an array of
objects in "FILTER". Each of the filter objects must provide a "name" and a "value" property.
request.body = '{ "KPI": "DemoMDX",' + ' "FILTERS": [ {' + ' "name" : "[aged].[h1].[age group]",' + ' "value" : "&[0 to 29]" }' + ' ]' + '};'
- /Data/MDXDrillthrough - execute a detail listing on the cube's source class. POST the query in "MDX".
DRILLTHROUGH requests will support a list of RETURN fields in the request, or a choice of LISTING.
Attempting to post both will result in an error.
request.body = '{ "MDX": "DRILLTHROUGH SELECT FROM [PATIENTS]",' + ' "LISTING":"Doctor details"' + '};'
request.body = '{ "MDX": "DRILLTHROUGH SELECT FROM [PATIENTS]",' + ' "RETURN":"Age,BirthDate"' + '};'
- /Data/MDXCancelQuery/:queryID - if a previous query has not completed, it can be canceled.
- /Data/MDXUpdateResults/:queryID - given a previous query response with ResultsComplete = 0, the client can request an update to the results using the cubeKey and queryKey.
- /Info/Filters/:dataSource - to get a list of filters available for a particular cube.
- /Info/FilterMembers/:dataSource/:filterSpec/ - get a list of values for a particular filter. Supported dataSources
are cubes and KPIs.
Values can be limited by POSTing values of other filters or a search key in the request.
request.body = '{ "RELATED": [' + ' {' + ' "spec": "[DateOfSale].[Actual].[YearSold]",' + ' "value": "&[2013]:&[2016]"' + ' }' + ' ],' + ' "SEARCHKEY":"Jan"' + '}';
- /Info/Cubes/ - get a list of cubes available in the namespace.
- /Info/Pivots/ - get a list of pivots available. The listing can be limited
to pivots based on a particular cube by POST to the BASECUBE property in the request.
request.body = '{"BASECUBE":"HOLEFOODS"}'
- /Info/Dashboards/ - get a list of available dashboards.
- /Info/Listings/:cube - get a list of available listings for a particular cube.
- /Info/Measures/:cube - get a list of measures available for a particular cube.
- /Info/ListingFields/:cube - get the list of listing fields defined for a particular cube, for user-defined custom listings.
- /Info/NamedFilters/:cube - get a list of named filters defined for a cube.
- /Info/PivotVariables/:cube - get a list of pivot variables defined a cube.
- /Info/PivotVariableDetails/:cube/:variable - get the details for a single pivot variable.
- /Info/QualityMeasures/:cube - get a list of quality measures available for the cube.
- /Command/BuildCube - A wrapper for %DeepSee.Utils.%BuildCube() which records cube event information when building the cube.
- /Command/RepairBuild - This method provides a means of doing an unscheduled repair build of a registered cube.
- /Command/BuildAllRegisteredGroups - This is a utility method which executes a complete build of all currently registered cubes in the current cube registry.
- /Command/BuildOneRegisteredGroup - This is a utility method which executes a complete build of one registered cube group in the current cube registry.
- /Command/SynchronizeCube - A wrapper for %DeepSee.Utils.%SynchronizeCube() which records cube event information when building the cube.
- /Command/GetLastUpdate - Retrieves the timestamp of the the last registered data update for the cube. Updates performed outside of the Cube Manager will not be recognized in this check.
- /Command/GetActiveRegistry - Retrieve the name of the Cube Registry currently marked Active
- /Command/SetActiveRegistry - Change which Cube Registry is currently active. The Active Registry is the only one that is visible to the updater tasks.
- /Command/BuildRegistryMap - Retrieve the map that describes the current state of the Cube Registry and all other unregistered cubes on the system. For the lookup variable in the output JSON, for each array in the "cubes" object, the first value corresponds to that the GroupIdx value and the second the CubeIdx value for that cube. The Cube can then be retrieved as follows: Set Cube = Map.Groups.GetAt(GroupIdx).Cubes.GetAt(CubeIdx) Currently GroupIdx and CubeIdx are 1-indexed. Subtract 1 from GroupIdx asnd CubeIdx to make them work for a 0-indexed system
- /Command/WriteToRegistry - Walk through a CubeManager.RegistryMap object and register the cubes.
- /Command/ScheduleUpdaterTasks - Schedule the build and synch tasks according to the settings in a CubeManager.RegistryMap object.
- /Command/GetSynchScheduleParameters - Convenience method -- takes the number of seconds between synchs and sets the parameters for the call to ##class(%DeepSee.CubeManager.Task.Synch).Schedule
- /Command/GetCubeSize - Given the logical name, pCubeName of a DeepSee cube, return the number of rows within its fact table.
- /Command/IsValidGroup - Boolean test which returns 1 if the group supplied as the argument is no less than the union of the natural groups of each of its members.
- /Command/IsValidCubeSchedule - Validation for the current cube settings.
Method Inventory
Methods
Verfies required Converts request body
Inherited Members
Inherited Methods
- %Array2JSON()
- %ClassIsLatestVersion()
- %ClassName()
- %ConstructResponseFromArray()
- %ConstructResponseObject()
- %ConvertErrorStatusToJSON()
- %CreateObjectFromArray()
- %DispatchClassMethod()
- %DispatchGetModified()
- %DispatchGetProperty()
- %DispatchMethod()
- %DispatchSetModified()
- %DispatchSetMultidimProperty()
- %DispatchSetProperty()
- %ErrorToJSON()
- %Extends()
- %ExtractDatasourceName()
- %GetParameter()
- %IsA()
- %New()
- %OriginalNamespace()
- %PackageName()
- %SetModified()
- %SetRequestField()
- %WaitForProviderResults()
- AcceptsContentType()
- AccessCheck()
- ConvertParameter()
- Decrypt()
- DispatchRequest()
- DrawCSS3STYLE()
- DrawHEAD()
- DrawSTHEAD()
- DrawSTTitle()
- DrawSTYLE()
- DrawTitle()
- DrawTitleSection()
- Encrypt()
- Error()
- EscapeHTML()
- EscapeURL()
- GetAuthChallenge()
- Http403()
- Http404()
- Http405()
- Http500()
- HyperEventCall()
- HyperEventHead()
- Include()
- InsertHiddenField()
- InsertHiddenFields()
- IsPrivate()
- Link()
- Login()
- OnErrorSetup()
- OnHTTPHeader()
- OnHandleCorsRequest()
- OnHandleOptionsRequest()
- OnLoginPage()
- OnPage()
- OnPageError()
- OnPostHTTP()
- OnPostHyperEvent()
- OnPreDispatch()
- OnPreHTTP()
- OnPreHyperEvent()
- OnSecurityTokenPage()
- Page()
- QuoteJS()
- ReportHttpStatusCode()
- RewriteURL()
- SetResponseHeaderIfEmpty()
- ShowError()
- StartTimer()
- StatusToJSON()
- StatusToProxyObject()
- StopTimer()
- SupportedVerbs()
- ThrowError()
- UnescapeHTML()
- UnescapeURL()