Tool for managing resources on a remove machine using openapi
Project description
Netport
Netport is a tool for managing single-access resources on the target Unix machine. Netport manages the access to different types of resources on the operating system by not allowing multiple requests to the same resource. For example ports, files, processes, network interfaces, and more...
How it works
Framework
Netport runs in a single python process on the target machine. It uses the FastAPI framework to make a high performance and easy to use REST api server. By using this api, users can easily perform a variety of requests to various resources.
There are many types of requests that can be made:
- Acquire a free port.
- Check if file exists
- Declare that a file is being used
- Start a process
- Get a list of already acquired resources
And many more...
Backend Storage
In order to maintain an active memory of the used resources, Netport communicates with a database. There are 2 types of supported databases that netport uses:
- Redis database
- Local pythonic database.
Both databases serve the same purpose for netport, but their inner functionality still a bit different, with one draw back for the local database. The local database doesn't save netport's state after a shutdown or a reboot.
The decision whether to use redis DB or a local one, depends by the user. In case of an unexpected shutdown, with redis the state of netport will be stored and on reboot it will continue from where it stopped. On the other hand, for much simpler systems this feature might be unnecessary complicated.
Installation
Make sure that python is installed on your machine (3.7 and above). Open your terminal and run the following command:
pip install netport
It is advised to use a dedicated python virtual environment for netport.
Developer Installation
Install poetry by following the instructions here.
Clone this repository:
git clone https://github.com/IgalKolihman/netport.git
Install the development environment:
poetry install --with dev
Usage
Please follow the installation procedure to be able to run Netport. After that netport will be available to you as long as you are using it's virtual environment.
To run netport with basic configurations, run:
netport
After executing this command, a link will appear in the terminal to the server's url. The API documentation will be available at: "http://host_ip:port/docs"
For more advanced information regarding netport execution, run the following command:
netport -h
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file netport-0.3.0.tar.gz
.
File metadata
- Download URL: netport-0.3.0.tar.gz
- Upload date:
- Size: 8.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aa3fba4b798a44d8c5358a44ddb594754af2220323ab67905a12a709ff378de |
|
MD5 | a26cdd6b27c881864511cd3a1a8022f1 |
|
BLAKE2b-256 | f55538d2376b883d01d421146d399bdae27aefb1f3b5e9c901bacfc0d3f39011 |
File details
Details for the file netport-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: netport-0.3.0-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.1 CPython/3.10.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82422205dccf533d835a4cbbc447d7488810d565f972d206d3e4fc74a21c1b54 |
|
MD5 | 1f8628169d2e80495725c3b334c23afe |
|
BLAKE2b-256 | 4c94af9fbf0e61a77047afcdc62d33d3280f64f46aae43c7f5598fbb4b2b85eb |