Skip to main content

A Python project to easily manage Clouding servers from the command line.

Project description

Clouding Server Manager

Version Python License

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

  • 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:

  1. Make sure you have Poetry installed in your system.
  2. 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
    
  3. Clone the repository:
    git clone https://github.com/dmarts05/clouding-server-manager
    
  4. Navigate to the project directory:
    cd clouding-server-manager
    
  5. Install the project dependencies using Poetry:
    poetry install
    
    You might need pyenv to install the Python version specified in the pyproject.toml file. If that's the case, run pyenv install 3.9 before running the previous command. Also, check out the Poetry documentation about pyenv for more information.
  6. Activate the virtual environment:
    poetry shell
    
    This will activate the virtual environment so that you can run the script.
  7. 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.
  8. Run the script:
    python -m clouding_server_manager --help
    
    or
    poetry 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:

  1. Clone the repository:
    git clone https://github.com/dmarts05/clouding-server-manager
    
  2. Navigate to the project directory:
    cd clouding-server-manager
    
  3. Install the project dependencies using pip:
    pip install -r requirements.txt
    
    You might need pyenv to install the Python version specified in the requirements.txt file.
  4. 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.
  5. Run the script:
    python -m clouding_server_manager --help
    
    or
    poetry 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:

  1. Install the package using pip:
    pip install clouding-server-manager
    
  2. 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.
  3. 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:

  1. Install the development dependencies:
    poetry install --with dev
    
  2. Install pre-commit hooks:
    poetry run pre-commit install
    
  3. Format the code:
    poetry run black clouding_server_manager
    
  4. Lint the code:
    poetry run flake8 clouding_server_manager
    
  5. Run static type checking:
    poetry run mypy clouding_server_manager
    
  6. Generate the documentation:
    cd docs && poetry run make html
    
  7. 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

clouding_server_manager-1.0.5.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

clouding_server_manager-1.0.5-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

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

Hashes for clouding_server_manager-1.0.5.tar.gz
Algorithm Hash digest
SHA256 6f0d251ee622e6da36dda8491e14be5c5444abf4a9e249d593a416f9ec6efd09
MD5 5c3033664ae527818d970c38317c5cf9
BLAKE2b-256 63a687dbc611d1324e1b8fce984bca99b20944f32d55d2b648ce5d8d908d0c53

See more details on using hashes here.

File details

Details for the file clouding_server_manager-1.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for clouding_server_manager-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f8366312c354131b22048fbe4ee77545235ed0a51cc495ad6f024131b7a21eeb
MD5 dc5945d51a9f9d23fb89232e7e58e1d9
BLAKE2b-256 033bd2e20fa77e1e6c3987793ffc3bd241475b2fbb0f73e60b8b8a247d1d430d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page