A Python project to easily manage Clouding servers from the command line.
Project description
Clouding Server Manager
Clouding Server Manager is a Python project that allows you to manage your Clouding servers from the command line. It is designed to list, archive, and unarchive servers in your Clouding account. It uses the Clouding API to perform the actions.
Table of Contents
- Features
- Examples
- Installation with Poetry (recommended)
- Installation with pip
- Installation as a PyPI package
- Development Setup
- Contributing
- License
Features
- Simple and easy to use command line interface.
- List all the information about your Clouding servers and filter their fields so that you can see only the information you want.
- Archive one or multiple servers at once.
- Unarchive one or multiple servers at once.
Examples
These are just a few examples of how to use the script. For more information, check out the help message by running python -m clouding_server_manager --help
.
- List all servers:
python -m clouding_server_manager list -t all
- List all servers and filter their fields:
python -m clouding_server_manager list -t all --f id -f name
- Archive a server:
python -m clouding_server_manager archive -t 123456
- Archive multiple servers:
python -m clouding_server_manager archive -t 123456 -t 789012
- Unarchive a server:
python -m clouding_server_manager unarchive -t 123456
- Unarchive multiple servers:
python -m clouding_server_manager unarchive -t 123456 -t 789012
Installation with Poetry (recommended)
To set up the project, follow these steps:
- Make sure you have Poetry installed in your system.
- It is highly recommended to set this Poetry configuration parameters to avoid multiple issues:
poetry config virtualenvs.in-project true poetry config virtualenvs.prefer-active-python true
- Clone the repository:
git clone https://github.com/dmarts05/clouding-server-manager
- Navigate to the project directory:
cd clouding-server-manager
- Install the project dependencies using Poetry:
poetry install
You might need pyenv to install the Python version specified in thepyproject.toml
file. If that's the case, runpyenv install 3.9
before running the previous command. Also, check out the Poetry documentation about pyenv for more information. - Activate the virtual environment:
poetry shell
This will activate the virtual environment so that you can run the script. - Enter your Clouding API key in the
.env
file. Check out.env.sample
for an example. You can find your Clouding API key in the API section of your Clouding account (as of now you need access to the beta version of the Clouding API). As an alternative, you can use --api-key or -k to specify your API key when running the script. - Run the script:
python -m clouding_server_manager --help
orpoetry run clouding-sm --help
This will display the help message and show you how to use the script.
Installation with pip
This is an alternative installation method that uses pip instead of Poetry. It might not work as expected, so it is recommended to use the Poetry installation method instead. To set up the project, follow these steps:
- Clone the repository:
git clone https://github.com/dmarts05/clouding-server-manager
- Navigate to the project directory:
cd clouding-server-manager
- Install the project dependencies using pip:
pip install -r requirements.txt
You might need pyenv to install the Python version specified in therequirements.txt
file. - Enter your Clouding API key in the
.env
file. Check out.env.sample
for an example. You can find your Clouding API key in the API section of your Clouding account (as of now you need access to the beta version of the Clouding API). As an alternative, you can use --api-key or -k to specify your API key when running the script. - Run the script:
python -m clouding_server_manager --help
orpoetry run clouding-sm --help
This will display the help message and show you how to use the script.
Installation as a PyPI package
This is an alternative installation method that uses pip to install the package from PyPI. It might not work as expected, so it is recommended to use the Poetry installation method instead. To set up the project, follow these steps:
- Install the package using pip:
pip install clouding-server-manager
- Configure the environment variable with
export
or by adding them to your.bashrc
or.zshrc
file:export CLOUDING_API_KEY="YOUR API KEY"
You can find your Clouding API key in the API section of your Clouding account (as of now you need access to the beta version of the Clouding API). As an alternative, you can use --api-key or -k to specify your API key when running the script. - Run the script:
clouding-sm --help
This will display the help message and show you how to use the script.
Development Setup
If you want to contribute to the project or run the development environment, follow these additional steps:
- Install the development dependencies:
poetry install --with dev
- Install pre-commit hooks:
poetry run pre-commit install
- Format the code:
poetry run black clouding_server_manager
- Lint the code:
poetry run flake8 clouding_server_manager
- Run static type checking:
poetry run mypy clouding_server_manager
- Generate the documentation:
cd docs && poetry run make html
- Do everything at once (except for generating the documentation):
poetry run pre-commit run --all-files
That's it! You now have the project set up and ready for development or execution.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License. See the LICENSE file for details.
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 clouding_server_manager-1.0.5.tar.gz
.
File metadata
- Download URL: clouding_server_manager-1.0.5.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.2 Linux/6.1.0-9-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f0d251ee622e6da36dda8491e14be5c5444abf4a9e249d593a416f9ec6efd09 |
|
MD5 | 5c3033664ae527818d970c38317c5cf9 |
|
BLAKE2b-256 | 63a687dbc611d1324e1b8fce984bca99b20944f32d55d2b648ce5d8d908d0c53 |
File details
Details for the file clouding_server_manager-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: clouding_server_manager-1.0.5-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.5.1 CPython/3.11.2 Linux/6.1.0-9-amd64
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f8366312c354131b22048fbe4ee77545235ed0a51cc495ad6f024131b7a21eeb |
|
MD5 | dc5945d51a9f9d23fb89232e7e58e1d9 |
|
BLAKE2b-256 | 033bd2e20fa77e1e6c3987793ffc3bd241475b2fbb0f73e60b8b8a247d1d430d |