SDK for Blesta
Project description
Blesta Python SDK
The Blesta Python SDK provides an easy-to-use API and CLI interface for interacting with Blesta's REST API.
🚀 Quick and Easy Setup
-
Create a Project Folder:
mkdir my_project && cd my_project
-
Set Up a Python Virtual Environment:
python3 -m venv venv source venv/bin/activate # On Windows, use venv\Scripts\activate
-
Install Blesta SDK:
pip install blesta_cli
-
Configure API Credentials:
Admins can generate API credentials in Blesta's staff area. Save these values in a
.envfile located in your project's root folder. The.envfile should look like this:BLESTA_API_URL=https://your-blesta-domain.com/api BLESTA_API_USER=your_api_user BLESTA_API_KEY=your_api_key
That's it. Let's roll!
📖 Usage Examples
General Command Structure
blesta-cli --model <model_name> --method <method_name> [--action GET] [--params key=value key2=value2] [--last-request]
--model: The API model to interact with (e.g.,clients,services).--method: The method to call on the specified model (e.g.,getList,get,getCustomFields).--action: The HTTP action to perform (default isGET).--params: Optional parameters to pass to the method (e.g.,key=valuepairs).--last-request: Repeats the last request made.
Clients Model (API Documentation)
-
List all active clients:
blesta-cli --model clients --method getList --params status=active --last-request
-
Get details of a specific client:
blesta-cli --model clients --method get --params client_id=1 --last-request
Services Model (API Documentation)
-
List all active services:
blesta-cli --model services --method getList --params status=active --last-request
-
Count the active services for a client:
blesta-cli --model services --method getListCount --params client_id=1 status=active
-
List all services for a client:
blesta-cli --model services --method getAllByClient --params client_id=1 status=active --last-request
🤝 Contribution
We welcome contributions! Whether it's a feature request, bug report, or pull request, we appreciate your input.
How to Contribute
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature-name
- Commit your changes:
git commit -m "Add your feature description here"
- Push to your branch:
git push origin feature/your-feature-name
- Open a pull request.
This project is licensed under the MIT License
Happy coding! 🎉
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blesta_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: blesta_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3164a76aef80de3e84f6de3e5ebbde0e72d315da0b6aebef634829691991a3e2
|
|
| MD5 |
996d0f233ac45a5f151145c5e626db86
|
|
| BLAKE2b-256 |
525f1ccc406fae920c3c68f0a569e04fe287b5255ec94de03dbf54c4c711762a
|