Name | directadmin-cli JSON |
Version |
0.1.5
JSON |
| download |
home_page | None |
Summary | DirectAdmin Python CommandLine tools |
upload_time | 2024-08-04 13:56:32 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | MIT License |
keywords |
da
directadmin
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# DirectAdminAPIClient
The `directadmin-cli` package provides a convenient interface for interacting with the DirectAdmin API. `BaseDirectAdminAPIClient` extends the `BaseDirectAdminAPIClient` class to offer specific methods for managing and retrieving information about resellers, admins, users, and various account types.
## Installation
To use this client, you'll need to have Python installed along with the `requests` library. You can install the required library using pip:
```bash
pip install directadmin-cli
```
## Usage
### Initialization
```python
from directadmin.client import DirectAdminAPIClient
client = DirectAdminAPIClient(
server="https://your-directadmin-server.com",
username="your-username",
password="your-password",
ssl=True,
user_agent="YourCustomUserAgent/1.0"
)
```
### Properties
- get_all_resellers: Retrieves a list of all resellers.
- get_all_admins: Retrieves a list of all admins.
- get_all_users: Retrieves a list of all users.
- get_all_reseller_packages: Retrieves a list of all reseller packages.
- get_all_user_packages: Retrieves a list of all user packages.
- get_reseller_ip_list: Retrieves a list of IP addresses associated with resellers.
- get_admin_stats: Retrieves statistics for the admin.
### Methods
- get_reseller_package(package_name: str) -> Dict[str, Any]: Retrieves information about a specific reseller package by name.
- get_user_package(package_name: str) -> Dict[str, Any]: Retrieves information about a specific user package by name.
- get_user_config(username: str) -> Dict[str, Any]: Retrieves configuration details for a specific user.
- get_user_usage(username: str) -> Dict[str, Any]: Retrieves usage statistics for a specific user.
- get_user_domain(username: str) -> Dict[str, Any]: Retrieves domain information for a specific user.
- create_admin_account(username: str, email: str, passwd: str, notify: str) -> Dict[str, Any]: Creates a new admin account with the specified details.
- create_reseller_account(username: str, email: str, passwd: str, notify: str, ip: str, package: str, domain: str) -> Dict[str, Any]: Creates a new reseller account with the specified details. The ip parameter must be one of "shared", "sharedreseller", or "assign".
- create_user_account(username: str, email: str, passwd: str, notify: str, ip: str, package: str, domain: str) -> Dict[str, Any]: Creates a new user account with the specified details.
## Example
```python
from directadmin.client import DirectAdminAPIClient
# Initialize the client
client = DirectAdminAPIClient(
server="https://your-directadmin-server.com",
username="your-username",
password="your-password"
)
# Retrieve all users
users = client.get_all_users
print("Users:", users)
# Create a new user account
response = client.create_user_account(
username="newuser",
email="newuser@example.com",
passwd="securepassword",
notify="no",
ip="shared",
package="default",
domain="newuserdomain.com"
)
print("Create User Response:", response)
```
## License
This project is licensed under the Apache License. See the LICENSE file for details.
## Contributing
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
C## ontact
For any questions or support, please contact miladkhoshdel@gmail.com.
Raw data
{
"_id": null,
"home_page": null,
"name": "directadmin-cli",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "Milad Khoshdel <miladkhoshdel@gmail.com>",
"keywords": "da, directadmin",
"author": null,
"author_email": "Milad Khoshdel <miladkhoshdel@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/0f/39/01d1d84b1368053d20af44b3da09314b48facbd22f7f79a6e68786b411d0/directadmin_cli-0.1.5.tar.gz",
"platform": null,
"description": "# DirectAdminAPIClient\n\nThe `directadmin-cli` package provides a convenient interface for interacting with the DirectAdmin API. `BaseDirectAdminAPIClient` extends the `BaseDirectAdminAPIClient` class to offer specific methods for managing and retrieving information about resellers, admins, users, and various account types.\n\n## Installation\n\nTo use this client, you'll need to have Python installed along with the `requests` library. You can install the required library using pip:\n\n```bash\npip install directadmin-cli\n```\n\n## Usage\n\n### Initialization\n\n```python\nfrom directadmin.client import DirectAdminAPIClient\n\n\nclient = DirectAdminAPIClient(\n server=\"https://your-directadmin-server.com\",\n username=\"your-username\",\n password=\"your-password\",\n ssl=True,\n user_agent=\"YourCustomUserAgent/1.0\"\n)\n```\n\n### Properties\n\n- get_all_resellers: Retrieves a list of all resellers.\n- get_all_admins: Retrieves a list of all admins.\n- get_all_users: Retrieves a list of all users.\n- get_all_reseller_packages: Retrieves a list of all reseller packages.\n- get_all_user_packages: Retrieves a list of all user packages.\n- get_reseller_ip_list: Retrieves a list of IP addresses associated with resellers.\n- get_admin_stats: Retrieves statistics for the admin.\n\n### Methods\n\n- get_reseller_package(package_name: str) -> Dict[str, Any]: Retrieves information about a specific reseller package by name.\n- get_user_package(package_name: str) -> Dict[str, Any]: Retrieves information about a specific user package by name.\n- get_user_config(username: str) -> Dict[str, Any]: Retrieves configuration details for a specific user.\n- get_user_usage(username: str) -> Dict[str, Any]: Retrieves usage statistics for a specific user.\n- get_user_domain(username: str) -> Dict[str, Any]: Retrieves domain information for a specific user.\n- create_admin_account(username: str, email: str, passwd: str, notify: str) -> Dict[str, Any]: Creates a new admin account with the specified details.\n- create_reseller_account(username: str, email: str, passwd: str, notify: str, ip: str, package: str, domain: str) -> Dict[str, Any]: Creates a new reseller account with the specified details. The ip parameter must be one of \"shared\", \"sharedreseller\", or \"assign\".\n- create_user_account(username: str, email: str, passwd: str, notify: str, ip: str, package: str, domain: str) -> Dict[str, Any]: Creates a new user account with the specified details.\n\n## Example\n\n```python\nfrom directadmin.client import DirectAdminAPIClient\n\n# Initialize the client\nclient = DirectAdminAPIClient(\n server=\"https://your-directadmin-server.com\",\n username=\"your-username\",\n password=\"your-password\"\n)\n\n# Retrieve all users\nusers = client.get_all_users\nprint(\"Users:\", users)\n\n# Create a new user account\nresponse = client.create_user_account(\n username=\"newuser\",\n email=\"newuser@example.com\",\n passwd=\"securepassword\",\n notify=\"no\",\n ip=\"shared\",\n package=\"default\",\n domain=\"newuserdomain.com\"\n)\nprint(\"Create User Response:\", response)\n```\n\n## License\nThis project is licensed under the Apache License. See the LICENSE file for details.\n\n## Contributing\nContributions are welcome! Please fork the repository and submit a pull request with your changes.\n\nC## ontact\nFor any questions or support, please contact miladkhoshdel@gmail.com.",
"bugtrack_url": null,
"license": "MIT License",
"summary": "DirectAdmin Python CommandLine tools",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://github.com/Miladkhoshdel/directadmin-cli",
"Issues": "https://github.com/Miladkhoshdel/directadmin-cli/issues"
},
"split_keywords": [
"da",
" directadmin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a4b5216955b90d6297c6af233051028516f0a4e7e63e18a751ecda06ce95783b",
"md5": "57166a06448392494f34daae140d6909",
"sha256": "e28792d69d6c14150fb688228d8d51755282a63f1a32c7d4c561ccd6d86e11a2"
},
"downloads": -1,
"filename": "directadmin_cli-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "57166a06448392494f34daae140d6909",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 10315,
"upload_time": "2024-08-04T13:56:30",
"upload_time_iso_8601": "2024-08-04T13:56:30.253983Z",
"url": "https://files.pythonhosted.org/packages/a4/b5/216955b90d6297c6af233051028516f0a4e7e63e18a751ecda06ce95783b/directadmin_cli-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0f3901d1d84b1368053d20af44b3da09314b48facbd22f7f79a6e68786b411d0",
"md5": "880614956dc324a07667571e69b81a21",
"sha256": "8e9f77280320ce3c965189efd916cbfa55b77628d875e335a18adac0ae94df9c"
},
"downloads": -1,
"filename": "directadmin_cli-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "880614956dc324a07667571e69b81a21",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 8931,
"upload_time": "2024-08-04T13:56:32",
"upload_time_iso_8601": "2024-08-04T13:56:32.284978Z",
"url": "https://files.pythonhosted.org/packages/0f/39/01d1d84b1368053d20af44b3da09314b48facbd22f7f79a6e68786b411d0/directadmin_cli-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-04 13:56:32",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Miladkhoshdel",
"github_project": "directadmin-cli",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "directadmin-cli"
}