Data Source APIs Analysis Resource
This service allows for listing, downloading, uploading, and removal of Analysis files or Mondrian schemas in the BA Platform.
Get a list of analysis data source ids.
Example Request:
GET pentaho/plugin/data-access/api/datasource/analysis/catalogSuccessfully retrieved the list of analysis IDs
List of catalog IDs in XML format
GET /data-access/api/datasource/analysis/catalog HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
Successfully retrieved the list of analysis IDs
<jaxbList>
<type>java.lang.String</type>
<item>SampleData</item>
<item>SteelWheels</item>
<item>pentaho_operations_mart</item>
</jaxbList>
Download the analysis files for a given analysis id.
Example Request:
GET pentaho/plugin/data-access/api/datasource/analysis/catalog/SampleSchemaString Id of the analysis data to retrieve.
Successfully downloaded the analysis file
Analysis file data XML
Unauthorized
Unable to download analysis file
GET /data-access/api/datasource/analysis/catalog/{catalogId} HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
<?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>
Import Analysis Schema.
Example Request:
PUT pentaho/plugin/data-access/api/datasource/analysis/catalog/SampleSchemaRequest body should contain multipart/form-data with the analysis file to upload.
Example cURL Command:
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/SampleData2Example Mondrian Schema XML for uploadInput:
<?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>The catalog name.
Analysis file to upload (Mondrian XML schema file)
User selected name for the file
The original catalog name
The datasource name
Whether to overwrite existing analysis data
Enable XMLA flag
Import parameters
Successfully imported the analysis schema
Success message
Import failed because publish is prohibited
Access Control Forbidden
Content already exists (use overwrite flag to force)
Analysis datasource import failed. Error code or message included in response entity
Unspecified general error has occurred
PUT /data-access/api/datasource/analysis/catalog/{catalogId} HTTP/1.1
Host:
Authorization: Basic username:password
Content-Type: multipart/form-data
Accept: */*
Content-Length: 157
{
"uploadInput": "binary",
"schemaFileInfo": "text",
"origCatalogName": "text",
"datasourceName": "text",
"overwrite": true,
"xmlaEnabledFlag": true,
"parameters": "text"
}textRemove the analysis data for a given analysis ID.
Example Request:
DELETE pentaho/plugin/data-access/api/datasource/analysis/catalog/{catalog}ID of the analysis data to remove.
Successfully removed the analysis data
Success message
User is not authorized to delete the analysisdatasource
Unable to remove analysis data
DELETE /data-access/api/datasource/analysis/catalog/{catalogId} HTTP/1.1
Host:
Authorization: Basic username:password
Accept: */*
textWas this helpful?

