Hitachi Vantara Pentaho Community Forums
Results 1 to 17 of 17

Thread: Uploading a Mondrian file to the BA Server using REST API

  1. #1

    Default Uploading a Mondrian file to the BA Server using REST API

    Hey Everyone,

    I have never used any sort of REST API before, but would like to use the Pentaho Rest API to upload Mondrian xml files to the server. According to http://anonymousbi.wordpress.com/201...-web-services/ and several other sites I can accomplish this by using the following request.

    http://localhost:8080/pentaho/plugin...n/postAnalysis
    Multipart POST request with post params:
    uploadAnalysis – Mondrian schema
    catalogName – name of the catalog (optional?)
    parameters – parameter list

    However, for someone like me who is new to this, this is not quite enough for me to start using this. How exactly would I go about running this, what would the url be to put a local file up onto the server? Any help would be appreciated


  2. #2

    Default

    Do you need this automatic?

    Why you dont just add a new Datasource?

  3. #3
    Join Date
    Aug 2013
    Posts
    2

    Default

    Hi all,
    I'm the same situation as and.decarlo. (I would like to create and publish an OLAP cube by an automated process with a Spoon workflow)
    I did everything, just missing the schema publication (to be done by hand using a "Schema Workbench").
    I'm sure it can be done in an automatic way, maybe there is already a Spoon node made ​​for this ... but I do not know how. :-(
    Any help is appreciated

    Regards.

  4. #4

    Default

    I would like this to be automatic, besides the fact that if there is a REST API to do this than I would like to learn it.

  5. #5
    Join Date
    Aug 2013
    Posts
    2

    Default

    I have found all the answers in the pentaho-mondrianschemaworkbench-plugins.
    It contains the java code to make the call.

  6. #6

    Default

    Thanks, the PublishToServerCommand.java in particular was helpful.

  7. #7
    Join Date
    Feb 2007
    Posts
    10

    Default Working example appreciated

    Hi, I'm struggling getting this to work. Working example anyone?

    Attached is an example transformation that download a schema from the REST endpoint, thereafter uploading the same under a new catalog.

    best,
    Lars
    Attached Files Attached Files
    Last edited by johla; 08-08-2014 at 07:28 AM.

  8. #8
    Join Date
    Aug 2006
    Posts
    287

    Default

    Perhaps you can use the following utility found here: /server/biserver-ee/import-export.sh (bat)

    An example command is shown here:
    ./import-export.sh

    --import

    --url=http://localhost:8080/pentaho

    --username=admin

    --password=password

    --file-path=/home/pentaho/SteelWheels.xml

    --resource-type=datasource

    --datasource-type=analysis

    --analysis-datasource=sampledata

    --catalog=SteelWheels

    --overwrite=true

    --xmla-enabled=false

    --logfile=/home/pentaho/importlogfile.logfile

  9. #9
    Join Date
    Mar 2013
    Posts
    22

    Question publish mondrian by commandline

    Quote Originally Posted by caralomi View Post
    Perhaps you can use the following utility found here: /server/biserver-ee/import-export.sh (bat)

    An example command is shown here:
    ./import-export.sh

    --import

    --url=http://localhost:8080/pentaho

    --username=admin

    --password=password

    --file-path=/home/pentaho/SteelWheels.xml

    --resource-type=datasource

    --datasource-type=analysis

    --analysis-datasource=sampledata

    --catalog=SteelWheels

    --overwrite=true

    --xmla-enabled=false

    --logfile=/home/pentaho/importlogfile.logfile
    Hi!

    I'm experiencing the same problems.

    I tried this:
    Code:
    import-export.bat --import --url=http://localhost:8081/pentaho --username=xxxx --password=yyyy --file-path=C:/my/file/Mondrian.xml --resource-type=datasource --datasource-type=analysis --analysis-datasource=MYDATASOUCE --catalog=myCatalog --overwrite=true --xmla-enabled=false --path=/public --retainOwnership=true --permission=true 
    
    DEBUG: Using JAVA_HOME
    DEBUG: _PENTAHO_JAVA_HOME=c:\Program Files\Java\jdk1.7.0_67
    DEBUG: _PENTAHO_JAVA=c:\Program Files\Java\jdk1.7.0_67\bin\java.exe
    log4j:WARN Continuable parsing error 3 and column 57
    log4j:WARN Document root element "configuration", must match DOCTYPE root "null".
    log4j:WARN Continuable parsing error 3 and column 57
    log4j:WARN Document is invalid: no grammar found.
    log4j:WARN The <configuration> element has been deprecated.
    log4j:WARN Use the <log4j:configuration> element instead. 
    done response = INVALID_MIME_TYPE
    What's wrong?
    I also tried with --path=/

    Using Pentaho 7.1.0.0-752

    Any Ideas?

    Best regards

  10. #10
    Join Date
    Oct 2012
    Posts
    3

    Default

    Hi and.decarlo,
    do you know how to do this? I have the same problem and not know how to resolve it. Any help would be appreciated.


    Regards.

  11. #11
    Join Date
    Oct 2012
    Posts
    3

    Default

    Hi Johla,

    i'm very interested for your transformation but can not upload the mondrian schema. (Pentaho 5.2). Do you know why?
    Any help would be appreciated.


    Regards.

  12. #12

    Default

    Hi all,

    Probably it's quite late but I have had a similar problem and I shared a working solution in this post.
    http://fcorti.com/2014/12/11/uploadi...aho-using-pdi/

    I hope this will help someone else... looking around in the web, many people. ;-)

    Cheers.

  13. #13
    Join Date
    Dec 2012
    Posts
    16

    Default

    Hi Francesco,

    Thank you for your good blog article!
    http://fcorti.com/2014/12/11/uploading-mondrian-to-pentaho-using-pdi/

    I tried to change your code for repository API "/pentaho/api/repo/files/import".
    I could send a text file, but I could not send a binary file.

    steelwheels.xanalyzer (text file)
    -> success (200 OK)

    sample_report.prpt (binary file)
    -> fail (400 Bad Request)
    error message: The request sent by the client was syntactically incorrect.

    Do you know how to send binary files?

    Best,
    Teruo Kawasaki

    uploadRepoFiles.zip

  14. #14

    Default

    Hi Teruo,

    Your goal is quite different from the purpose of this post but I should have the solution because I needed to upload a generic file into the repository.

    If you want to see a working transformation you can take a look at "Create target folder and upload file" in the AAAR_Kettle repository of the AAAR project you can see and install here:
    http://fcorti.com/alfresco-audit-ana...tall/aaar-get/

    I hope this helps you.

  15. #15
    Join Date
    Dec 2012
    Posts
    16

    Default

    Hi Francesco,

    Thank you for your reply!
    I'll try.

    Teruo


  16. #16

    Default Found another solution

    Re-bumping the above thread to add a bit...

    For those who want to simply upload a mondrian xml schema file to Pentaho BI instance from the command line, there is a simple solution I found using curl to call the rest api.

    This was stolen from Fernando, who posted the solution here: https://groups.google.com/forum/#!to...ty/BldT9-z7bHA

    Code:
    #!/bin/bash
    #Uploads a schema file to the local instance of Pentaho
    echo "Uploading schema file to Mondrian/Pentaho"
    curl -f -include --user admin:password -F "uploadAnalysis=@Schema.xml" -F "catalogName=Schema" \
    -F "overwrite=true"  -F "xmlaEnabledFlag=false"  \
    -F "parameters=DataSource=datasourcename" http://localhost:8080/pentaho/plugin/data-access/api/mondrian/postAnalysis
    
    
    if [ $? -eq 0 ]; then
        echo "***"
        echo "Success uploading schema"
        exit 0
    else
        echo "!!!"
        echo "Failure uploading mondrian schema"
        exit 1
    fi

  17. #17
    Join Date
    Oct 2016
    Posts
    1

    Default

    Quote Originally Posted by caralomi View Post
    Perhaps you can use the following utility found here: /server/biserver-ee/import-export.sh (bat)

    An example command is shown here:
    ./import-export.sh

    --import

    --url=http://localhost:8080/pentaho

    --username=admin

    --password=password

    --file-path=/home/pentaho/SteelWheels.xml

    --resource-type=datasource

    --datasource-type=analysis

    --analysis-datasource=sampledata

    --catalog=SteelWheels

    --overwrite=true

    --xmla-enabled=false

    --logfile=/home/pentaho/importlogfile.logfile
    This didn't work for me. I spent a while getting it to work from PowerShell, then reverted back to import-export.bat (on Windows Server) and managed to make it work after studying the Java source:

    .\import-export.bat --import --url=http://localhost:8080/pentaho --username=admin --password=password --file-path=C:\Installers\Schema\whatever.xml --resource-type=DATASOURCE --datasource-type=ANALYSIS --analysis-datasource=sampledata --overwrite=false

    Note the capitalization.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.