5 Replies Latest reply on Mar 5, 2012 9:36 AM by Bill Robinson

    blcli call to set execution override

    Naveen Anne

      Is there a blcli call to 'set execution override' to run the jobs as BLAdmin?

      I looked through blcli released and unreleased commands and couldn't find a relevant call. May be I missed some...


        • 1. blcli call to set execution override

          We really need to do this in our project.  We have a lot of jobs that have to run under a certain user to work and we have a scripts that automatically assign targets to those jobs.  When we assign a server to a job, it resets the execution override, so we have to go back every job to click on the button and save the jobs.  When we have hundreds of those jobs, it is a full time employee just to click on a button!


          I've checked the behavior of the button and it looks like it sets two properties on the job (EXECUTION_ROLE and EXECUTION_USER).  I tried setting them directly, but they are read only, even from a script.  Is it possible to force the set (the console is able to do it, so why a script cannot ) ?


          I searched the unreleased commands and found setJobToExecuteAsCurrentSecurityContext.  I added it to the command that sets the target in the API xml files, but it does nothing.  Si I created a new command that gets the Job, call this method, update and returns the DBKey.  The DBKey returned is always null, the update date is not updated and the properties are not set.


          Our last resort would be to call the Java API directly, but we are less than willing to do so, or directly update the database, which would be even worst.


          Thanks for your help.

          • 2. blcli call to set execution override

            Bump... Anyone?


            Anyway to do this in 8.0SP11 or 8.1SP3?


            We have jobs that are set with the execution override, but when using blcli calls to set the target server, the overriden value is removed/reset. We need to either incorporate this back via blcli call or avoid the execution override from being removed during other blcli modifications to the job.

            • 3. blcli call to set execution override
              Bill Robinson

              blcli_execute Job findByDBKey <key>

              blclI_execute Utility storeTargetObject job

              blcli_execute Job setJobToExecuteAsCurrentSecurityContext

              blcli_execute Job update NAMED_OBJECT=job

              • 4. blcli call to set execution override



                I'm just not finding the setJobToExecuteAsCurrentSecurityContext command. Additionally, to get the job dbKey, i'm using 'DeployJob getDBKeyByGroupAndName'.


                I've tried to ensure my unsupported BLCLI command references are current but running

                "%PROGRAMFILES%\BMC Software\BladeLogic\8.0\NSH\bin\blcli-generate-htmlexe.exe" "%PROGRAMFILES%\BMC Software\BladeLogic\8.0\NSH\br\xml\cli" "h:\unreleased-blcli"


                but I get the error below (another user gets the same error):


                2012-03-01 12:35:47,865 [INFO] com.bladelogic.cli.help.HelpGenerator - Started g

                enerating html help files

                Command links should not refer to default command ids : Job.executeWithApproval-


                Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

                        at java.util.regex.Pattern$BitClass.<init>(Unknown Source)

                        at java.util.regex.Pattern.clazz(Unknown Source)

                        at java.util.regex.Pattern.sequence(Unknown Source)

                        at java.util.regex.Pattern.expr(Unknown Source)

                        at java.util.regex.Pattern.compile(Unknown Source)

                        at java.util.regex.Pattern.<init>(Unknown Source)

                        at java.util.regex.Pattern.compile(Unknown Source)

                        at java.lang.String.replaceAll(Unknown Source)

                        at com.bladelogic.shared.xml.XMLReader.getNodeValue(XMLReader.java:178)

                        at com.bladelogic.cli.factory.CommandXMLParser.parseParagraphElementNode


                        at com.bladelogic.cli.factory.CommandXMLParser.parseParagraphNode(Comman


                        at com.bladelogic.cli.factory.CommandXMLParser.parseDescriptionNode(Comm


                        at com.bladelogic.cli.factory.CommandXMLParser.parseCommandTemplate(Comm


                        at com.bladelogic.cli.factory.CommandXMLParser.parseNameSpace(CommandXML


                        at com.bladelogic.cli.factory.CommandXMLParser.parse(CommandXMLParser.ja


                        at com.bladelogic.cli.factory.CommandTemplateInventory.loadCommandTempla


                        at com.bladelogic.cli.factory.CommandTemplateInventory.loadCommandTempla


                        at com.bladelogic.cli.help.HelpGenerator.initCommandFactory(HelpGenerato


                        at com.bladelogic.cli.help.HelpGenerator.<init>(HelpGenerator.java:42)

                        at com.bladelogic.cli.help.HelpGenerator.main(HelpGenerator.java:689)

                • 5. blcli call to set execution override
                  Bill Robinson

                  there are two issues here:


                  1 - setting the override - something like this should work:

                  blcli_execute DeployJob getDBKeyByGroupAndName "/group" "name"

                  blcli_storeenv dbKey

                  blcli_execute Job findByDBKey ${dbKey}

                  blclI_execute Utility storeTargetObject job

                  blcli_execute Job setJobToExecuteAsCurrentSecurityContext

                  blcli_execute Job update NAMED_OBJECT=job


                  if you run that sequence, is there any output?  what happens when you go look at the job after you run this?


                  2 - you don't have enough heap to generate the HTML reference docs for the unreleased commands.  you only need this for reference, you do not need these to run the actual commands. in the br directory there should be a blcli-generate-html.cfg file, change or add '-Xmx1024m' to that file.

                  1 of 1 people found this helpful