8 Replies Latest reply on Dec 20, 2010 5:57 PM by Bill Robinson

    Bulk append to property

      I'd like to append values in bulk to a String/LongText property in BBSA. If I go to 'Set Property' for the items the entry is blank. If, for instance , the property is called INCLUDE, I've trieded setting "??INCLUDE?? new value". This results in the property containing the explicit entry "??INCLUDE?? new value" - ??INCLUDE?? is not expanded.

      I've considered scripting this but the property in quest in is a Bulletin and there seems no straight forward way to retrieve/set property on this depot objects under a give smart group in a catalogue.

      Thanks for your time.

        • 1. Re: Bulk append to property

          You would have to script this.

          • 2. Re: Bulk append to property

            Time to roll up my sleeves and delve into the unpublished API I think.

            Thanks for the prompt response Adam

            • 3. Re: Bulk append to property

              No problem. It shouldn't be too difficult to script, if it is any consolation to you.

              • 4. Re: Bulk append to property

                If I can just get at the data I need then it shouldn't be too bad but I don't understand how to get all objects under a group and iterate through then. I can get the group using



                blcli_execute Group getGroupByQualifiedName 5017 "/Patch_Depot/Windows_2003/My_Patch_Group"


                but I can't find a way to interate through what is in the group. I've seen the Namespace getChildren command but that strikes me a rather low level (not to mention requiring three addition java objects)


                Regard the groupType (5017 in the above sample), is there a list of these values somewhere?


                Is there a document, other than the best practice, that shows how the various commands/object hang together?

                • 5. Re: Bulk append to property

                  Have you generated the unreleased command documentation yet?

                  • 6. Re: Bulk append to property
                    Bill Robinson

                    The easiest way would be to do something like:


                    Blcli_execute Group.getByQualifiedGroupName

                    Blcli_execute DepotOjbect.getDBKey

                    Blcil_execute Utiliity setTargetObject

                    blclI_execute Utility.listPrint

                    Blcli_storeenv dbkeys


                    For key in $dbKeys


                    Blcli_execute ….



                    I just put up the object type id listings:



                    I’m not sure if you can dump all the members of a smart group w/ the blcli.


                    As far as appending, you are probably going to have to dump each value, append the additional text and then set the value.


                    Also, look in the scripting community, there is a document about using the unreleased commands.


                    1 of 1 people found this helpful
                    • 7. Re: Bulk append to property

                      Thanks both. I have already generated the unreleased document.


                      I've tried DepotObject getDBKey but got an exception. Group getDBKey works.


                      The Utility.listPrint fails with:


                      Command execution failed. java.lang.IllegalArgumentException: Input object was not a list : DBKey:SBLGroupModelKeyImpl:2001798-5424137


                      Looking through like Group commands I can't find an intermediary Load or Complex command that produces a list of objects.


                      The Group in question is actually a SmartGroup, or maybe more accurately a SmartDepotGroup (under a patch catalogue) rather than a static Group.


                      On a slight seperate note, is there a relationship between the java class and the namespaces? For example, how would I find out how to general a  com.bladelogic.model.base.SCompRemediationTemplate?

                      • 8. Re: Bulk append to property
                        Bill Robinson

                        to dump depot objects in a group do like:

                        blcli_execute Group groupNameToId "/Path/to/catalog/smart group" 5017

                        blcli_execute DepotObject findAllByGroup 2014105 true

                        blcli_execute DepotObject getDBKey

                        blcli_execute Utility setTargetObject

                        blcli_execute Utility listPrint

                        blcli_execute Utility setTargetObject

                        blcli_storeenv DBKeys


                        you'll need to get the right object id for the group type, and you might use server objects and depot objects.


                        there is a relation between the java classes and the namespaces, there are some 'create' commands in the various namespaces. 

                        1 of 1 people found this helpful