5 Replies Latest reply on May 17, 2010 11:15 AM by Bill Robinson

    blcli to cancel jobs

    Saurabh Kashikar

      Hi,

       

      We are trying to write a automated process to cancel/abort jobs using blcli.

       

      There is no released command to do this, but there is one under unpublished section, which doesn't work..

       

      Here is what I am trying to do:

      blcli -t BLSSO -v default -r BLAdmins JobRun cancel DBKey:SJobKey:2002898-2 2046707
      Unknown command : name space = 'JobRun', command = 'cancel'.com.bladelogic.cli.factory.CommandNotFoundException: Found command 'JobRun.cancel' but with mismatching arguments.

       

      Here is what the help page says:

      Command Name : cancel

      Name space : JobRun

      Command Type : Load

      Release command : false

      Description :

       

      Return type : void

      Command Input :

      Variable NameVariable TypeDescription
      jobKeycom.bladelogic.app.service.job.JobKeyno description
      jobRunIdIntegerno description

      Invoked commands in order :

      CommandInputReturn value stored name
      JobRun.cancel-api$jobKey$ $jobRunId$-

       

      The only difference I can see here is that the command JobRun:Cancel is of "Command Type: Load" and the ones which I execute regularly(ones which work as per the help) are of "Command Type: Complex"..

       

      Any guesses...??

        • 1. Re: blcli to cancel jobs
          Bill Robinson

          You can't access the unreleased command w/ the commandline blcli call.  You need to use the 'performance commands' in nsh.

           

          From a nsh shell run:

          blcli_execute BLAdmins JobRun cancel DBKey:SJobKey:2002898-2 2046707

          • 2. Re: blcli to cancel jobs
            Saurabh Kashikar

            Fails this way as well Bill..

             

            blcli_execute JobRun cancel DBKey:SJobKey:2002898-2 2046707

            Command execution failed. com.bladelogic.cli.factory.CommandNotFoundException: Found command 'JobRun.cancel' but with mismatching arguments.

            • 3. Re: blcli to cancel jobs
              Bill Robinson

              There's something wrong w/ the api command apparently, it can't covert the object type:

              Caused by: java.lang.IllegalArgumentException: Input 'DBKey:SJobKey:2000480-1' cannot be converted to expected type : interface com.bladelogic.app.service.job.JobKey

                   at com.bladelogic.cli.factory.CommandTemplate.throwConversionException(CommandTemplate.java:568)

                   at com.bladelogic.cli.factory.CommandTemplate.convertStringArgumentToRealArgument(CommandTemplate.java:555)

                   at com.bladelogic.cli.factory.CommandTemplate.convertArgsToRealArgs(CommandTemplate.java:451)

                   at com.bladelogic.cli.factory.CommandTemplateInventory.getCommandTemplate(CommandTemplateInventory.java:154)

                   ... 5 more

               

              So those commands (cancel/abort) apparently don't work.

              • 4. Re: blcli to cancel jobs
                Saurabh Kashikar

                In that case, is there any other command line way of cancelling jobs??

                • 5. Re: blcli to cancel jobs
                  Bill Robinson

                  I'm not sure, I don't see anything else that looks like it would work.  You could try opening a ticket w/ support and see if they can fix the cancel/abort commands