6 Replies Latest reply on Apr 15, 2013 9:46 PM by Bill Robinson

    Need help writing a script that will collect Depot Object properties

      I am trying to write a script that would create a report on all the Depot Objects in my environment; including the values of a couple of custom properties of the objects. After searching and researching, including in the communities, I found a couple of custom commands that I think should provide the information I need and wrote the following script:

       

      blcli_execute SmartDepotGroup groupNameToId /allObjects
      blcli_storeenv DEPOT_GROUP_ID
      blcli_execute DepotObject listAllByGroup ${DEPOT_GROUP_ID}
      blcli_execute DepotObject getDBKey
      blcli_execute Utility setTargetObject
      blcli_execute Utility listPrint
      blcli_storeenv DEPOT_OBJECT_KEYS
           for DEPOT_OBJECT_KEY in ${DEPOT_OBJECT_KEYS}
           do
           blcli_execute DepotObject findByDBKey ${KEY}
                blcli_execute DepotObject getAssociatedInstanceBean
           blcli_execute Utility setTargetObject
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString ROLE_CREATED
           blcli_storeenv ROLE_CREATED
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString USER_CREATED
           blcli_storeenv USER_CREATED
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString NAME
           blcli_storeenv NAME
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString DATE_CREATED
         blcli_storeenv DATE_CREATED
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString CustomProperty1
         blcli_storeenv CustomProperty1
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString CustomProperty2
         blcli_storeenv CustomProperty2
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString USER_MODIFIED
         blcli_storeenv USER_MODIFIED
                blcli_execute PropertySetInstanceBean getFullyResolvedPropertyValueAsString DATE_MODIFIED
         blcli_storeenv DATE_MODIFIED
      echo ""
      printf "****** ${DEPOT_OBJECT_KEYS}: ${ROLE_CREATED}: ${USER_CREATED}: ${NAME}: ${DATE_CREATED}: ${CustomProperty1}: ${CustomProperty2}: ${USER_MODIFIED}: ${DATE_MODIFIED} *****" >> output.txt
      echo ""
      done

       

      Note that the above is about version 5 of the script but every versions was esssentially the same with minor tweaks. And nothing works; I don't get any information back.

       

      I am providing the credentials and running the script as the BLAdmins RBAC Role against a SmartGroup (allObjects) of all the Depot Objects (SmartGroup condition is all Depot Objects with a name that does not equal "blank") that I created directly under the Depot "/root" folder. Even more than getting a script that works, I would like to know what I am doing wrng. There seems to be something fundamental that I am not understanding.

       

      One possible issue is that the total number of Depot Objects that I need to report on is about 10,000 but even when I run my scripts against a smaller subset, I still do not get anything in return.

       

      Thanks in advance!