6 Replies Latest reply on Mar 4, 2010 1:51 PM by Adam Bowen

    blcli createDeployJob parameters

      The online blcli guide I'm referring to has four seperate entries for this command that all refer to different context for how to pass values to the command for both basic and advanced deploy options. I've tried all four and several variations and seem to always end up with the error "Unknown command : name space = 'DeployJob', command - 'createDeployJob.com.bladelogic.cli.factory.CommandNotFoundException: Could not find any instance of command "DeployJob,createDeployJob" with expected number of arguments: "xx"'

       

      xx will vary depending on how many I'm passing.

       

      What is a known/working form? My most recent is below...

       

      Note: not all values are defined below as many are defined much earlier in the NSH script (this is an excert).

       

      ###########
      # Step 7
      # Create Deploy Job
      JOB_GROUP_NAME="$PARENT_NAME/$FOLDER_NAME/$SUBFOLDER_NAME"
      JOB_GROUP_ID=`blcli JobGroup groupNameToId "${JOB_GROUP_NAME}"`
      TARGET_SERVER=winserv1
      TARGET_GROUP="/east/windows servers"
      DEPLOY_JOB_NAME="deploy base files"
       
      # script constants
      #deploy type
      ADVANCED=1
      BASIC=0
      #logging level
      ERROR_ONLY=0
      ERROR_AND_WARNING=1
      ALL_INFO=2
      DEPLOY_TYPE=$ADVANCED
      SIMULATE=true
      COMMIT=true
      INDIRECT=false
      LOG_LEVEL=$ERROR_AND_WARNING
      EXECUTE_BY_PHASE=true
      RESET_ON_FAILURE=false
      ALLOW_ROLLBACK=true
      ROLLBACK_ON_FAILURE=true
      REBOOT_IF_REQUIRED=true
      COPY_LOCKED_FILES=true
      STAGE_AFTER_SIMULATE=true
      COMMIT_AFTER_STAGE=true
      SINGLE_DEPLOY_MODE=false
      ENABLE_SINGLE_USER_MODE=true
      SINGLE_USER_MODE=0
      REBOOT_MODE=0
      ENABLE_MAX_DEPLOY_WAIT_TIME=true
      MAX_DEPLOY_WAIT_TIME=30
      ENABLE_AGENT_CONN_TIMEOUT=true
      AGENT_CONN_TIMEOUT=60
      BASIC_DEPLOY_OPTS="$SIMULATE $COMMIT $INDIRECT"
      ADVANCED_OPTS="$LOG_LEVEL"
      ADVANCED_OPTS="${ADVANCED_OPTS} $EXECUTE_BY_PHASE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $RESET_ON_FAILURE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $ALLOW_ROLLBACK"
      ADVANCED_OPTS="${ADVANCED_OPTS} $ROLLBACK_ON_FAILURE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $REBOOT_IF_REQUIRED"
      ADVANCED_OPTS="${ADVANCED_OPTS} $COPY_LOCKED_FILES"
      ADVANCED_OPTS="${ADVANCED_OPTS} $STAGE_AFTER_SIMULATE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $COMMIT_AFTER_STAGE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $SINGLE_DEPLOY_MODE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $ENABLE_SINGLE_USER_MODE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $SINGLE_USER_MODE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $REBOOT_MODE"
      ADVANCED_OPTS="${ADVANCED_OPTS} $ENABLE_MAX_DEPLOY_WAIT_TIME"
      ADVANCED_OPTS="${ADVANCED_OPTS} $MAX_DEPLOY_WAIT_TIME"
      ADVANCED_OPTS="${ADVANCED_OPTS} $ENABLE_AGENT_CONN_TIMEOUT"
      ADVANCED_OPTS="${ADVANCED_OPTS} $AGENT_CONN_TIMEOUT"
       
      DEPLOY_OPTS="${BASIC_DEPLOY_OPTS} ${ADVANCED_OPTS}"
       
      PACKAGE_KEY=`blcli BlPackage getDBKeyByGroupAndName "$DEPOT_GROUP_ID" "$PACKAGE_NAME"`

      DEPLOY_JOB_KEY=`blcli DeployJob createDeployJob "${DEPLOY_JOB_NAME}" $JOB_GROUP_ID $PACKAGE_KEY $DEPLOY_TYPE $TARGET_SERVER $DEPLOY_OPTS`
      DEPLOY_JOB_KEY=`blcli Job addTargetGroup $DEPLOY_JOB_KEY "${TARGET_GROUP}"`

        • 1. Re: blcli createDeployJob parameters
          Bill Robinson

          I wonder if $DEPLOY_OPTS is being taken as 1 arg and not multiple. 

           

          Also, can you add a line:

           

          Echo blcli DeployJob createDeployJob "$" $JOB_GROUP_ID $PACKAGE_KEY $DEPLOY_TYPE $TARGET_SERVER $DEPLOY_OPTS And then run that by hand. And... as a side note, you should be using the performance commands here like: Blcli_execute BlPackage getDBKeyByGroupAndName "$DEPOT_GROUP_ID" "$PACKAGE_NAME" Blcli_storeenv PACKAGE_KEY Blcli_execute DeployJob createDeployJob "$" $JOB_GROUP_ID $PACKAGE_KEY $DEPLOY_TYPE $TARGET_SERVER $DEPLOY_OPTS

          Blcli_storeenv DEPLOY_JOB_KEY

          Blcli_execute Job addTargetGroup $DEPLOY_JOB_KEY "$"

          Blcli_storeenv DEPLOY_JOB_KEY

          • 2. Re: blcli createDeployJob parameters

            The echo produces:

             

            blcli DeployJob createDeployJob $ 2001168 1 winserv1 true true false 1 true false true true true true true true false true 0 0 true 30 true 60

             

            I'm sure there are performance commands that will speed my script up; I'd rather get the script complete and working and then substitute the faster commands.

             

            As an aside, is there a document that lists the available performance commands?

            • 3. Re: blcli createDeployJob parameters
              Bill Robinson

              So when you run that command (blcli DeployJob createDeployJob $ 2001168 1 winserv1 true true false 1 true false true true true true true true false true 0 0 true 30 true 60) does it work?

               

              The performance commands are detailed in the blcli help docs.

               

              The only difference is the blcli_execute, blcli_ in the way you run the blcli.  The namespaces and commands are the same.  w/ the blcli, it opens a jvm, authenticates, runs command, closes.  The performance commands open the jvm, authenticates and leaves it open to run commands and script logic, then you can close it when you're done or the script ends.

              • 4. Re: blcli createDeployJob parameters

                When I run the command below via NSH directly, I get an error.

                 

                CMD:

                blcli DeployJob createDeployJob $ 2001168 1 winserv1 true true false 1 true false true true true true true true false true 0 0 true 30 true 60

                 

                ERROR:

                UTDWFAPC01% blcli DeployJob createDeployJob $ 2001168 1 winserv1 true true
                1 true false true true true true true true false true 0 0 true 30 true 60
                Unknown command : name space = 'DeployJob', command = 'createDeployJob'.com.blad
                elogic.cli.factory.CommandNotFoundException: Could not find any instance of comm
                and "DeployJob,createDeployJob" with expected number of arguments: 24

                • 5. Re: blcli createDeployJob parameters

                  It's right. The command takes 25 arguments, not 24. I think you are missing the packageKey  (goes in between your groupId (2001168) and deployType(1))

                  • 6. Re: blcli createDeployJob parameters

                    Ah.. confirming the 25 arguments helped. I also found I had one parameter for the BL_PACKAGE_ID incorrectly defined. Resolving that error and ensuring the parameter was in the correct position got it working.

                     

                    Thanks much.

                     

                    Larry