# ITS Private Cloud Python Client ``pyvss``
[![CI][build-img]](https://gitlab-ee.eis.utoronto.ca/vss/py-vss/commits/master)
[![PyPI][pypi-img]](https://pypi.python.org/pypi/pyvss)
[![PyPI version][pyver-img]](https://pypi.python.org/pypi/pyvss)
[![Docker Image Pulls][docker-pulls-img]][docker-image]
## Documentation
Package documentation is now available at [docs][docs].
## Installation
The fastest way to install PyVSS is to use [pip][pip]:
```bash
pip install pyvss
```
To interact with `vskey-stor`, install pyvss with extras:
```bash
pip install pyvss[stor]
```
If you have PyVSS installed and want to upgrade to the latest version you can run:
```bash
pip install --upgrade pyvss
```
This will install PyVSS as well as all dependencies.
You can also just [download the tarball][download the tarball]. Once you have the `py-vss` directory structure on your workstation, you can just run:
```bash
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`.
```bash
pip --version
```
> If you don't have `pip` installed, first download and install
[Python 3.7 for Mac][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.
```bash
pip install pyvss --upgrade --user
```
2. Verify that the PyVSS is installed correctly.
```bash
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`.
```bash
pip --version
```
> If you don't have `pip` installed, first download and install
[Python 3.5 for Linux][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.
```bash
pip install pyvss --upgrade --user
```
2. Verify that the PyVSS is installed correctly.
```bash
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.
```batch
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)
```
3. Install PyVSS CLI using pip.
```batch
C:\Windows\System32> pip install pyvss
```
4. Verify that PyVSS is installed correctly.
```batch
C:\Windows\System32> pip freeze | findstr pyvss
```
## Docker
For more information refer to the [Docker](docker/README.md) 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:
```python
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
```bash
export VSS_API_USER='username'
export VSS_API_USER_PASS='username_password'
```
Then, from the ``VssManager`` call the ``get_token`` method as follows:
```python
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][open a new issue].
## Versioning
The client versions has been recently moved to [Calendar Versioning](https://calver.org/).
Versions available in the [tags section](https://gitlab-ee.eis.utoronto.ca/vss/py-vss/tags) or
[PyPI](https://pypi.org/project/pyvss/#history).
## Contributing
Refer to the [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process of
submitting code to the repository.
[docs]: https://eis.utoronto.ca/~vss/pyvss/
[download the tarball]: https://pypi.python.org/pypi/pyvss
[Click]: http://click.pocoo.org/6/
[Python Releases for Windows]: https://www.python.org/downloads/windows/
[pip]: http://www.pip-installer.org/en/latest/
[open a new issue]: https://gitlab-ee.eis.utoronto.ca/vss/py-vss/issues/new>
[Alpine Linux]: https://hub.docker.com/_/alpine/
[PyVSS]: https://pypi.python.org/pypi/pyvss
[build-img]: https://gitlab-ee.eis.utoronto.ca/vss/py-vss/badges/master/pipeline.svg
[coverage-img]: https://gitlab-ee.eis.utoronto.ca/vss/py-vss/badges/master/coverage.svg
[pypi-img]: https://img.shields.io/pypi/v/pyvss.svg
[pyver-img]: https://img.shields.io/pypi/pyversions/pyvss.svg
[docker-pulls-img]: https://img.shields.io/docker/pulls/uofteis/pyvss.svg
[docker-image]: https://hub.docker.com/r/uofteis/pyvss/
[Python 3.7 for Mac]: https://www.python.org/downloads/mac-osx/
[Python 3.5 for Linux]: https://www.python.org/downloads/source/
Raw data
{
"_id": null,
"home_page": "https://gitlab-ee.eis.utoronto.ca/vss/py-vss",
"name": "pyvss",
"maintainer": "",
"docs_url": "https://pythonhosted.org/pyvss/",
"requires_python": ">=3.7.5",
"maintainer_email": "vss-py@eis.utoronto.ca",
"keywords": "",
"author": "University of Toronto",
"author_email": "vss-apps@eis.utoronto.ca",
"download_url": "https://files.pythonhosted.org/packages/4b/c1/61c4b9f7d9a224b5313f9435c743c56fd300733e05d63bbfb7b2c25af937/pyvss-2023.12.0.tar.gz",
"platform": "any",
"description": "# ITS Private Cloud Python Client ``pyvss``\n\n[![CI][build-img]](https://gitlab-ee.eis.utoronto.ca/vss/py-vss/commits/master)\n[![PyPI][pypi-img]](https://pypi.python.org/pypi/pyvss)\n[![PyPI version][pyver-img]](https://pypi.python.org/pypi/pyvss)\n[![Docker Image Pulls][docker-pulls-img]][docker-image]\n \n## Documentation\n\nPackage documentation is now available at [docs][docs].\n\n## Installation\n\nThe fastest way to install PyVSS is to use [pip][pip]:\n\n```bash\npip install pyvss\n```\n\nTo interact with `vskey-stor`, install pyvss with extras:\n\n```bash\npip install pyvss[stor]\n```\n\nIf you have PyVSS installed and want to upgrade to the latest version you can run:\n\n```bash\npip install --upgrade pyvss\n```\n\nThis will install PyVSS as well as all dependencies. \n\nYou can also just [download the tarball][download the tarball]. Once you have the `py-vss` directory structure on your workstation, you can just run:\n\n```bash\ncd <path_to_py-vss>\npip install .\n```\n\n### macOS\n\nYou can use `pip` directly to install PyVSS. Run `pip --version` to see if your version of\nmacOS already includes Python and `pip`.\n\n```bash\npip --version\n```\n\n> If you don't have `pip` installed, first download and install \n [Python 3.7 for Mac][Python 3.7 for Mac] from the downloads page of Python.org. \n Download and run the `pip` installation script provided by the Python Packaging Authority.\n\n curl -O https://bootstrap.pypa.io/get-pip.py\n python3 get-pip.py --user\n\n\n1. Use `pip` to install PyVSS.\n\n```bash\npip install pyvss --upgrade --user\n```\n\n2. Verify that the PyVSS is installed correctly.\n\n```bash\npip freeze | grep pyvss\n```\n\n### Linux\n\nYou can use `pip` directly to install PyVSS. Run `pip --version` to see if your version of\nLinux already includes Python and `pip`.\n\n```bash\n pip --version\n```\n\n> If you don't have `pip` installed, first download and install \n [Python 3.5 for Linux][Python 3.5 for Linux] from the\n downloads page of Python.org or using your preferred package manager.\n Download and run the `pip` installation script provided by the Python Packaging Authority.\n\n curl -O https://bootstrap.pypa.io/get-pip.py\n python3 get-pip.py --user\n\n1. Use `pip` to install PyVSS.\n\n```bash\npip install pyvss --upgrade --user\n```\n\n2. Verify that the PyVSS is installed correctly.\n\n```bash\npip freeze | grep pyvss\n```\n\n### Windows\n\n1. Open the Command Prompt from the Start menu.\n\n2. Use the following commands to verify that **Python** and `pip` are both installed correctly.\n\n```batch\nC:\\Windows\\System32> python --version\nPython 3.7.1\nC:\\Windows\\System32> pip --version\npip 18.1 from c:\\program files\\python37\\lib\\site-packages\\pip (python 3.7)\n```\n\n3. Install PyVSS CLI using pip.\n\n```batch\nC:\\Windows\\System32> pip install pyvss\n```\n\n4. Verify that PyVSS is installed correctly.\n\n```batch\nC:\\Windows\\System32> pip freeze | findstr pyvss\n```\n\n## Docker\n\nFor more information refer to the [Docker](docker/README.md) section.\n\nUse\n===\n\nCreate an instance of ``VssManager`` passing your **ITS Private Cloud API access token**\nand your are all set to start calling any of the self-descriptive methods included:\n\n```python\nfrom pyvss.manager import VssManager\nvss = VssManager(tk='api_token')\n# list vms\nvms = vss.get_vms()\n# list folders\nfolders = vss.get_folders()\n# networks\nnetworks = vss.get_networks()\n# domains\ndomains = vss.get_domains()\n# power cycle vm\nvss.power_cycle_vm(uuid='<uuid>') \n# create vm\nreq = vss.create_vm(os='ubuntu64Guest', built='os_install',\n description='Testing python wrapper',\n folder='group-v6736', bill_dept='EIS', disks=[100, 100])\nuuid = vss.wait_for_request(req['_links']['request'], 'vm_uuid', 'Processed')\n# creating multiple vms\nreqs = vss.create_vms(count=3, name='python', os='ubuntu64Guest', bill_dept='EIS',\n description='Testing multiple deployment from python wrapper',\n folder='group-v6736', built='os_install')\nuuids = [vss.wait_for_request(r['_links']['request'], 'vm_uuid', 'Processed') for r in reqs]\n# power on recently created vms\nfor uuid in uuids:\n vss.power_on_vm(uuid) \n# create snapshot\nreq = vss.create_vm_snapshot(uuid='5012abcb-a9f3-e112-c1ea-de2fa9dab90a',\n desc='Snapshot description',\n date_time='2016-08-04 15:30',\n valid=1)\nsnap_id = vss.wait_for_request(req['_links']['request'], 'snap_id', 'Processed')\n# revert to snapshot\nreq = vss.revert_vm_snapshot(uuid, snap_id)\n```\n\nAn alternative is to generate a token from within the ``VssManager`` class and this can be done\nby setting the following environment variables\n\n```bash\nexport VSS_API_USER='username'\nexport VSS_API_USER_PASS='username_password'\n```\n\nThen, from the ``VssManager`` call the ``get_token`` method as follows:\n\n```python\nfrom pyvss.manager import VssManager\nvss = VssManager()\nvss.get_token()\n``` \n\n## Getting Help\n\nWe use GitLab issues for tracking bugs, enhancements and feature requests.\nIf it turns out that you may have found a bug, please [open a new issue][open a new issue].\n\n## Versioning\n\nThe client versions has been recently moved to [Calendar Versioning](https://calver.org/). \nVersions available in the [tags section](https://gitlab-ee.eis.utoronto.ca/vss/py-vss/tags) or \n[PyPI](https://pypi.org/project/pyvss/#history).\n\n## Contributing\n\nRefer to the [Contributing Guide](CONTRIBUTING.md) for details on our code of conduct and the process of \nsubmitting code to the repository.\n\n[docs]: https://eis.utoronto.ca/~vss/pyvss/\n[download the tarball]: https://pypi.python.org/pypi/pyvss\n[Click]: http://click.pocoo.org/6/\n[Python Releases for Windows]: https://www.python.org/downloads/windows/\n[pip]: http://www.pip-installer.org/en/latest/\n[open a new issue]: https://gitlab-ee.eis.utoronto.ca/vss/py-vss/issues/new>\n[Alpine Linux]: https://hub.docker.com/_/alpine/\n[PyVSS]: https://pypi.python.org/pypi/pyvss\n[build-img]: https://gitlab-ee.eis.utoronto.ca/vss/py-vss/badges/master/pipeline.svg\n[coverage-img]: https://gitlab-ee.eis.utoronto.ca/vss/py-vss/badges/master/coverage.svg\n[pypi-img]: https://img.shields.io/pypi/v/pyvss.svg\n[pyver-img]: https://img.shields.io/pypi/pyversions/pyvss.svg\n[docker-pulls-img]: https://img.shields.io/docker/pulls/uofteis/pyvss.svg\n[docker-image]: https://hub.docker.com/r/uofteis/pyvss/\n[Python 3.7 for Mac]: https://www.python.org/downloads/mac-osx/\n[Python 3.5 for Linux]: https://www.python.org/downloads/source/\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "ITS Private Cloud Python Client",
"version": "2023.12.0",
"project_urls": {
"Bug Reports": "https://gitlab-ee.eis.utoronto.ca/vss/py-vss/issues",
"Documentation": "https://eis.utorotno.ca/~vss/py-vss/",
"Download": "https://gitlab-ee.eis.utoronto.ca/vss/py-vss/archive/2023.12.0.zip",
"Homepage": "https://gitlab-ee.eis.utoronto.ca/vss/py-vss",
"Source": "https://gitlab-ee.eis.utoronto.ca/vss/py-vss"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2eb69c61833230a1997845da320d22880a64bbc550bd989e5bdc45d57864e0d1",
"md5": "addd7af5268fa13af4bda98164c93865",
"sha256": "583011ba98643fbb0c58173e43efa9b7f29aaf19e4c826da113b03c243513928"
},
"downloads": -1,
"filename": "pyvss-2023.12.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "addd7af5268fa13af4bda98164c93865",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7.5",
"size": 46327,
"upload_time": "2023-12-13T15:08:47",
"upload_time_iso_8601": "2023-12-13T15:08:47.481609Z",
"url": "https://files.pythonhosted.org/packages/2e/b6/9c61833230a1997845da320d22880a64bbc550bd989e5bdc45d57864e0d1/pyvss-2023.12.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "4bc161c4b9f7d9a224b5313f9435c743c56fd300733e05d63bbfb7b2c25af937",
"md5": "f3a9883b2fa8a1d6347a611fe864ea3e",
"sha256": "fc4fe5c90b1b72bf781a1f04314c5f7c86e71c612be339b3e22703926c1989dd"
},
"downloads": -1,
"filename": "pyvss-2023.12.0.tar.gz",
"has_sig": false,
"md5_digest": "f3a9883b2fa8a1d6347a611fe864ea3e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7.5",
"size": 52221,
"upload_time": "2023-12-13T15:08:49",
"upload_time_iso_8601": "2023-12-13T15:08:49.751011Z",
"url": "https://files.pythonhosted.org/packages/4b/c1/61c4b9f7d9a224b5313f9435c743c56fd300733e05d63bbfb7b2c25af937/pyvss-2023.12.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-13 15:08:49",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pyvss"
}