The following example demonstrates how to create a Volume, a Power User assigned to this Volume, and an Agent assigned to this User. In this case, Power Users are not allowed to create Sub-Users.
A PHP file called Volumes_With_Limits_Power_User_No_Sub_User_Allowed.php can be found in <installdir>/apisamples. Read more in Accessing Example API Functions.
The PHP script creates objects with the defined options in the system and prints the following result messages on the screen:
- "Successfully created volume" or "Failed to create volume"
- "Successfully created power user" or "Failed to create power user"
- "Successfully executed created Agent" or "Failed to create Agent"
The following steps can be accomplished by using this script:
- Create a Volume.
- Create a Power User with attributes. Assign the Volume to the newly created Power User.
- Create an Agent. Make the newly created Power User its owner.
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.
Log in to the CDP Server user interface using your username and password.
1. Click on "Volumes" in the Main Menu to access the Volumes page.
2. Then click "Create New Volume" in the Volumes menu located in the top left area of the interface.
3. Define the following Identification options:
- Name - Volume 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 - New or existing folder. The assigned Disk Safes will be placed in this folder.
4. Define the "Replication Limit" as "Hourly," and specify the "Soft Quota" and "Hard Quota." Set the "Allow File Excludes" option to "True," un-check the rest of the options, and click "Save."
5. Click "OK" in the "Warning" window to create a directory.
6. Click "OK" in the "Success" window to complete the process.
1. Click on "Users" in the Main Menu to access the Volumes page.
2. In the "Users" menu, click on "Create New User."
3. Define the new User properties in this window:
- Username - Enter User login name.
- Password - Enter a password for the User account.
- Confirm Password - Reenter the same password for the User account.
- Email Address - Enter email address of the User.
- User Type - Choose the type of User: Power-User.
Un-check the following option:
- User can create and administrate sub-users
Select the following check-box:
- User can create and administrate agents
- Restrict maximum agent count (Set to "2").
- Restrict maximum My-SQL add-on count (Set to "2").
4. Add the previously created Volume in the "Volumes" tab.
5. Click "Create."
6. Click "OK" in the "Success" window.
1. Click on "Agents" in the Main Menu to access the "Agents" page.
2. Then click "Create New Agent" in the Agents menu located in the top left area of the interface.
3. The "Create New Agent" window will appear. You will need to define the following options:
- Name - Enter a name for the Agent. It will be displayed in the "Agents" List. In this case, it is "agentDescription."
- Host Name - Enter the Host Name or IP address of the Agent. In this case, it is 127.0.0.1.
- Port Number - Define a Port to connect to the Agent, if different from the default value (1167).
To assign an Agent owner, choose the previously-created Power User's username from the drop-down list, and set permissions to "Full Control."
4. Click "Create."
5. Click "OK" in the "Success" window.