View Source

The following example demonstrates how to display the statuses of all Policies.

A PHP file called {{Get_Status_Of_All_Policies.php}} can be found here:
* for Windows: {{<installdir>\apisamples}}
* for Linux: {{<installdir>/apisamples}}

Read more in [Access example API functions].

The PHP script searches all Policies in the the system and prints result messages on the screen, providing the following information:
* Policy ID, name, description, state, or "Failed to find all status of all policies."

h4. Sequence of Automated Actions

The following steps can be accomplished by using this script:

# Find all Policies.&nbsp;
# Display their ID, name, description, or state.

h4. How to Fulfill Appropriate Actions in the Server Backup User Interface

Below, you can find the steps to perform these actions using the program user interface. Screen-shots are provided to illustrate the scripts for each step.

h5. Defining server configuration variables

{code}########====CDP Server Configuration Start====########
#set CDP server host name
#set CDP server to access API
#set CDP user
#set CDP user password
########====CDP Server Configuration End====########{code}

Log in to the Backup Manager user interface using your username and password.

!Enterprise_login form_English.png!

h5. Displaying Policies' States

$policyClient = new soapclient("https://$HOST:$PORT/Policy2?wsdl",
'cache_wsdl' => WSDL_CACHE_NONE,

$allPoliciesForUser = $policyClient->getPolicies();

foreach($allPoliciesForUser->return as $tmp)
echo "$tmp->id \n";
echo "$tmp->name \n";
echo "$tmp->description \n";
if ($tmp->state == "UNKNOWN"){
echo "Policy is in a UNKNOWN state \n";
else if ($tmp->state == "ERROR"){
echo "Policy has ERROR \n";
else if ($tmp->state == "ALERT"){
echo "Policy has ALERT(s) \n";
else {
echo "Policy State is OK \n";

echo "\n";


catch (SoapFault $exception)
echo "Failed to find all status of all policies";
echo $exception;



1. Click on "Policy" in the Main Menu to open the "Policies" window.

!Main menu_Policy_English.png!

2. Click on the "Show All" button located in the top right-hand corner of the interface to show the list of all Policies.


3. The Policy State is graphically displayed in the "State" column. The green icon indicates the Policies that run without errors; the yellow icon indicates the Policies that have warnings while processing; the red icon indicates the Policies that run with errors; the blue icon indicates the Policies with an unknown state. If nothing is shown in this column, then the State is OK.


If one or more Policy runs with errors, the "Error" icon is displayed in the upper area of the interface, proceeded by a table containing information on the Policies' statuses.

!Policies list_Some policies are not OK inscription_English.png!

Read more about this panel in [Access policies].