1 Reply Latest reply on Jul 12, 2012 7:38 AM by Bill Robinson

    List out ACL Policy's Name

    Siddu angadi

      Hi,

       

      Is there are any blcli commands to list out  ACL Policy's Name which are applied to JOB?

       

      For example:  I have applied the 2 ACL Policy ( IST_PKG and IST_DPLY).

       

      I need blcli commands to fetch these names alone.

       

      Thanks

      Siddu

        • 1. List out ACL Policy's Name
          Bill Robinson

          I did this w/ servers  you should be able to change the below to handle jobs pretty easily.

           

          #!/bin/nsh

          blcli_setoption serviceProfileName defaultProfile
          blcli_setoption roleName BLAdmins
          blcli_connect

          blcli_execute Server listAllServers  > out.1 2> out.2
          blcli_storeenv serverList  > out.1 2> out.2

          for server in ${serverList}
          do
          echo "Processing server: ${server}..."
          blcli_execute Server findByName ${server} > out.1 2> out.2
          blcli_execute Server getBlAcl > out.1 2> out.2
          blcli_execute Utility setTargetObject  > out.1 2> out.2
          blcli_execute Utility storeTargetObject blAcl  > out.1 2> out.2
          blcli_execute BlAcl aclToString NAMED_OBJECT=blAcl  > out.1 2> out.2
          blcli_storeenv serverAcl > out.1

          echo "Processing ACLs..."
          while read line
            do
            printf '%s\n' "${line}" >> $$.acl
          done <<< ${serverAcl}

          if [ `grep -n -e "Policy Name" -e "End of Policy" $$.acl | wc -l` -eq 0 ]
            then
            echo "${server},NOPOLICY" >> $$.aclp.csv
          else
            grep "Policy Name" $$.acl | cut -f1 -d: | while read aclp
             do
             echo "${server},${aclp}" >> $$.aclp.csv
            done
          fi

          rm -f $$.acl

          done

          rm -f out.1
          rm -f out.2

          1 of 1 people found this helpful