fireapi


Namefireapi JSON
Version 0.4.3 PyPI version JSON
download
home_pagehttps://github.com/EvickaStudio/24-Fire-REST-API
SummaryA simple API wrapper for the 24Fire REST API
upload_time2024-09-20 17:27:31
maintainerNone
docs_urlNone
authorEvickaStudio
requires_pythonNone
licenseAGPL-3.0
keywords api 24fire kvm server management
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # FireAPI

[![PyPI version](https://badge.fury.io/py/fireapi.svg)](https://badge.fury.io/py/fireapi)
[![Downloads](https://pepy.tech/badge/fireapi)](https://pepy.tech/project/fireapi)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/fireapi.svg)](https://pypi.org/project/fireapi/)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

## 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

> [!NOTE]
> Disclaimer: Unable to test `24fire+` exclusive features due to lack of subscription. If you encounter issues, please report them on GitHub.

## Table of Contents

* [Installation](#installation)
* [Usage](#usage)
  * [Synchronous Usage](#synchronous-usage)
  * [Asynchronous Usage](#asynchronous-usage)
* [Documentation](#documentation)
* [Contributing](#contributing)
* [License](#license)

## Installation

To install FireAPI, use pip:

```bash
pip install fireapi
```

Alternatively, you can build and install the package manually:

```bash
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:

```python
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:

```python
# 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:

```python
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](https://apidocs.24fire.de/).

## 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](https://github.com/EvickaStudio/24-Fire-REST-API).

## License

This project is licensed under the [AGPL v3 License](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/EvickaStudio/24-Fire-REST-API",
    "name": "fireapi",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "API, 24Fire, KVM, Server Management",
    "author": "EvickaStudio",
    "author_email": "hello@evicka.de",
    "download_url": "https://files.pythonhosted.org/packages/73/28/af54a02e3a61df0cdd09369da70aaae10cb6853c1f5647df7bea631d4765/fireapi-0.4.3.tar.gz",
    "platform": null,
    "description": "# FireAPI\r\n\r\n[![PyPI version](https://badge.fury.io/py/fireapi.svg)](https://badge.fury.io/py/fireapi)\r\n[![Downloads](https://pepy.tech/badge/fireapi)](https://pepy.tech/project/fireapi)\r\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/fireapi.svg)](https://pypi.org/project/fireapi/)\r\n[![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)\r\n[![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n\r\n## Overview\r\n\r\nFireAPI 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:\r\n\r\n* Get server configuration\r\n* Get server status\r\n* Start server\r\n* Stop server\r\n* Restart server\r\n* Delete backup (exclusive to `24fire+` subscribers)\r\n* Create backup (exclusive to `24fire+` subscribers)\r\n* List all backups (exclusive to `24fire+` subscribers)\r\n* Retrieve monitoring timings (exclusive to `24fire+` subscribers)\r\n* Retrieve monitoring incidences (exclusive to `24fire+` subscribers)\r\n* Async Support\r\n\r\n> [!NOTE]\r\n> Disclaimer: Unable to test `24fire+` exclusive features due to lack of subscription. If you encounter issues, please report them on GitHub.\r\n\r\n## Table of Contents\r\n\r\n* [Installation](#installation)\r\n* [Usage](#usage)\r\n  * [Synchronous Usage](#synchronous-usage)\r\n  * [Asynchronous Usage](#asynchronous-usage)\r\n* [Documentation](#documentation)\r\n* [Contributing](#contributing)\r\n* [License](#license)\r\n\r\n## Installation\r\n\r\nTo install FireAPI, use pip:\r\n\r\n```bash\r\npip install fireapi\r\n```\r\n\r\nAlternatively, you can build and install the package manually:\r\n\r\n```bash\r\ngit clone https://github.com/EvickaStudio/24-Fire-REST-API.git\r\ncd 24-Fire-REST-API\r\npython -m build\r\npip install ./\r\n```\r\n\r\n## Usage\r\n\r\n### Synchronous Usage\r\n\r\nTo get started, import the `FireAPI` class from the `fireapi` package and instantiate it using your API key:\r\n\r\n```python\r\nfrom fireapi import FireAPI\r\n\r\nAPI_KEY = \"your-api-key-here\"\r\nfire_api = FireAPI(API_KEY)\r\n```\r\n\r\nOnce the instance is created, you can interact with the 24Fire REST API using the provided methods:\r\n\r\n```python\r\n# Get server configuration\r\nconfig = fire_api.get_config()\r\nprint(config)\r\n\r\n# Get server status\r\nstatus = fire_api.get_status()\r\nprint(status)\r\n\r\n# Start server\r\nstart = fire_api.start_server()\r\nprint(start)\r\n\r\n# Stop server\r\nstop = fire_api.stop_server()\r\nprint(stop)\r\n\r\n# Restart server\r\nrestart = fire_api.restart_server()\r\nprint(restart)\r\n\r\n# Delete a backup\r\ndelete_backup = fire_api.backup_delete(\"backup_id\")\r\n\r\n# Create a backup\r\ncreate_backup = fire_api.backup_create(\"Backup description\")\r\n\r\n# List all backups\r\nbackups = fire_api.backup_list()\r\n\r\n# Retrieve monitoring timings\r\ntimings = fire_api.timings()\r\n\r\n# Retrieve monitoring incidences\r\nincidences = fire_api.incidences()\r\n```\r\n\r\n### Asynchronous Usage\r\n\r\nWhen using the `async` methods, you can use the `await` keyword to wait for the response:\r\n\r\n```python\r\nimport asyncio\r\nfrom fireapi import AsyncFireAPI\r\n\r\nasync def main():\r\n    API_KEY = \"your-api-key-here\"\r\n    try:\r\n        fire_api = AsyncFireAPI(API_KEY)\r\n        # Get server configuration\r\n        config = await fire_api.get_config()\r\n        print(config)\r\n        # And the other methods that FireAPI provides\r\n    except Exception as e:\r\n        print(f\"An error occurred: {e}\")\r\n\r\nif __name__ == \"__main__\":\r\n    asyncio.run(main())\r\n```\r\n\r\n## Documentation\r\n\r\nFor more information on the 24Fire REST API, refer to the [original documentation](https://apidocs.24fire.de/).\r\n\r\n## Contributing\r\n\r\nContributions 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](https://github.com/EvickaStudio/24-Fire-REST-API).\r\n\r\n## License\r\n\r\nThis project is licensed under the [AGPL v3 License](LICENSE).\r\n",
    "bugtrack_url": null,
    "license": "AGPL-3.0",
    "summary": "A simple API wrapper for the 24Fire REST API",
    "version": "0.4.3",
    "project_urls": {
        "Homepage": "https://github.com/EvickaStudio/24-Fire-REST-API"
    },
    "split_keywords": [
        "api",
        " 24fire",
        " kvm",
        " server management"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70589fc8c6757e3d03b330be3a56c2ba6c913571abd571e73e9ac22274be13db",
                "md5": "b0961b2c2512e9107454da9a90aad069",
                "sha256": "293c5445aa454f54c34fc16f54151b217a6ecb9605f950ce42627a273118c890"
            },
            "downloads": -1,
            "filename": "fireapi-0.4.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b0961b2c2512e9107454da9a90aad069",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 19555,
            "upload_time": "2024-09-20T17:27:29",
            "upload_time_iso_8601": "2024-09-20T17:27:29.221187Z",
            "url": "https://files.pythonhosted.org/packages/70/58/9fc8c6757e3d03b330be3a56c2ba6c913571abd571e73e9ac22274be13db/fireapi-0.4.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7328af54a02e3a61df0cdd09369da70aaae10cb6853c1f5647df7bea631d4765",
                "md5": "55d75fdbe4598082ad1c82417a17a242",
                "sha256": "4bc579566d36d1bd449c32ff232169b51c3d60c8c5df2ac9571acc73e3f6d00e"
            },
            "downloads": -1,
            "filename": "fireapi-0.4.3.tar.gz",
            "has_sig": false,
            "md5_digest": "55d75fdbe4598082ad1c82417a17a242",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 20229,
            "upload_time": "2024-09-20T17:27:31",
            "upload_time_iso_8601": "2024-09-20T17:27:31.036052Z",
            "url": "https://files.pythonhosted.org/packages/73/28/af54a02e3a61df0cdd09369da70aaae10cb6853c1f5647df7bea631d4765/fireapi-0.4.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-20 17:27:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "EvickaStudio",
    "github_project": "24-Fire-REST-API",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "fireapi"
}
        
Elapsed time: 0.34803s