Skip to main content

ITS Private Cloud Python Client pyvss

CI PyPI PyPI version Docker Image Pulls

Documentation

Package documentation is available at docs.

Requirements

  • Python 3.7.5 or higher (as specified by python_requires='>=3.7.5' in setup.py)

Installation

Install PyVSS using pip:

pip install pyvss

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

pip install pyvss[stor]

To upgrade to the latest version:

pip install --upgrade pyvss

Platform-Specific Notes

macOS / Linux: If pip is not available, install Python 3.7.5+ from python.org or your package manager, then install pip:

curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py --user

Windows: Download Python 3.7.5+ from Python Releases for Windows and ensure pip is included during installation.

Installing from Source

You can also install directly from the source tarball:

pip install https://gitlab-ee.eis.utoronto.ca/vss/py-vss/-/archive/master/py-vss-master.zip

Or clone and install locally:

git clone https://gitlab-ee.eis.utoronto.ca/vss/py-vss.git
cd py-vss
pip install .

Docker

For containerized usage, see the Docker documentation.

Quick start:

docker run -it -e VSS_API_TOKEN=your_token uofteis/pyvss

Usage

Create an instance of VssManager with your ITS Private Cloud API access token:

from pyvss.manager import VssManager

vss = VssManager(tk='your_api_token')

Basic Operations

# Get current user info
user = vss.whoami()

# List virtual machines
vms = vss.get_vms()

# List folders
folders = vss.get_folders()

# List networks
networks = vss.get_networks()

# List domains
domains = vss.get_domains()

Virtual Machine Management

# Get VM details
vm = vss.get_vm(uuid='5012abcb-a9f3-e112-c1ea-de2fa9dab90a')

# Power operations
vss.power_on_vm(uuid='<uuid>')
vss.power_off_vm(uuid='<uuid>')
vss.power_cycle_vm(uuid='<uuid>')
vss.reboot_guest_vm(uuid='<uuid>')
vss.shutdown_guest_vm(uuid='<uuid>')

# Create a single VM
request = 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(request['_links']['request'], 'vm_uuid', 'Processed')

# Create multiple VMs
requests = 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 requests]

# Power on multiple VMs
for uuid in uuids:
    vss.power_on_vm(uuid)

Snapshot Management

# Create a snapshot
request = vss.create_vm_snapshot(
    uuid='5012abcb-a9f3-e112-c1ea-de2fa9dab90a',
    desc='Snapshot description',
    date_time='2024-08-04 15:30',
    valid=1
)
snap_id = vss.wait_for_request(request['_links']['request'], 'snap_id', 'Processed')

# Revert to snapshot
request = vss.revert_vm_snapshot(uuid, snap_id)

# List snapshots
snapshots = vss.get_vm_snapshots(uuid='<uuid>')

# Delete a snapshot
vss.delete_vm_snapshot(uuid='<uuid>', snapshot=snap_id)

Request Tracking

from pyvss.enums import RequestStatus

# Get all requests
requests = vss.get_requests()

# Get request status
request = vss.get_request(request_id=123)

# Wait for a request to complete
result = vss.wait_for_request(
    request['_links']['request'],
    attribute='status',
    required_status='Processed'
)

Error Handling

from pyvss.manager import VssManager
from pyvss.exceptions import VssError

vss = VssManager(tk='your_api_token')

try:
    vm = vss.get_vm(uuid='invalid-uuid')
except VssError as e:
    print(f"API Error: {e}")

Authentication via Environment Variables

Instead of passing a token directly, you can set environment variables for authentication:

export VSS_API_USER='username'
export VSS_API_USER_PASS='password'

Then generate a token:

from pyvss.manager import VssManager

vss = VssManager()
vss.get_token()

Common Environment Variables

Variable Description
VSS_API_TOKEN API access token for authentication
VSS_API_USER Username for token generation
VSS_API_USER_PASS Password for token generation
VSS_API_USER_OTP One-time password for TOTP
VSS_API_TIMEOUT Request timeout in seconds (default: 60)
VSS_API_DEBUG Enable debug mode

Getting Help

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

Versioning

This project uses Calendar Versioning (e.g., 2025.2.1). Versions are 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.

Release files for pyvss 2026.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyvss 2026.4.0
File Size Uploaded
pyvss-2026.4.0.tar.gz 379.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyvss 2026.4.0
File Interpreter ABI Platform
pyvss-2026.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 434.5 kB

Release files / pyvss-2026.4.0.tar.gz

Download URL pyvss-2026.4.0.tar.gz
Size 379.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cf7dc63f6ef562820594e0358306ee24890cce19b2ff6c3382cb7db95097fdb7
BLAKE2b-256 checksum
How to use checksums
e91a5cd6edf959aefbc1f441289fd96b440ed618e1dd2a9a6d8b6e98e5bc73f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.4

Release files / pyvss-2026.4.0-py3-none-any.whl

Download URL pyvss-2026.4.0-py3-none-any.whl
Size 55.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ede460b3d97152e087e056b256d26fdd88debf000df07d7bee326eb68b30de35
BLAKE2b-256 checksum
How to use checksums
b98ddac9b0f51ee1759b1125da588dfcf79a7e1b634078de2b3aa4923cefb7be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.4

Release history Release notifications | RSS feed

This release

2026.4.0 This release

2 release files

0.17.1

2 release files

0.17.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.43

2 release files

0.9.42

2 release files

0.9.41

2 release files

0.9.39

2 release files

0.9.38

2 release files

0.9.36

2 release files

0.9.35

2 release files

0.9.34

2 release files

0.9.33

2 release files

0.9.32

2 release files

0.9.31

2 release files

0.9.29

2 release files

0.9.27

2 release files

0.9.25

2 release files

0.9.24

2 release files

0.9.23

2 release files

0.9.20

2 release files

0.9.19

2 release files

0.9.18

2 release files

0.9.16

1 release file

0.9.15

1 release file

0.9.14

1 release file

0.9.13

1 release file

0.9.12

1 release file

0.9.11

1 release file

0.9.10

1 release file

0.9.9

1 release file

0.9.8

1 release file

0.9.7.1

1 release file

0.9.7

1 release file

0.9.6

1 release file

0.9.5

1 release file

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9.0

1 release file

0.8.8

1 release file

0.8.7.1

1 release file

0.8.7

1 release file

0.8.6

1 release file

0.8.5

1 release file

0.8.4

1 release file

0.8.3

1 release file

0.8.2

1 release file

0.8.1

1 release file

0.8

1 release file

0.8.0

1 release file

0.7.1

1 release file

0.7

1 release file

0.6.1

1 release file

0.6

1 release file

0.5

1 release file

0.4

1 release file

0.3.3

1 release file

0.3.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page