1 Reply Latest reply: Mar 2, 2013 10:15 PM by benmackin RSS

    Deploying RPD using Mbean

    Irfan Khan
      I want to use this Mbean and carry out this operation of upload repository using command line

      We can access this Mbean and do the same. Has anyone been able to do this, I m trying hard and dont know much of python here.




      oracle.biee.admin:type=BIDomain.BIInstance.ServerConfiguration,biInstance=coreapplication, group=Service
      Operation Name     uploadRepository
      Description     Uploads the repository file whose full path is represented by rpdFilePath
      Return Type     void


      Sample script below works for getting status


      Connecting to localhost:5301 as user: ikhan ...
      Connecting to t3://localhost:5301 with userid ikhan ...
      Successfully connected to Admin Server 'AdminServer' that belongs to domain 'bidev'.

      Warning: An insecure protocol was used to connect to the
      server. To ensure on-the-wire security, the SSL port or
      Admin port should be used instead.

      Connecting to Domain ...
      Location changed to domain custom tree. This is a writable tree with No root.
      For more help, use help(domainCustom)

      Connecting to BIDomain MBean ...
      Connecting to BIInstance MBean ...
      BIInstance MBean; ServiceStatus: FULLY_STARTED


      Exiting WebLogic Scripting Tool.


      ------------------------------------------------------------------------------------------------------------
      # Example to demonstrate connecting to a BIEE domain using WLST
      #
      # This scripts expects the following arguments:
      #
      # 1. wls.host (localhost)
      # 2. wls.port (7001)
      # 3. wls.user (user1)
      # 4. wls.password (password1)
      # ===================================================================

      import sys
      import os

      # Check the arguments to this script are as expected.
      # argv[0] is script name.
      argLen = len(sys.argv)
      if argLen -1 != 4:
      print "ERROR: got ", argLen -1, " args."
      print "USAGE: wlst.cmd wls_connect.py WLS_HOST WLS_PORT WLS_USER WLS_PASSWORD"
      print " eg: wlst.cmd wls_connect.py localhost 7001 user1 password1"
      exit()

      WLS_HOST = sys.argv[1]
      WLS_PORT = sys.argv[2]
      WLS_USER = sys.argv[3]
      WLS_PW = sys.argv[4]

      print 'Connecting to '+ WLS_HOST+ ':' + WLS_PORT + ' as user: ' + WLS_USER + ' ...'

      # Connect to WLS
      connect(WLS_USER, WLS_PW, WLS_HOST+ ':' + WLS_PORT);

      print 'Connecting to Domain ...'
      domainCustom()
      cd ('oracle.biee.admin')
      print 'Connecting to BIDomain MBean ...'
      cd ('oracle.biee.admin:type=BIDomain,group=Service')

      biinstances = get('BIInstances')
      biinstance = biinstances[0]

      print 'Connecting to BIInstance MBean ...'
      cd ('..')
      cd (biinstance.toString())

      servicestatus=get('ServiceStatus')
      print 'BIInstance MBean; ServiceStatus: ' + servicestatus

      exit()
        • 1. Re: Deploying RPD using Mbean
          benmackin
          I was able to accomplish this. [My Blog post on the Subject|http://adventuresinobiee.blogspot.com/2013/02/scripted-rpd-deployments-using-udml-and.html]

          Here is the relevant python pieces you would need to lock, upload, and commit. The blog post has a full shell script and python script implementation.

          # Lock the System
          print("Calling lock ...")
          cd("..")
          cd("oracle.biee.admin:type=BIDomain,group=Service")
          objs = jarray.array([], java.lang.Object)
          strs = jarray.array([], java.lang.String)
          invoke("lock", objs, strs)

          cd("..")
          # go to the server configuration
          cd("oracle.biee.admin:type=BIDomain.BIInstance.ServerConfiguration,biInstance=coreapplication,group=Service")
          print("Uploading RPD")
          # Set the parameters
          params = jarray.array([rpdpath,rpdPassword],java.lang.Object)
          # Set the parameters Signs
          sign = jarray.array(["java.lang.String", "java.lang.String"],java.lang.String)
          # Invoke the procedure
          invoke( "uploadRepository", params, sign)

          # Commit the system
          print("Commiting Changes")
          cd("..")
          cd("oracle.biee.admin:type=BIDomain,group=Service")

          objs = jarray.array([], java.lang.Object)
          strs = jarray.array([], java.lang.String)
          invoke("commit", objs, strs)