Skip to main content

ITS Private Cloud Python Client

Project description

ITS Private Cloud Python Client pyvss

CI PyPI PyPI version Docker Image Pulls

Documentation

Package documentation is now available at docs.

Installation

The fastest way to install PyVSS is to use pip:

pip install pyvss

To interact with vskey-stor, install pyvss with extras:

pip install pyvss[stor]

If you have PyVSS installed and want to upgrade to the latest version you can run:

pip install --upgrade pyvss

This will install PyVSS as well as all dependencies.

You can also just download the tarball. Once you have the py-vss directory structure on your workstation, you can just run:

cd <path_to_py-vss>
pip install .

macOS

You can use pip directly to install PyVSS. Run pip --version to see if your version of macOS already includes Python and pip.

pip --version

If you don't have pip installed, first download and install Python 3.7 for Mac from the downloads page of Python.org. Download and run the pip installation script provided by the Python Packaging Authority.

   curl -O https://bootstrap.pypa.io/get-pip.py
   python3 get-pip.py --user
  1. Use pip to install PyVSS.
pip install pyvss --upgrade --user
  1. Verify that the PyVSS is installed correctly.
pip freeze | grep pyvss

Linux

You can use pip directly to install PyVSS. Run pip --version to see if your version of Linux already includes Python and pip.

   pip --version

If you don't have pip installed, first download and install Python 3.5 for Linux from the downloads page of Python.org or using your preferred package manager. Download and run the pip installation script provided by the Python Packaging Authority.

   curl -O https://bootstrap.pypa.io/get-pip.py
   python3 get-pip.py --user
  1. Use pip to install PyVSS.
pip install pyvss --upgrade --user
  1. Verify that the PyVSS is installed correctly.
pip freeze | grep pyvss

Windows

  1. Open the Command Prompt from the Start menu.

  2. Use the following commands to verify that Python and pip are both installed correctly.

C:\Windows\System32> python --version
Python 3.7.1
C:\Windows\System32> pip --version
pip 18.1 from c:\program files\python37\lib\site-packages\pip (python 3.7)
  1. Install PyVSS CLI using pip.
C:\Windows\System32> pip install pyvss
  1. Verify that PyVSS is installed correctly.
C:\Windows\System32> pip freeze | findstr pyvss

Docker

For more information refer to the Docker section.

Use

Create an instance of VssManager passing your ITS Private Cloud API access token and your are all set to start calling any of the self-descriptive methods included:

from pyvss.manager import VssManager
vss = VssManager(tk='api_token')
# list vms
vms = vss.get_vms()
# list folders
folders = vss.get_folders()
# networks
networks = vss.get_networks()
# domains
domains = vss.get_domains()
# power cycle vm
vss.power_cycle_vm(uuid='<uuid>')  
# create vm
req = vss.create_vm(os='ubuntu64Guest', built='os_install',
                    description='Testing python wrapper',
                    folder='group-v6736', bill_dept='EIS', disks=[100, 100])
uuid = vss.wait_for_request(req['_links']['request'], 'vm_uuid', 'Processed')
# creating multiple vms
reqs = vss.create_vms(count=3, name='python', os='ubuntu64Guest', bill_dept='EIS',
        description='Testing multiple deployment from python wrapper',
        folder='group-v6736', built='os_install')
uuids = [vss.wait_for_request(r['_links']['request'], 'vm_uuid', 'Processed') for r in reqs]
# power on recently created vms
for uuid in uuids:
   vss.power_on_vm(uuid)    
# create snapshot
req = vss.create_vm_snapshot(uuid='5012abcb-a9f3-e112-c1ea-de2fa9dab90a',
                             desc='Snapshot description',
                             date_time='2016-08-04 15:30',
                             valid=1)
snap_id = vss.wait_for_request(req['_links']['request'], 'snap_id', 'Processed')
# revert to snapshot
req = vss.revert_vm_snapshot(uuid, snap_id)

An alternative is to generate a token from within the VssManager class and this can be done by setting the following environment variables

export VSS_API_USER='username'
export VSS_API_USER_PASS='username_password'

Then, from the VssManager call the get_token method as follows:

from pyvss.manager import VssManager
vss = VssManager()
vss.get_token()

Getting Help

We use GitLab issues for tracking bugs, enhancements and feature requests. If it turns out that you may have found a bug, please open a new issue.

Versioning

The client versions has been recently moved to Calendar Versioning. Versions available in the tags section or PyPI.

Contributing

Refer to the Contributing Guide for details on our code of conduct and the process of submitting code to the repository.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvss-2023.2.0.tar.gz (47.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvss-2023.2.0-py2.py3-none-any.whl (44.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pyvss-2023.2.0.tar.gz.

File metadata

  • Download URL: pyvss-2023.2.0.tar.gz
  • Upload date:
  • Size: 47.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for pyvss-2023.2.0.tar.gz
Algorithm Hash digest
SHA256 fd985404c3271d89c3a16601c9822374e86a8f7f99f602dba29d4f7749130d15
MD5 3ccd0992c4e5edb884eaccdebb28bb35
BLAKE2b-256 dd2575398bdfd7cade5c9fe895ee674f8ce4ab07f7063708d08891cabd2ce228

See more details on using hashes here.

File details

Details for the file pyvss-2023.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pyvss-2023.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 44.7 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for pyvss-2023.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b9cda0e8740b628292cbc3b354ce3f639b54e65c14e82f4ae872b436c67f6497
MD5 7f888447d4273ac2f5a7f1fbfea4f506
BLAKE2b-256 abef0d54400a1ef65d52201c5338e0f6868797574b9a3f29b91b7e9b92a31e16

See more details on using hashes here.

Supported by

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