glb-azure 1.0.2
A python package to interact with the Azure cloud resources for GLB DS team
Requires Python: >=3.6
Keywords: glb_azure

=========
GLB_azure
=========

A python package to interact with the Azure cloud resources for GLB DS team


Features
--------

1. start_vm: Provisions a new Azure Virtual Machine based on the name and size you provide
2. stop_vm: Shuts down an existing Virtual Machine
3. delete_vm: Deletes an existing Virtual Machine based on the name provided.
4. get_vm_ip: Get the IP address to log onto an existing Virtual Machine based on the name provided
5. resize_vm: Change the size of an existing VM.

Usage
-------

**Environment Variables**:

Please follow EXAMPLE.env or the following template to export appropriate environment variables for this package to work:

```zsh
SUBSCRIPTION_ID=subscription-id
IMAGE_ID=image-id
RESOURCE_GROUP_NAME=resource-group-name
LOCATION=location
VNET_NAME=vnet-name
SUBNET_NAME=subnet-name
NSG_NAME=nsg-name
NSG_ID=/nsg/id
SSH_KEY_NAME=ssh-key-name
USERNAME=username
```

**start_vm**:

    Arguments:
        ```vm_name```:String -> the name of the VM to start.

    Returns:
        - "Starting the virtual machine: {vm_name}" and VM status if successful
        - "Machine does not appear to exist" if the machine is not found.

**stop_vm**:

    Arguments:
        ```vm_name```:String -> the name of the VM to stop.

    Returns:
        - "Deallocation of the virtual machine: {vm_name}"and VM status if successful
        - "Machine does not appear to exist" if the machine is not found.

**create_vm**:

    Arguments:
        ```vm_name```:String -> the name of the VM to provision.
        ```size```:String -> one of standard Azure VM size codes

    Returns:
        - "Creating the virtual machine: {vm_name}"and VM status if successful
        - "This VM {name} already exists and cannot create a new vm. Please choose a new name" if the VM already exists.

**resize_vm**:

    Arguments:
        ```vm_name```:String -> the name of the VM to resize.
        ```size```:String -> the new desired size of your VM. One of Azure standard size codes.

    Returns:
        - "Resizing of the virtual machine: {vm_name}"and VM status if successful
        - "Machine does not appear to exist" if the machine is not found.

**delete_vm**:

    Arguments:
        ```vm_name```:String -> the name of the VM to delete.

    Returns:
        - "Deleting the virtual machine: {vm_name}"and VM status if successful
        - "Machine does not appear to exist" if the machine is not found.

**get_vm_ip**:

    Arguments:
        ```vm_name```:String -> the name of the VM to see IP address of.

    Returns:
        - "One or more IP addressed for your virtual machine {vm_name} as listed below.\n Please use that for ssh connections" if successful
        - "Machine does not appear to exist" if the machine is not found.


Credits
-------

This package was created with Cookiecutter_ and the `audreyr/cookiecutter-pypackage`_ project template.

.. _Cookiecutter: https://github.com/audreyr/cookiecutter
.. _`audreyr/cookiecutter-pypackage`: https://github.com/audreyr/cookiecutter-pypackage


=======
History
=======

0.1.0 (2021-05-05)
------------------

* First release on PyPI.