7 Replies Latest reply on Dec 5, 2011 12:15 PM by Paul Seager-Smith

    Adding a new BLCLI XML in 8.1

    Paul Seager-Smith

      Has anything changed in BL 8.1 in the handling of custom blcli xml files?

       

      I have added a new XML file to the nsh/br/cli/xml folder (a new version of the RBACRole:createRole command with 6 args - set as a released command). Running the generate unreleased blcli command creates the HTML showing this new blcli command with the 6 args:

       

      Command Name : createRole

      Do not modify, published by technical writer

      Name space : RBACRole

      Command Type : Complex

      Release command : true

      Author :

      Bill Robinson

      Description :

      Return type : DBKey

      Command Input :

      Variable Name

      Variable Type

      Description

      roleName

      String

      name of role to be created

      roleDesc

      String

      description of role to be created

      flags

      Integer

      agent acl flags

      unixProp

      String

      unix user property map

      winProp

      String

      windows property map

      propFlag

      Boolean

      property

       

      but when I run the command, I get an error about the number of args:

       

      BL-OPMAN# blcli_execute RBACRole createRole "ACME_PatchAdmins" "ACME Patching Ad

      ministrators" "8" "_ADMIN_ACCOUNT" "_ADMIN_ACCOUNT" true

      Command execution failed. com.bladelogic.om.infra.cli.factory.CommandNotFoundExc

      eption: Could not find any instance of command "RBACRole,createRole" with expect

      ed number of arguments: 6

       

      This all worked fine on 8.0, but this is the first time that I have tried with 8.1. Do I need to register the new command somehow with 8.1?

       

      Thanks,

       

       

      Paul

        • 1. Re: Adding a new BLCLI XML in 8.1
          Bill Robinson

          Can you past your xml file?  also what did you name it ?

          • 2. Re: Adding a new BLCLI XML in 8.1
            Paul Seager-Smith

            Hi Bill, it's one of yours: rbacrole-ps-0001.xml

             

            <?xml version="1.0" encoding="UTF-8"?>

            <!DOCTYPE command_inventory SYSTEM "file://bladelogic.com/dtds/Command-Inventory.dtd">

            <command_inventory>

                <name_space name="RBACRole">

            <complex_command command_id="createRole-PS-0001" published="yes" release="yes">

                        <name>createRole</name>

                        <description>

                            <author>Bill Robinson</author>

                                <paragraph>

                                 <string_literal/>

                            </paragraph>

                            <return_value_info/>

                        </description>

                        <argument_list>

                            <argument desc="name of role to be created" name="roleName">java.lang.String</argument>

                            <argument desc="description of role to be created" name="roleDesc">java.lang.String</argument>

                            <argument desc="agent acl flags" name="flags">int</argument>

                            <argument desc="unix user property map" name="unixProp">java.lang.String</argument>

                            <argument desc="windows property map" name="winProp">java.lang.String</argument>

                            <argument desc="property" name="propFlag">boolean</argument>

                        </argument_list>

                        <commands_to_execute>

                            <command_invocation>

                                <namespace_ref>RBACRole</namespace_ref>

                                <name>createInstance</name>

                                <input/>

                                                              <store_result><name>role</name></store_result>

                            </command_invocation>

                                                    <command_invocation>

                                <namespace_ref>Utility</namespace_ref>

                                <name>setTargetObject</name>

                                <input>role</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>RBACRole</namespace_ref>

                                <name>setName</name>

                                <input>$roleName$</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>RBACRole</namespace_ref>

                                <name>setDescription</name>

                                <input>$roleDesc$</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>RBACRole</namespace_ref>

                                <name>getAgentAcl</name>

                                <input></input>

                                <store_result><name>agentAcl</name></store_result>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>Utility</namespace_ref>

                                <name>setTargetObject</name>

                                <input>agentAcl</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>AgentAcl</namespace_ref>

                                <name>setFlags</name>

                                <input>$flags$</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>AgentAcl</namespace_ref>

                                <name>setServerPropertyUsed</name>

                                <input>true 1</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>AgentAcl</namespace_ref>

                                <name>setUserMapServerPropertyName</name>

                                <input>$winProp$ 1</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>AgentAcl</namespace_ref>

                                <name>setServerPropertyUsed</name>

                                <input>true 2</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>AgentAcl</namespace_ref>

                                <name>setUserMapServerPropertyName</name>

                                <input>$unixProp$ 2</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>Utility</namespace_ref>

                                <name>setTargetObject</name>

                                <input>role</input>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>RBACRole</namespace_ref>

                                <name>create</name>

                                <input/>

                            </command_invocation>

                            <command_invocation>

                                <namespace_ref>RBACRole</namespace_ref>

                                <name>getDBKey</name>

                                <input/>

                            </command_invocation>

                        </commands_to_execute>

                    </complex_command>

                </name_space>

            </command_inventory>

            • 3. Re: Adding a new BLCLI XML in 8.1
              Bill Robinson

              you started your nsh session after you added the file to the directory right?

              • 4. Re: Adding a new BLCLI XML in 8.1
                Paul Seager-Smith

                Yes, I have restarted several times since - I even restarted the app server, although I don't know why that would help.

                • 5. Re: Adding a new BLCLI XML in 8.1
                  Paul Seager-Smith

                  OK, managed to get to the bottom of this one:

                   

                  At least from 8.1 SP3, the filename of the XML must begin with the blcli namespace and it is case-sensitive!

                   

                  I renamed the file to

                   

                  RBACRole-PS-001.xml

                   

                  and it picked it up and worked fine !

                   

                  I suppose I should have suspected a case issue with NSH

                  • 6. Re: Adding a new BLCLI XML in 8.1
                    Bill Robinson

                    Ok mr windows… in the rest of the world, case matters ☺

                    • 7. Re: Adding a new BLCLI XML in 8.1
                      Paul Seager-Smith

                      Yes, touch embarassing considering the numer of times I have said this to other people