9 Replies Latest reply on Dec 23, 2015 3:34 AM by Jim Wilson

    I need some cleanup!

      I need to be able to delete/remove a component template, job, and depot, via CLI objects respectively.

      I'm not finding the commands to do so.

        • 1. Re: I need some cleanup!
          Siddu angadi

          Hi Bill,


          It is recomended to delete the objects manually, since each object will be having dependencies and once you delete the object, it can be restored provided you have not runt he clean-up script.


          If you want to delete objects, create smart group with a proper filter-->then right click on the smart group-->Select the Group Exploere View-->Hold shift/Ctl select the all objects--> delete it.   Then it will ask for confirmation to delete the dependency for each object.




          • 2. Re: I need some cleanup!
            Siddu angadi

            Once you delete, make sure to run the Database and File Server clean-up utility to delete permanently.




            • 3. Re: I need some cleanup!
              Bill Robinson

              Siddu - he's asking for blcli commands to delete the objects...


              Bill - most of the namespaces will have a 'deleteBlah' command - eg 'Template deleteTemplate' though some of these are 'unreleased'.  all of these commands end up calling 'Delete deleteModelObjectAndDependentObjects' which takes the object type id (int) and the dbkey of the object.  typically you can do something like this:


              blcli_execute SnapshotJob getDBKeyByGroupAndName "/some/group" "job"

              blclI_storeenv jobKey

              blcli_execute Job findByDBKey ${jobKey}

              blcli_execute Job getType

              blcli_storeenv jobType

              blcli_execute Delete deleteModelObjectAndDependendObjects ${jobType} ${jobKey}

              • 4. Re: I need some cleanup!
                Bill Robinson

                also as siddu mentions, this is a soft-delete - all deletes through the UI or blcli will only soft delete the object meaning they are still in the database but do not show in the ui.  to hard delete all objects that are soft deleted you will need to run cleanup

                • 5. Re: I need some cleanup!

                  thanks! @Bill Robinson


                  ok, the 'unreleased' bit does not worry me, as I'm using the blcli_execute to access them. As I understand those commands come configured by default for that type of executeion.


                  Apparently, I did not know enough to phrase my question correctly.


                  Is there a "rename" and/or "move" that I could use, prior to those deletes?


                  We have some automated scripts which are building these objects, and have failed part way through ... we really need to re-use those same object names ... NOW!  (sorry, just making sure you understand that we do not have time for a system cleanup to occur)


                  So, my thought is to rename the objects, appending a unique string to them respectively, then delete ... or move them to a uniquely named group for deletion.

                  • 6. Re: I need some cleanup!
                    Bill Robinson

                    why not just delete ?


                    if you want to move you can do like:

                    blcli_execute JobGroup groupNameToId "/some/group"

                    blcli_storeenv groupId

                    blcli_execute SnapshotJob getDBKeyByGroupAndName "/some/group" "job"

                    blclI_storeenv jobKey

                    blcli_execute Job findByDBKey ${jobKey}

                    blcli_execute Utility storeTargetObject job

                    blcli_execute Job getGroupId ${groupId}

                    blcli_execute Job update NAMED_OBJECT=job

                    • 7. Re: I need some cleanup!

                      The correct spelling is



                      • 8. Re: I need some cleanup!
                        Yanick Girouard

                        If it was just me, I'd do it using a SQL queries that update the objects directly to change their name, as there are no blcli commands that you can directly use to rename all types of objects you'd need. It would be multiple lines that would be different for each type of object (template, job, component, depot object) to load, set a new name and save.


                        How many of those objects would you have to rename so you can reuse them, and what types are they exactly ?


                        Component names have to be unique across the whole environment, so you'd have to delete them or rename them to reuse them. Component templates, depot objects and jobs names don't have to be unique as long as their are not within the same group id (same folder), so you could move them.


                        We'd need more details to be able to help you...

                        • 9. Re: I need some cleanup!
                          Jim Wilson


                          The spelling of the only occurrence in this discussion matches exactly with what you have posted