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.
- Features
- Examples
- Installation with Poetry (recommended)
- Installation with pip
- Installation as a PyPI package
- Development Setup
- Contributing
- License
- 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.
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
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:
You might need pyenv to install the Python version specified in the
poetry install
pyproject.tomlfile. If that's the case, runpyenv install 3.9before running the previous command. Also, check out the Poetry documentation about pyenv for more information. - Activate the virtual environment:
This will activate the virtual environment so that you can run the script.
poetry shell
- Enter your Clouding API key in the
.envfile. Check out.env.samplefor 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:
or
python -m clouding_server_manager --help
This will display the help message and show you how to use the script.poetry run clouding-sm --help
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:
You might need pyenv to install the Python version specified in the
pip install -r requirements.txt
requirements.txtfile. - Enter your Clouding API key in the
.envfile. Check out.env.samplefor 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:
or
python -m clouding_server_manager --help
This will display the help message and show you how to use the script.poetry run clouding-sm --help
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
exportor by adding them to your.bashrcor.zshrcfile: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.export CLOUDING_API_KEY="YOUR API KEY"
- Run the script:
This will display the help message and show you how to use the script.
clouding-sm --help
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.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.