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 list of analysis data source IDs

get

Get a list of analysis data source ids.

Example Request:

GET pentaho/plugin/data-access/api/datasource/analysis/catalog
Authorizations
Responses
200

Successfully retrieved the list of analysis IDs

Responseobject

List of catalog IDs in XML format

get
/data-access/api/datasource/analysis/catalog
GET /data-access/api/datasource/analysis/catalog HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
200

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 analysis schema file

get

Download the analysis files for a given analysis id.

Example Request:

GET pentaho/plugin/data-access/api/datasource/analysis/catalog/SampleSchema
Authorizations
Path parameters
catalogstringRequired

String Id of the analysis data to retrieve.

Responses
200

Successfully downloaded the analysis file

application/octet-stream
Responsestring · binary

Analysis file data XML

get
/data-access/api/datasource/analysis/catalog/{catalogId}
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

put

Import Analysis Schema.

Example Request:

PUT pentaho/plugin/data-access/api/datasource/analysis/catalog/SampleSchema

Request 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/SampleData2

Example 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>
Authorizations
Path parameters
catalogNamestringRequired

The catalog name.

Body
uploadInputstring · binaryOptional

Analysis file to upload (Mondrian XML schema file)

schemaFileInfostringOptional

User selected name for the file

origCatalogNamestringOptional

The original catalog name

datasourceNamestringOptional

The datasource name

overwritestring · enumOptional

Whether to overwrite existing analysis data

Possible values:
xmlaEnabledFlagstring · enumOptional

Enable XMLA flag

Possible values:
parametersstringOptional

Import parameters

Responses
200

Successfully imported the analysis schema

text/plain
Responsestring

Success message

put
/data-access/api/datasource/analysis/catalog/{catalogId}
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"
}
text

Remove analysis data

delete

Remove the analysis data for a given analysis ID.

Example Request:

DELETE pentaho/plugin/data-access/api/datasource/analysis/catalog/{catalog}
Authorizations
Path parameters
catalogstringRequired

ID of the analysis data to remove.

Responses
200

Successfully removed the analysis data

text/plain
Responsestring

Success message

delete
/data-access/api/datasource/analysis/catalog/{catalogId}
DELETE /data-access/api/datasource/analysis/catalog/{catalogId} HTTP/1.1
Host: 
Authorization: Basic username:password
Accept: */*
text

Was this helpful?