The following example demonstrates how to use the API to delete a server and its associated policies and disk safes.
You can find the PHP file DeleteManaged_Agent_And_Its_Association.php at the following locations:
- for Windows: <installdir>\apisamples
- for Linux: <installdir>/apisamples
For more information about using the Server Backup Manager API, see Access example API functions.
The PHP script finds and deletes objects in the system, and then displays the following information:
- "Successfully retrieved all the Agents" / "No Agent out with the specified ID" / "Failed to get the specified Agent"
- "Successfully retrieved all the Disk Safes" / "Failed to get all Disk Safes"
- "Successfully retrieved all the Policies" / "Failed to get all the Policies"
- "Failed to delete all policie(s)" / "All policie(s) deleted successfully"
- "Failed to delete all DiskSafe(s)" / All DiskSafe(s) deleted successfully"
- "Failed to delete Agent" / "Agent deleted successfully"
Sequence of automated actions
This script allows you to:
- Find a Backup Agent containing the specified ID. If such Agent does not exist, then exit or save the Server ID.
- Find all disk safes associated with the specified Server ID. Save the found Disk Safe IDs.
- Find all policies associated with the found disk safes. Save the found Policy IDs.
- Delete found policies.
- Delete found disk safes.
- Delete found Backup Agent.
How to fulfill the appropriate actions in the Server Backup Manager user interface
The following steps help you to perform the same actions as the script, along with screen-shots illustrating every step in scripts.
First step
Retrieving the server and associated disk safes and policies
1. Click on "Servers" in the Main Menu to access the Servers page.
2. Then click "Basic List Filter" in the Servers menu located in the top left area of the interface.
3. Specify the Server name and click "Filter" to apply the search filter.
Note While the script searches by Server ID, we search by Server name in the Backup Manager interface. |
4. The found Server will be displayed in the list.
5. The Server's Disk Safes and Policies can be found via the Details pane once the Server is selected in the list.
Deleting Policies, Disk Safes, and the Server
1. Click on the "Delete" (red X) icon under "Actions" for the corresponding Server in the list.
Alternatively, select the check-box(es) in front of the Server(s) and click on the "Delete Selected" button.
2. Familiarize yourself with the information displayed on the pop-up. Check the "Delete disk safes from disk" option. Click "Delete".
3. The Server and its associated Disk Safes and Policies will disappear from the system.