FireAPI
Overview
FireAPI is a Python library that serves as a wrapper for the 24Fire REST API. It allows you to perform basic operations on a KVM server using a private API key. The library provides the following functionalities:
- Get server configuration
- Get server status
- Start server
- Stop server
- Restart server
- Delete backup (exclusive to
24fire+subscribers) - Create backup (exclusive to
24fire+subscribers) - List all backups (exclusive to
24fire+subscribers) - Retrieve monitoring timings (exclusive to
24fire+subscribers) - Retrieve monitoring incidences (exclusive to
24fire+subscribers) - Async Support
Table of Contents
Installation
To install FireAPI, use pip:
pip install fireapi
Alternatively, you can build and install the package manually:
git clone https://github.com/EvickaStudio/24-Fire-REST-API.git
cd 24-Fire-REST-API
python -m build
pip install ./
Usage
Synchronous Usage
To get started, import the FireAPI class from the fireapi package and instantiate it using your API key:
from fireapi import FireAPI
API_KEY = "your-api-key-here"
fire_api = FireAPI(API_KEY)
Once the instance is created, you can interact with the 24Fire REST API using the provided methods:
# Get server configuration
config = fire_api.get_config()
print(config)
# Get server status
status = fire_api.get_status()
print(status)
# Start server
start = fire_api.start_server()
print(start)
# Stop server
stop = fire_api.stop_server()
print(stop)
# Restart server
restart = fire_api.restart_server()
print(restart)
# Delete a backup
delete_backup = fire_api.backup_delete("backup_id")
# Create a backup
create_backup = fire_api.backup_create("Backup description")
# List all backups
backups = fire_api.backup_list()
# Retrieve monitoring timings
timings = fire_api.timings()
# Retrieve monitoring incidences
incidences = fire_api.incidences()
Asynchronous Usage
When using the async methods, you can use the await keyword to wait for the response:
import asyncio
from fireapi import AsyncFireAPI
async def main():
API_KEY = "your-api-key-here"
try:
fire_api = AsyncFireAPI(API_KEY)
# Get server configuration
config = await fire_api.get_config()
print(config)
# And the other methods that FireAPI provides
except Exception as e:
print(f"An error occurred: {e}")
if __name__ == "__main__":
asyncio.run(main())
Documentation
For more information on the 24Fire REST API, refer to the original documentation.
Contributing
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
License
This project is licensed under the AGPL v3 License.
Metadata
Release files for fireapi 0.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fireapi-0.4.3.tar.gz | 20.2 kB | Without provenance | Details for fireapi-0.4.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fireapi-0.4.3-py3-none-any.whl | Python 3 | none | any | Details for fireapi-0.4.3-py3-none-any.whl |
Total release size: 39.8 kB
Release files / fireapi-0.4.3.tar.gz
| Download URL | fireapi-0.4.3.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4bc579566d36d1bd449c32ff232169b51c3d60c8c5df2ac9571acc73e3f6d00e
|
|
BLAKE2b-256 checksum How to use checksums |
7328af54a02e3a61df0cdd09369da70aaae10cb6853c1f5647df7bea631d4765
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / fireapi-0.4.3-py3-none-any.whl
| Download URL | fireapi-0.4.3-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
293c5445aa454f54c34fc16f54151b217a6ecb9605f950ce42627a273118c890
|
|
BLAKE2b-256 checksum How to use checksums |
70589fc8c6757e3d03b330be3a56c2ba6c913571abd571e73e9ac22274be13db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for fireapi 0.4.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.