The following example demonstrates how to delete an Agent and its associated Policies and Disk Safes.
A PHP file called DeleteManaged_Agent_And_Its_Association.php can be found in <installdir>/apisamples. Read more in Accessing Example API Functions.
The PHP script finds and deletes objects in the system and prints the following result messages on the screen:
- "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"
The following steps can be accomplished by using this script:
- Find an Agent with the specified ID. If such Agent does not exist, then exit or save the Agent ID.
- Find all Disk Safes associated with the specified Agent ID. Save the found Disk Safe IDs.
- Find all Policies associated with the found Disk Safes. Save the found Policies' IDs.
- Delete found Policies.
- Delete found Disk Safes.
- Delete found Agent.
Below, you can find the steps to take in the program user interface in order to perform the same actions as the script, along with screen-shots illustrating every step in scripts.
1. Click on "Agents" in the Main Menu to access the Agents page.
2. Then click "Basic List Filter" in the Agents menu located in the top left area of the interface.
3. Specify the Agent name and click "Filter" to apply the search filter.
While the script searches by Agent ID, we search by Agent name in the CDP interface.
4. The found Agent will be displayed in the list.
5. The Agent's Disk Safes and Policies can be found via the Details pane once the Agent is selected in the list.
1. Click on the "Delete" (red X) icon under "Actions" for the corresponding Agent in the list.
Alternatively, select the check-box(es) in front of the Agents 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 Agent and its associated Disk Safes and Policies will disappear from the system.