7 Replies Latest reply on Jan 6, 2015 10:14 AM by richard mcleod

    BLCLI: Creating a Depot Smart Group using 'is one of'

    richard mcleod

      I'm working on creating custom patch smart group, I have a list of a 140 RPMs that I desperately do not want to manually type into the input box. So I have a few questions

       

      1) Is there any sample or directive on how to supply values for the is one of operator in blcli?

       

      Do I just quote the list out like this?

       

      ""package1","package2","package3","etc""

       

      2) If the above is possible, can I use a similar method to populate a custom property in the dictionary?

       

      I would create a custom class, called whatever_patch_group, I would add a property called package_name as List [String], I would then like to fill this list with the list of RPMs. Then leverage this property value in my script to create the smart group.

       

      This will help streamline future patch smart group management creation.

        • 1. Re: BLCLI: Creating a Depot Smart Group using 'is one of'
          richard mcleod

          So I was able to create a Depot Smart Group but was unable to figure out how to get the group to be created under the Patch Catalog...

           

          command: blcli_execute SmartDepotGroup createGroup "/path/to/parent/depot/folder" "Generic RPMs" "List of Generic RPMs" "Class://SystemObject/Depot Object/Software/RPM/" "RPM_PACKAGE*" "is one of" "[value1,value2,value3,etc]"

           

          Anyone know how to get this command executed under the Patch Catalog?

           

          This is the error I get when I reference the path to the patch catalog in the command above

           

          Command execution failed. com.bladelogic.om.infra.mfw.util.NotFoundException: Could not find group with name : /path/to/parent/depot/folder and type : 5001: com.bladelogic.om.infra.mfw.util.NotFoundException: Could not find child group by name : RHEL64z with parent of type : 2 and id : 2006545

           

          Also good to note: YOU CAN DRAG A SMART GROUP INTO A PATCH CATALOG BUT IT JUST DISAPPEARS! It's somewhere in the abyss now I guess?

          • 3. Re: BLCLI: Creating a Depot Smart Group using 'is one of'
            Bill Robinson

            it might be easier to create a property of each of those rpm objects and then use the property in the group creation.

            • 4. Re: BLCLI: Creating a Depot Smart Group using 'is one of'
              richard mcleod

              Can you reference the default RPMs smart group to get the list of objects? because I was also thinking about creating a property and specifying the catalog name. didn't take it any further because my attempts at targeting the smart group in blcli failed because it doesnt see the catalog as a depot group

              • 5. Re: BLCLI: Creating a Depot Smart Group using 'is one of'
                Bill Robinson

                Yeah – there’s a command to dump all the rpms in the catalog and then you can use the depotsoftware or whatever command to set the property directly w/ the db key of the rpm object.

                • 6. Re: BLCLI: Creating a Depot Smart Group using 'is one of'
                  Yanick Girouard

                  Check your idea to add blcli for creating patch catalog smartgroups, the answer is in there. It's already possible to do it, but you were using the wrong blcli commands (the one you need is unreleased).

                   

                  For the is one of condition, you need it like this. This example was used to create a Windows catalog smartgroup listing QNumbers, but you can change it to whatever you like by changing the class of the object you want.

                   

                  blcli_execute Condition createPropertyCondition "Class://SystemObject/Depot Object/Software/Win Depot Software/HotFix" "QNUMBER*" "is one of" "[Q2028551,Q2121546,Q2158563,Q2160329,Q2160841,Q2183461,Q2207559,Q2207566,Q2259922,Q2272691,Q2279986,Q2286198,Q2296199,Q2345316,Q2360131,Q2362765,Q2385678,Q2386792,Q2388210,Q2416400,Q2416447,Q2416451,Q2416468,Q2416469,Q2416470,Q2416471,Q2416472,Q2416473,Q2416474,Q2418240,Q2418241,Q2436673,Q2443685,Q2446704,Q2446708,Q2446709,Q2446710,Q2449741,Q2449742,Q2475792,Q2476490,Q2476687,Q2478656,Q2478657,Q2478658,Q2478659,Q2478660,Q2478661,Q2478662,Q2478663,Q2479628,Q2482017,Q2485376,Q2497640,Q2503658,Q2503665,Q2506223,Q2507938,Q2508272,Q2508429,Q2511455,Q251170,Q2518863,Q2518864,Q2518865,Q2518866,Q2518867,Q2518869,Q2518870,Q2524375,Q2524426,Q2525694,Q252795,Q2530095,Q2530548,Q2539631,Q2539633,Q2539634,Q2539635,Q2539636,Q2555917,Q2556532,Q2559049,Q2562485,Q2563894,Q2567053,Q2567680,Q2570222,Q2570791,Q2572066,Q2572067,Q2572069,Q2572073,Q2572075,Q2572076,Q2572077,Q2572078,Q257870,Q2586448,Q2588516,Q2592799,Q259401,Q259622,Q259728,Q2601626,Q2607712,Q2616310,Q2616676,Q2617657,Q2618444,Q262694,Q2633870,Q2633873,Q2633874,Q2633879,Q2633880,Q2639417,Q2641653,Q2645640,Q2647516,Q265258,Q2656351,Q2656352,Q2656353,Q2656355,Q2656356,Q2656358,Q2656362,Q2657424,Q2660465,Q266433,Q2665364,Q267843,Q269049,Q269239,Q269609,Q274835,Q276471,Q276575,Q278499,Q279328,Q280419,Q285156,Q285851,Q286043,Q286045,Q290108,Q292435,Q293818,Q295106,Q296138,Q296185,Q298012,Q299553,Q299618,Q299687,Q299796,Q302755,Q303984,Q304404,Q306121,Q307298,Q307454,Q308567,Q311401,Q312461,Q313675,Q316059,Q319182,Q321232,Q323255,Q323759,Q324096,Q324380,Q324929,Q326573,Q328310,Q328389,Q328676,Q328970,Q329077,Q329115,Q329170,Q330994,Q331953,Q810030,Q810847,Q811493,Q813489,Q814078,Q815021,Q817606,Q818529,Q819639,Q819696,Q822343,Q822679,Q822925,Q823182,Q823353,Q823559,Q823718,Q823980,Q824105,Q824141,Q824145,Q824146,Q825119,Q826232,Q828026,Q828028,Q828035,Q828741,Q828749,Q828750,Q830348,Q830352,Q832359,Q832483,Q832894,Q833987,Q833989,Q834707,Q835732,Q837001,Q837009,Q839643,Q839645,Q840315,Q840987,Q841356,Q841533,Q841872,Q841873,Q842526,Q867282,Q867801,Q870763,Q871250,Q873333,Q873339,Q883939,Q885250,Q885492,Q885834,Q885835,Q885836,Q885881,Q886903,Q886904,Q886905,Q886906,Q887998,Q888113,Q888240,Q889293,Q890046,Q890047,Q890175,Q890859,Q890923,Q891711,Q891781,Q892944,Q893066,Q893086,Q894320,Q896422,Q896424,Q896426,Q896688,Q896727,Q897715,Q899588,Q899589,Q901017,Q902400,Q903235,Q904706,Q905915,Q908519,Q908523,Q910620,Q911280,Q911562,Q911565,Q911567,Q912812,Q912919,Q912945,Q913446,Q914389,Q915786,Q916281,Q917159,Q917344,Q917422,Q917734,Q917736,Q917953,Q918899,Q920214,Q920685,Q920958,Q921398,Q921503,Q921883,Q922616,Q922760,Q922819,Q923167,Q923414,Q923561,Q923689,Q923694,Q924191,Q924286,Q924667,Q925256,Q925398,Q925454,Q925486,Q925672,Q925673,Q926122,Q927779,Q927977,Q927978,Q928090,Q928365,Q928366,Q928367,Q929120,Q929729,Q929969,Q930178,Q930494,Q931374,Q931768,Q931784,Q931836,Q932168,Q933360,Q933367,Q933369,Q933566,Q933579,Q933729,Q933854,Q935839,Q935840,Q935966,Q936021,Q936181,Q936782,Q937143,Q937894,Q938127,Q938464,Q938829,Q939653,Q941202,Q941568,Q941644,Q941672,Q941693,Q942615,Q942763,Q943055,Q943484,Q943485,Q944533,Q945553,Q946627,Q947518,Q947739,Q947742,Q947746,Q947748,Q947864,Q948590,Q948745,Q948881,Q949014,Q949269,Q950582,Q950759,Q950760,Q951066,Q951071,Q951116,Q951698,Q951746,Q951748,Q952069,Q953026,Q953297,Q953298,Q953300,Q953838,Q953839,Q954156,Q954211,Q954366,Q954430,Q954459,Q954600,Q955069,Q956390,Q956391,Q956744,Q956803,Q956841,Q957095,Q957097,Q957280,Q957388,Q958215,Q958469,Q958470,Q958471,Q958687,Q958690,Q958869,Q958911,Q959772,Q960714,Q960715,Q961063,Q961064,Q961260,Q961371,Q961373,Q963027,Q967723,Q968537,Q969805,Q969883,Q969897,Q969947,Q970238,Q970437,Q970653,Q971089,Q971090,Q971091,Q971092,Q971108,Q971110,Q971111,Q971468,Q971486,Q971557,Q971633,Q971961,Q972260,Q972593,Q972594,Q973037,Q973039,Q973346,Q973354,Q973507,Q973525,Q973540,Q973544,Q973551,Q973552,Q973673,Q973674,Q973675,Q973815,Q973869,Q974145,Q974291,Q974332,Q974417,Q974455,Q974469,Q974470,Q975364,Q975517,Q975542,Q975561,Q975562,Q976098,Q976264,Q976323,Q976325,Q976749,Q977165,Q977290,Q978037,Q978207,Q978251,Q978262,Q978506,Q978601,Q978695,Q978886,Q979309,Q979332,Q979402,Q979482,Q979559,Q979683,Q979906,Q979907,Q979909,Q979910,Q979911,Q979913,Q979916,Q980182,Q980195,Q980218,Q980232,Q980302,Q980436,Q980846,Q981332,Q981349,Q981350,Q981550,Q981793,Q981852,Q981957,Q981997,Q982000,Q982214,Q982381,Q982519,Q982632,Q982664,Q982802,Q982865,Q983582,Q983583,Q983587,Q983588,Q983589,Q983590]"

                   

                  The class for RPMs is this one: "Class://SystemObject/Depot Object/Software/RPM", and this is how you can find it:

                   

                  01-06-15 10-33-47 AM.png

                  • 7. Re: BLCLI: Creating a Depot Smart Group using 'is one of'
                    richard mcleod

                    Yup - I have it working using RPM_PACKAGE* is one of "$patchList" super cool, thanks again