View Source

The following example demonstrates how to display disk usage for all Volumes.

A PHP file called {{Disk_usage_for_all_volumes.php}} can be found in {{<installdir>/apisamples}}. Read more in [Accessing Example API Functions].

The PHP script finds all Volumes available to the User and prints the following result messages for each Volume on the screen:
* Volume ID
* Name
* Description
* Path
* Quota Type
* Soft Quota
* Hard Quota
* On Disk Size (in bytes)
* Size Of Deltas (in bytes)
* Total Delta Size (in bytes)

If the limits have been exceeded, you will receive the following messages:
* "Soft Quota has exceeded the limit"
* "Hard Quota has exceeded the limit"


h4. Sequence of Automated Actions

The following steps can be accomplished by using this script:

# Find all Volumes.
# Display information for each Volume

h4. How to Fulfill Appropriate Actions in CDP User Interface

Below, you can find the steps to take in the program user interface in order to perform the same actions as the script. We also provide you with screen-shots illustrating the scripts for every step.

----
{toc:location=top|maxLevel=5|minLevel=5|type=flat|separator=pipe|style=border:1}
----
h5. Defining server configuration variables
{code}
########====CDP Server Configuration Start====########
#set CDP server host name
$HOST="127.0.0.1";
#set CDP server to access API
$PORT="9443";
#set CDP user
$USER="admin";
#set CDP user password
$PASS="admin";
########====CDP Server Configuration End====########
{code}
Log in to the CDP Server user interface using your username and password.

!login.png!

h5. Displaying Volumes Information
{code}
########====Get Volumes Start====########

try{
$volumeClient = new soapclient("https://$HOST:$PORT/Volume?wsdl",
array('login'=>"$USER",
'password'=>"$PASS",
'cache_wsdl' => WSDL_CACHE_NONE,
'features' => SOAP_SINGLE_ELEMENT_ARRAYS,
'trace'=>1)
);

$allVolumeForUser=$volumeClient->getVolumes();

foreach($allVolumeForUser->return as $tmp){
echo "ID : $tmp->id \n";
echo "NAME : $tmp->name \n";
echo "DESCRIPTION : $tmp->description \n";
echo "PATH : $tmp->path \n";
echo "QUOTA TYPE : $tmp->quotaType \n";
echo "SOFT QUOTA LMIT : $tmp->softQuota \n";
echo "HARD QUOTA LMIT : $tmp->hardQuota \n";
echo "OnDiskSize : $tmp->onDiskSize bytes \n";
echo "SizeOFDeltas : $tmp->sizeOfDeltas bytes \n";
echo "TotalDeltaSize : $tmp->totalDeltaSize bytes \n";

if ($tmp->quotaType == "ON_DISK_SIZE"){
if ($tmp->softQuota < $tmp->onDiskSize){
echo "Soft Quota has exceeded the limit \n";
}
if ($tmp->hardQuota < $tmp->onDiskSize){
echo "Hard Quota has exceeded the limit \n";
}
}
else if ($tmp->quotaType == "SIZE_OF_DELTAS_IN_DISK_SAFE"){
if ($tmp->softQuota < $tmp->sizeOfDeltas){
echo "Soft Quota has exceeded the limit \n";
}
if ($tmp->hardQuota < $tmp->sizeOfDeltas){
echo "Hard Quota has exceeded the limit \n";
}
}
echo "\n";
}

exit(0);

}
catch (SoapFault $exception)
{
echo $exception;
exit(1);
}

########====Get Volumes End====########
{code}

1. Click on "Volumes" in the Main Menu to access the Volumes page.

!volumes-menu.png!

2. The Volumes list provides information about Volumes in grid format.

*Columns*:

* *Name* \- Name used to identify the Volume in the system. For example, to assign a Volume to the Disk Safe, you need to select a Volume name from the drop-down menu.
* *Description* \- Additional information describing the Volume. The Description is displayed in the Volumes list.
* *Volume Path* \- Absolute path to the directory where the Volume is located. Example: {{c:\main_volume}}, {{/volume1}}.
* *Quota Type* \- Quotas are set to limit the disk usage of the Volume. It can be "On Disk Size" or "Size of Deltas in Disk Safe." See a detailed description in Creating Volumes.
* *Soft Quota* \- Value in bytes, KB, MB, GB, or TB representing the&nbsp;threshold&nbsp;at which users are informed that they are close to reaching their effective data usage limit.
* *Hard Quota* \- Value in bytes, KB, MB, GB, or TB representing the maximum amount of resources allowed to be occupied by data.
* *On Disk Size* \- Value in bytes showing the amount of disk space occupied by the Volume.
* *Deltas* \- Value in bytes representing the amount of data that has changed since the last backup run.

!volumes-list.png!


The "Details" pane provides detailed information about the Volume selected in the list.