The following example demonstrates how to delete multi-level reseller(s) and Power User(s) and their associations.
A PHP file called Delete_Multi_Level_Reseller_And_Power_User_And_Their_Associations.php can be found in <installdir>/apisamples. Read more in Accessing Example API Functions.
The PHP script searches and deletes objects in the system and prints the following result messages on the screen:
- "Successfully retrieved all the users" / "No user found with the specified ID" / "Failed to get the specified user"
- "Successfully retrieved all the agents" / "No Agents are owned by the specified user" / "Failed to get the specified agent"
- "Successfully retrieved all the volumes" / "No Volumes are exclusively assigned to the specified user" / "Failed to get all volumes"
- "Successfully retrieved all the diskSafes" / "No Disksafes are associated with the agents owned by the user" / "Failed to get all Disk Safes"
- "Successfully retrieved all the policies" / "No Policies are associated with the disksafe assigned to the agents owned by the user" / "Failed to get all the policies"
- "Failed to delete all policie(s)" / "All policie(s) deleted successfully"
- "Failed to delete all Disk Safe(s)" / "All Disk Safe(s) deleted successfully"
- "Failed to delete all Sub-User(s)" / "All Sub-User(s) deleted successfully"
- "Failed to delete all Agent(s)" / "All Agent(s) deleted successfully"
- "Failed to delete all Volume(s)" / "All Volume(s) deleted successfully"
- "Failed to delete Power user" / "Power user deleted successfully"
Sequence of Automated Actions
The following steps can be accomplished by using this script:
- Find a User with the specified ID. If a User with this ID does not exist, then exit or save the User ID.
- Find Sub-Users for the specified Power User, if there are any. Then save the found Sub-User IDs.
- Find Agents which have the specified User ID as their owner, and then save the found Agent IDs.
- Find Disk Safes which have the specified Agent ID, and then save the Disk Safe IDs.
- Find Policies associated with the found Disk Safes. Then save the found Policies' IDs.
- Delete found Policies.
- Delete found Disk Safes.
- Delete found Agents.
- Delete found Volumes.
- Delete found User.
- Delete found Sub-Users.
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. Also see the accompanying screen-shots illustrating the scripts for each step.
Defining server configuration variables
Retrieving a User
To find a User by username, follow the instructions below.
1. Click on "Users" in the Main Menu to access the Users page.
2. Click on "Basic List Filter" located in the Users sub-menu.
3. Enter a username, select the "Power-User" check-box, and click "Filter."
Note While the script searches by User ID, we search by username in the CDP interface. |
4. The found Users are displayed in the list.
5. Click on the User in the list, and then select the "Sub-Users" tab in the "Details" pane located in the bottom area of the interface.
Once the "Sub-Users" tab is selected, all Sub-Users will be listed there.
Retrieving Agents
Select the "Agents" tab in the "Details" pane in the bottom area of the interface to list all associated Agents.
Retrieving Volumes
In the bottom "Details" pane, select the "Volumes" tab to list the Volumes assigned to the selected User.
Retrieving Disk Safes
Click on the "Detail" icon in front of the Volume to drill down to the Disk Safes.
In the displayed window, select the "Disk Safes" tab to list the Disk Safes assigned to the selected Volume.
Retrieving Policies
Deleting the Policies, Disk Safes, and User
1. Click on the "Delete" (red X) icon under "Actions" for the corresponding User in the list.
Alternatively, select the check-box(es) in front of the Users and click on the "Delete Selected" button.
2. Familiarize yourself with the information displayed on the pop-up. Click "Delete."
3. Click "OK" in the success pop-up.
Deleting Agent
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 will disappear from the system.
Deleting Volumes
1. Click on the "Delete" (red X) icon under "Actions" for the corresponding Volume in the list.
2. Confirm your request to delete the Volume.
In a few moments, the volume record disappears from the "Volumes" list.