Analysis Resource
Overview
Methods for listing, download, upload, and removal of Analysis files or Mondrian schemas.
Overview
This service allows for listing, download, upload, and removal of Analysis files or Mondrian schemas in the BA Platform.
The following resources are applicable:
- /data-access/api/datasource/analysis/catalog
- /data-access/api/datasource/analysis/catalog/{catalogId }
/data-access/api/datasource/analysis/catalog
GET
Get a list of analysis data source ids.
Example Request:
GET pentaho/plugin/data-access/api/datasource/analysis/catalog
Response Body
element: | List |
media types: | application/xml application/json |
A list of catalog IDs.
Example Response:
{ "Item":[ { "@type":"xs:string", "$":"SampleData" }, { "@type":"xs:string", "$":"SteelWheels" }, { "@type":"xs:string", "$":"pentaho_operations_mart" } ] }
Status Codes
code | description |
---|---|
200 | Successfully retrieved the list of analysis IDs |
/data-access/api/datasource/analysis/catalog/{catalogId }
The following operations are supported on this resource:
GET
Download the analysis files for a given analysis id.
Example Request:
GET pentaho/plugin/data-access/api/datasource/analysis/catalog/SampleSchema
Parameters
name | description | type |
---|---|---|
catalog | String Id of the analysis data to retrieve. | path |
Response Body
element: | (custom) |
media types: | */* application/xml application/octet-stream |
Response containing the analysis file data XML.
Example Response:
<?xml version="1.0"?> <Schema name="SampleData2"> <Dimension name="Region"> <Hierarchy hasAll="true" allMemberName="All Regions"> <Table name="QUADRANT_ACTUALS"/> <Level name="Region" column="REGION" uniqueMembers="true"/> </Hierarchy> </Dimension> <Dimension name="Department"> <Hierarchy hasAll="true" allMemberName="All Departments"> <Table name="QUADRANT_ACTUALS"/> <Level name="Department" column="DEPARTMENT" uniqueMembers="true"/> </Hierarchy> </Dimension> <Dimension name="Positions"> <Hierarchy hasAll="true" allMemberName="All Positions"> <Table name="QUADRANT_ACTUALS"/> <Level name="Positions" column="POSITIONTITLE" uniqueMembers="true"/> </Hierarchy> </Dimension> <Cube name="Quadrant Analysis"> <Table name="QUADRANT_ACTUALS"/> <DimensionUsage name="Region" source="Region"/> <DimensionUsage name="Department" source="Department" /> <DimensionUsage name="Positions" source="Positions" /> <Measure name="Actual" column="ACTUAL" aggregator="sum" formatString="#,###.00"/> <Measure name="Budget" column="BUDGET" aggregator="sum" formatString="#,###.00"/> <Measure name="Variance" column="VARIANCE" aggregator="sum" formatString="#,###.00"/> </Cube> </Schema>
Status Codes
code | description |
---|---|
200 | Successfully downloaded the analysis file |
401 | Unauthorized |
500 | Unabled to download analysis file |
DELETE
Remove the analysis data for a given analysis ID.
Example Request:
DELETE pentaho/plugin/data-access/api/datasource/analysis/catalog/{catalog}
Parameters
name | description | type |
---|---|---|
catalog | ID of the analysis data to remove. | path |
Response Body
element: | (custom) |
media types: | */* application/xml application/octet-stream |
A 200 response code representing the successful removal of the analysis datasource.
Example Response:
This response does not contain data.
Status Codes
code | description |
---|---|
200 | Successfully removed the analysis data |
401 | User is not authorized to delete the analysis datasource |
500 | Unable to remove the analysis data. |
PUT
Import Analysis Schema.
Example Request:
PUT pentaho/plugin/data-access/api/datasource/analysis/catalog/SampleSchema
PUT data:
<?xml version="1.0"?> <Schema name="SampleData2"> <!-- Shared dimensions --> <Dimension name="Region"> <Hierarchy hasAll="true" allMemberName="All Regions"> <Table name="QUADRANT_ACTUALS"/> <Level name="Region" column="REGION" uniqueMembers="true"/> </Hierarchy> </Dimension> <Dimension name="Department"> <Hierarchy hasAll="true" allMemberName="All Departments"> <Table name="QUADRANT_ACTUALS"/> <Level name="Department" column="DEPARTMENT" uniqueMembers="true"/> </Hierarchy> </Dimension> <Dimension name="Positions"> <Hierarchy hasAll="true" allMemberName="All Positions"> <Table name="QUADRANT_ACTUALS"/> <Level name="Positions" column="POSITIONTITLE" uniqueMembers="true"/> </Hierarchy> </Dimension> <Cube name="Quadrant Analysis"> <Table name="QUADRANT_ACTUALS"/> <DimensionUsage name="Region" source="Region"/> <DimensionUsage name="Department" source="Department" /> <DimensionUsage name="Positions" source="Positions" /> <Measure name="Actual" column="ACTUAL" aggregator="sum" formatString="#,###.00"/> <Measure name="Budget" column="BUDGET" aggregator="sum" formatString="#,###.00"/> <Measure name="Variance" column="VARIANCE" aggregator="sum" formatString="#,###.00"/> <!-- <CalculatedMember name="Variance Percent" dimension="Measures" formula="([Measures].[Variance]/[Measures].[Budget])*100" /> --> </Cube> </Schema>
cURL Script Example:
curl -v -H "Content-Type: multipart/form-data" -X PUT -F uploadInput=@/Users/username/Downloads/SampleData2.mondrian.xml -F overwrite=true -F xmlaEnabledFlag=false -F parameters="Datasource=SampleData" -u admin:password http://localhost:8080/yourdomain/plugin/data-access/api/datasource/analysis/catalog/SampleData2
Parameters
name | description | type |
---|---|---|
catalogName | The catalog name. | path |
uploadInput | A Mondrian schema XML file. | formdata |
schemaFileInfo | User selected name for the file. (optional) | formdata |
origCatalogName | The original catalog name. (optional) | formdata |
datasourceName | The datasource name. (not used) | formdata |
overwrite | Flag for overwriting existing version of the file. The values are true and false. | formdata |
xmlaEnabledFlag | Is XMLA enabled or not. The values are true and false. | formdata |
parameters | Import parameters. | formdata |
Response Body
element: | (custom) |
media types: | text/plain |
Response containing the success of the method.
Example Response:
200
Status Codes
code | description |
---|---|
409 | Content already exists (use overwrite flag to force) |
401 | Import failed because publish is prohibited |
500 | Unspecified general error has occurred |
412 | Analysis datasource import failed. Error code or message included in response entity |
403 | Access Control Forbidden |
201 | Indicates successful import |