Use the getPolicyById API to retrieve a policy based on the entered ID.
########====CDP Server Configuration Start====########
#set CDP server host name
$HOST="10.230.131.25";
#set CDP server to access API
$PORT="9443";
#set CDP user
$USER="admin";
#set CDP user password
$PASS="admin";
########====CDP Server Configuration End====########
$POLICYID="5c6016f5-fb6e-4c84-bac8-9d0a446887b2";
#Retrieve a policy based on the entered ID.
try{
$client = new soapclient("https://$HOST:$PORT/Policy2?wsdl",
array(
'login'=>"$USER",
'password'=>"$PASS",
'trace'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE,
'classmap'=>array('Policy'=>'Policy')
)
);
$response = $client->getPolicyById(array('id'=>"$POLICYID"));
var_dump($response);
exit(0);
}
catch (SoapFault $exception)
{
echo $exception;
exit(1);
}
Labels:
None