5 Replies Latest reply on Jun 27, 2012 8:42 PM by Adam Bowen

    Is it possible to use BladeLogic jar files instead of CLI?

      I see that the BL CLI is just making calls to Java objects.  Is it possible to just use the jar files in NSH/br/stdlib to make the calls instead of going through the BL CLI?  It would be nicer to make Java calls instea of writing nsh scripts.

        • 1. Is it possible to use BladeLogic jar files instead of CLI?
          John Van Ommen

          Hey Michael,

           

          Here are a few things that might help.

           

          But first, a warning -

           

          When i worked at BladeLogic and BMC, we consistently discouraged customers from directly accessing the database, or using unreleased CLI commands.  This is because it's easy to blow up a working environment by 'mucking around under the hood.'  And it also turns into a support nightmare.  IE, how can BMC support your environment if you're doing things that 99% of the users aren't?

           

          With that warning out of the way, here's some clues on how you might bypass the BladeLogic CLI.  I haven't encountered anyone that's done this, so it might not be possible.  But if you can figure it out, bypassing the CLI might be an elegant way to deploy BladeLogic solutions.  (Because it's a heck of a lot easier to deploy a single jar file than to deploy hundreds of Jython scripts.)

           

          Clue #1 -

           

          The essential BladeLogic class files live inside of "bladelogic.jar"

           

          Here's an abbreviated list; there are hundreds more:

           

          jar -tvf bladelogic.jar | cut -c 37-

          META-INF/

          META-INF/MANIFEST.MF

          com/

          com/bladelogic/

          com/bladelogic/app/

          com/bladelogic/app/api/

          com/bladelogic/app/api/agentparser/

          com/bladelogic/app/api/factory/

          com/bladelogic/app/api/languageparser/

          com/bladelogic/app/api/manage/

          com/bladelogic/app/api/parser/

          com/bladelogic/app/api/printparser/

          com/bladelogic/app/blpackage/

          com/bladelogic/app/collector/

          com/bladelogic/app/db/

          com/bladelogic/app/jni/

          com/bladelogic/app/nsh/

          com/bladelogic/app/option/

          com/bladelogic/app/patch/

          com/bladelogic/app/patch/analysisengine/

          com/bladelogic/app/pm/

          com/bladelogic/app/pm/bios/

          com/bladelogic/app/service/

          com/bladelogic/app/service/agentservice/

          com/bladelogic/app/service/agentservice/payload/

          com/bladelogic/app/service/agentservice/types/

          com/bladelogic/app/service/appserver/

          com/bladelogic/app/service/atrium2blsync/

          com/bladelogic/app/service/atrium2blsync/atriumhelper/

          com/bladelogic/app/service/authentication/

          com/bladelogic/app/service/authentication/srp/

          com/bladelogic/app/service/authentication/user/

          com/bladelogic/app/service/cleanup/

          com/bladelogic/app/service/client/

          com/bladelogic/app/service/contentimporter/

          com/bladelogic/app/service/diagnostics/

          com/bladelogic/app/service/diagnostics/test/

          com/bladelogic/app/service/diagnostics/test/keystore/

          com/bladelogic/app/service/diagnostics/test/snapshotjob/

          com/bladelogic/app/service/file/

          com/bladelogic/app/service/grammar/

          com/bladelogic/app/service/job/

          com/bladelogic/app/service/job/test/

          com/bladelogic/app/service/job/test/snapshotjob/

          com/bladelogic/app/service/launcher/

          com/bladelogic/app/service/ldap/

          com/bladelogic/app/service/manage/

          com/bladelogic/app/service/manage/auth/

          com/bladelogic/app/service/model/

          com/bladelogic/app/service/notification/

          com/bladelogic/app/service/pxe/

          com/bladelogic/app/service/rbac/

          com/bladelogic/app/service/schedule/

          com/bladelogic/app/service/support/

          com/bladelogic/app/service/support/data/

          com/bladelogic/app/template/

          com/bladelogic/app/util/

          com/bladelogic/auth/

          com/bladelogic/auth/client/

          com/bladelogic/blcli/

          com/bladelogic/cli/

          com/bladelogic/cli/blcred/

          com/bladelogic/cli/commands/

          com/bladelogic/cli/commands/export/

          com/bladelogic/cli/commands/hacks/

          com/bladelogic/cli/commands/importexport/

          com/bladelogic/cli/commands/launcher/

          com/bladelogic/cli/commands/provision/

          com/bladelogic/cli/commands/support/

          com/bladelogic/cli/commands/utility/

          com/bladelogic/cli/factory/

          com/bladelogic/cli/help/

          com/bladelogic/cli/helper/

          com/bladelogic/cli/testcase/

          com/bladelogic/cli/utils/

          com/bladelogic/cli/validators/

          com/bladelogic/client/

          com/bladelogic/client/bindings/

          com/bladelogic/client/cm/

          com/bladelogic/client/cm/actions/

          com/bladelogic/client/cm/appserver/

          com/bladelogic/client/cm/assetbrowser/

          com/bladelogic/client/cm/blpackage/

          com/bladelogic/client/cm/blpackage/creator/

          com/bladelogic/client/cm/blpackage/editor/

          com/bladelogic/client/cm/blpackage/patchpackager/

          com/bladelogic/client/cm/blpackage/rules/

          com/bladelogic/client/cm/blpatch/

          com/bladelogic/client/cm/builder/

          com/bladelogic/client/cm/changetracking/

          com/bladelogic/client/cm/compliance/

          com/bladelogic/client/cm/component/

          com/bladelogic/client/cm/conditions/

          com/bladelogic/client/cm/conditions/assets/

          com/bladelogic/client/cm/conditions/nested/

          com/bladelogic/client/cm/conditions/properties/

          com/bladelogic/client/cm/configobjects/

          com/bladelogic/client/cm/custcmd/

          com/bladelogic/client/cm/customicon/

          com/bladelogic/client/cm/dependency/

          com/bladelogic/client/cm/deploy/

          com/bladelogic/client/cm/depot/

          com/bladelogic/client/cm/depot/patch/

          com/bladelogic/client/cm/diagnostics/

          com/bladelogic/client/cm/diff/

          com/bladelogic/client/cm/discovery/

          com/bladelogic/client/cm/dotnet/

          com/bladelogic/client/cm/dotnet/asmcache/

          com/bladelogic/client/cm/extobj/

          com/bladelogic/client/cm/gpo/

          com/bladelogic/client/cm/groups/

          com/bladelogic/client/cm/importexport/

          com/bladelogic/client/cm/infrastructure/

          com/bladelogic/model/

          com/bladelogic/model/appserver/

          com/bladelogic/model/asset/

          com/bladelogic/model/asset/application/

          com/bladelogic/model/asset/base/

          com/bladelogic/model/asset/complus/

          com/bladelogic/model/asset/config/

          com/bladelogic/model/asset/dotnet/

          com/bladelogic/model/asset/dotnet/asmcache/

          com/bladelogic/model/asset/event/

          com/bladelogic/model/asset/file/

          com/bladelogic/model/asset/generic/

          com/bladelogic/model/asset/gpo/

          com/bladelogic/model/asset/metabase/

          com/bladelogic/model/asset/patch/

          com/bladelogic/model/asset/registry/

          com/bladelogic/model/asset/service/

          com/bladelogic/model/asset/systeminfo/

          com/bladelogic/model/asset/usersgroups/

          com/bladelogic/model/asset/virtual/

          com/bladelogic/model/assetmatcher/

          com/bladelogic/model/assetselector/

          com/bladelogic/model/assetselector/result/

          com/bladelogic/model/atrium2blsync/

          com/bladelogic/model/audit/

          com/bladelogic/model/authentication/

          com/bladelogic/model/authentication/user/

          com/bladelogic/model/base/

          com/bladelogic/model/base/dependency/

          com/bladelogic/model/base/dependency/cleanup/

          com/bladelogic/model/base/dependency/external/

          com/bladelogic/model/base/dependency/graph/

          com/bladelogic/model/base/dependency/importer/

          com/bladelogic/model/base/dependency/importer/converters/

          com/bladelogic/model/base/dependency/importer/selectors/

          com/bladelogic/model/base/dependency/xml/

          com/bladelogic/model/base/header/

          com/bladelogic/model/base/keys/

          com/bladelogic/model/base/views/

          com/bladelogic/model/characterencoding/

          com/bladelogic/model/cleanup/

          com/bladelogic/model/cleanup/patches/

          com/bladelogic/model/component/

          com/bladelogic/model/component/exception/

          com/bladelogic/model/condition/

          com/bladelogic/model/condition/expression/

          com/bladelogic/model/condition/result/

          com/bladelogic/model/configfile/

          com/bladelogic/model/customcommand/

          com/bladelogic/model/daalplugin/

          com/bladelogic/model/depot/

          com/bladelogic/model/depot/blpackage/

          com/bladelogic/model/depot/file/

          com/bladelogic/model/depot/patch/

          com/bladelogic/model/depot/script/

          com/bladelogic/model/depot/software/

          com/bladelogic/model/filelocation/

          com/bladelogic/model/generic/

          com/bladelogic/model/generic/adapter/

          com/bladelogic/model/generic/metadata/

          com/bladelogic/model/group/

          com/bladelogic/model/group/smartgroup/

          com/bladelogic/model/importexport/

          com/bladelogic/model/infrastructure/

          com/bladelogic/model/job/

          com/bladelogic/model/job/aclpush/

          com/bladelogic/model/job/atrium2blsync/

          com/bladelogic/model/job/batch/

          com/bladelogic/model/job/compliance/

          com/bladelogic/model/job/compliance/audit/

          com/bladelogic/model/job/compliance/audit/auditor/

          com/bladelogic/model/job/compliance/compliance/

          com/bladelogic/model/job/compliance/patch/

          com/bladelogic/model/job/daalplugin/

          com/bladelogic/model/job/deploy/

          com/bladelogic/model/job/discovery/

          com/bladelogic/model/job/executor/

          com/bladelogic/model/job/jobrun/

          com/bladelogic/model/job/log/

          com/bladelogic/model/job/packagebuilder/

          com/bladelogic/model/job/patchsubscription/

          com/bladelogic/model/job/policyupgrade/

          com/bladelogic/model/job/progress/

          com/bladelogic/model/job/provision/

          com/bladelogic/model/job/result/

          com/bladelogic/model/job/schedule/

          com/bladelogic/model/job/script/

          com/bladelogic/model/job/snapshot/

          com/bladelogic/model/job/snapshot/snapshotter/

          com/bladelogic/model/job/updateserver/

          com/bladelogic/model/job/workitem/

          com/bladelogic/model/merge/

          com/bladelogic/model/notification/

          com/bladelogic/model/option/

          com/bladelogic/model/primitive/

          com/bladelogic/model/primitive/typedef/

          com/bladelogic/model/property/

          com/bladelogic/model/provision/

          com/bladelogic/model/provision/bootimages/

          com/bladelogic/model/provision/systempackage/

          com/bladelogic/model/provision/systempackage/jumpstart/

          com/bladelogic/model/proxyserver/

          com/bladelogic/model/rbac/

          com/bladelogic/model/repeaterserver/

          com/bladelogic/model/route/

          com/bladelogic/model/server/

          com/bladelogic/model/server/agentlog/

          com/bladelogic/model/snapshot/

          com/bladelogic/model/snapshot/changetracking/

          com/bladelogic/model/snapshot/changetracking/export/

          com/bladelogic/model/template/

          com/bladelogic/model/test/

          com/bladelogic/model/typesystem/

          com/bladelogic/model/typesystem/type/

          com/bladelogic/model/typesystem/value/

          com/bladelogic/model/util/

          com/bladelogic/provision/

          • 2. Is it possible to use BladeLogic jar files instead of CLI?
            John Van Ommen

            Here's clue #2.

             

            You're going to need some documentation for those class files.

             

            You can get the instructions on how to extract the unrelased CLI commands here:

             

            https://communities.bmc.com/communities/message/128172#128172

             

            But if you review that shell script, it looks to me that you might be able to coerce it into generating docs for more than just the CLI commands.

             

            For instance, here's the 'main' snippet of the shell script that generates the docs:

             

            com.bladelogic.cli.help.HelpGenerator "/usr/nsh/br/xml/cli" "/tmp/unrel"

             

            If I'm reading it right, this command is saying "look in the folder '/usr/nsh/br/xml/cli' and generate doc files for everything that's in that folder"

             

            BUT -

             

            Perhaps you could add your own XML entries in there?  IE, what's stopping you from having it generate documentation for all the classes?

             

            Here's one of the XML entries, to give you some ideas:

             

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

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

            <command_inventory>

                <name_space name="Server">

                    <api_command command_id="createInstance-DEFAULT-16273"

                        published="no" release="no">

                        <name>createInstance</name>

                        <description>

                            <author/>

                            <paragraph>

                                <string_literal/>

                            </paragraph>

                            <return_value_info/>

                        </description>

                        <class_name use_as_default_target="yes">com.bladelogic.model.server.ServerFactory</class_name>

                        <method_name>createInstance</method_name>

                        <argument_list>

                            <argument desc="" name="msg">com.bladelogic.mfw.msg.BlMessage</argument>

                        </argument_list>

                        <return_type>com.bladelogic.model.server.Server</return_type>

                    </api_command>

                    <load_command command_id="loadNew-DEFAULT-16274" published="no" release="no">

                        <name>loadNew</name>

                        <description>

                            <author/>

                            <paragraph>

                                <string_literal/>

                            </paragraph>

                            <return_value_info/>

                        </description>

                        <argument_list>

                            <argument desc="" name="msg">com.bladelogic.mfw.msg.BlMessage</argument>

                        </argument_list>

                        <command_invocation>

                            <namespace_ref>Server</namespace_ref>

                            <name>createInstance</name>

                            <input>$msg$</input>

                        </command_invocation>

                    </load_command>

                    <api_command command_id="createInstance-DEFAULT-16275"

                        published="no" release="no">

                        <name>createInstance</name>

                        <description>

                            <author/>

                            <paragraph>

                                <string_literal/>

                            </paragraph>

                            <return_value_info/>

                        </description>

                        <class_name use_as_default_target="yes">com.bladelogic.model.server.ServerFactory</class_name>

                        <method_name>createInstance</method_name>

                        <argument_list/>

                        <return_type>com.bladelogic.model.server.Server</return_type>

                    </api_command>

                    <load_command command_id="loadNew-DEFAULT-16276" published="no" release="no">

                        <name>loadNew</name>

                        <description>

                            <author/>

                            <paragraph>

                                <string_literal/>

                            </paragraph>

                            <return_value_info/>

                        </description>

                        <argument_list/>

                        <command_invocation>

                            <namespace_ref>Server</namespace_ref>

                            <name>createInstance</name>

                            <input/>

                        </command_invocation>

                    </load_command>

                </name_space>

            </command_inventory>

            • 3. Is it possible to use BladeLogic jar files instead of CLI?

              Thanks for your response.  I wasn't able to find a bladelogic.jar file.  I have the following jar files:

               

               

              bladelogic_acm.jar

              bladelogic_blvmware.jar

              bladelogic_bsmintegration.jar

              bladelogic_caconvert.jar

              bladelogic_caformat.jar

              bladelogic_camodel.jar

              bladelogic_common.jar

              bladelogic_dbdiagnostics.jar

              bladelogic_deploy.jar

              bladelogic_gei.jar

              bladelogic_infra.jar

              bladelogic_infraui.jar

              bladelogic_licensing.jar

              bladelogic_patch.jar

              bladelogic_provisioning.jar

              bladelogic_spring_beans.jar

              bladelogic_ucs.jar

              bladelogic_virtualization.jar

              bladelogic_vsm.jar

              bladelogic_webservices.jar

              bladelogic_webservices-client.jar

               

               

              I don't think I want to do something that is unsupported.  I just thought since the CLI was just calling the classes in the jar files anyway, it might be simple to just skip the shell scripts.  If it's not going to be supported, then I think I'll just stick the the shell scripts. 

              • 4. Re: Is it possible to use BladeLogic jar files instead of CLI?
                Bill Robinson

                It’s not something that is currently supported.

                • 5. Re: Is it possible to use BladeLogic jar files instead of CLI?

                  Definitely would not be supported. We have a customer that tried to attempt this, and they ran into problem after problem. Good idea, but I would stick to using the blcli performance commands and NSH.