This package provides proxy class for calling azure commands directly from Python.
Project description
az-pyproxy
This Python package provides a proxy class for calling az commands directly from Python.
Requirements
- azure cli
- Python 3.x
Installation
Via PIP
pip3 install azpyproxy
or
python3 -m pip install azpyproxy
Building from source
wget https://github.com/tomasvotava/az-pyproxy/archive/master.zip
unzip master.zip
cd az-pyproxy-master
python setup.py build
python setup.py install
Usage
from azure_pyproxy import Azure
az = Azure()
# command: az vm start virtual
az.vm_start("virtual")
# additional flags and parameters
# next method call expands like this:
# az resource list --resource-group="YOUR_RESOURCE_GROUP"
az.resource_list(resource_group="YOUR_RESOURCE_GROUP")
# positional arguments are simply concatenated after the command call, so commands can be also passed as arguments
az.vm("deallocate", name="virtual", resource_group="YOUR_RESOURCE_GROUP")
# expands as:
# az vm deallocate --name="virtual" --resource_group="YOUR_RESOURCE_GROUP"
# by default, underscores in flag names are replaced with dashes
az.vm_deallocate(name="virtual", resource_group="YOUR_RESOURCE_GROUP")
# az vm deallocate --name="virtual" --resource_group="YOUR_RESOURCE_GROUP"
# however, this can be overriden by specifying replace_underscore=False
az.vm_deallocate(name="virtual", resource_group="YOUR_RESOURCE_GROUP", replace_underscore=False)
# az vm deallocate --name="virtual" --resource_group="YOUR_RESOURCE_GROUP"
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
AzurePyProxy-1.0b0.tar.gz
(2.9 kB
view hashes)
Built Distribution
AzurePyProxy-1.0b0-py3.6.egg
(4.2 kB
view hashes)