Previous Topic: CLI Example: Create a Policy Store Object

Next Topic: Location of Sample Scripts

CLI Example: View and Set Individual Properties

Policy Management API objects (such as PolicyMgtRealm) provide a number of get/set methods that let you view and modify individual properties of objects in the policy store. You use these get/set methods to view and edit an object’s properties just as you would use the property fields in the Policy Server User Interface.

The following script modifies the resource filter property:

use Netegrity::PolicyMgtAPI;

$policyapi = Netegrity::PolicyMgtAPI‑>New();
$session = $policyapi‑>CreateSession("adminid", "adminpwd");
$domain=$session‑>GetDomain("engineering");

$realm=$domain‑>GetRealm("documentation");
if($realm‑>ResourceFilter() eq "/mysite/docs/*") {
      $filter=$realm‑>ResourceFilter("/mysite/docs/*.doc");
}
if ($filter eq undef) {
      print "Error changing resource filter.\n";
   }
   else {
      print "Resource filter changed to: " . $filter . "\n";
}

Note the following general rules: