Integrations/AzureCompute_v2/AzureCompute_v2.py
def create_vm_command():
    """
    Create a virtual machine instance with the specified OS image

    demisto parameter: (string) resource_group
        Resource group to which the new VM will belong

    demisto parameter: (string) virtual_machine_name
        Name to assign to the new virtual machine

    demisto parameter: (string) virtual_machine_location
        Region in which the vm will be hosted

    demisto parameter: (string) nic_name
        The name of the Network Interface to link the VM with. This must be created from the Azure Portal

    demisto parameter: (string) vm_size
        The name of a VirtualMachineSize which determines the size of the deployed vm

    demisto parameter: (string) os_image
        Choose the base operating system image of the vm

    demisto parameter: (string) sku
        SKU of the image to be used

    demisto parameter: (string) publisher
        Name of the publisher of the image

    demisto parameter: (string) version
        Version of the image to use

    demisto parameter: (string) offer
        Specifies the offer of the platform image or marketplace image used
        to create the virtual machine

    demisto parameter: (string) admin_username
        Admin Username to be used when creating the VM

    demisto parameter: (string) admin_password
        Admin Password to be used when creating the VM

    returns:
        Virtual Machine Object
    """
    args = demisto.args()
    response = create_vm(args)

    # Retrieve relevant properties to return to context
    vm_name = response.get('name').lower()
    properties = response.get('properties')
    os_disk = properties.get('storageProfile', {}).get('osDisk')
    datadisk = os_disk.get('diskSizeGB', 'NA')
    vm_id = properties.get('vmId')
    os_type = os_disk.get('osType')
    provisioning_state = properties.get('provisioningState')
    location = response.get('location')

    vm = {
        'Name': vm_name,
        'ID': vm_id,
        'Size': datadisk,
        'OS': os_type,
        'ProvisioningState': provisioning_state,
        'Location': location,
        'ResourceGroup': args.get('resource_group')
    }

    title = 'Created Virtual Machine "{}"'.format(vm_name)
    human_readable = tableToMarkdown(title, vm, removeNull=True)
    entry_context = {'Azure.Compute(val.Name && val.Name === obj.Name)': vm}
    demisto.results({
        'Type': entryTypes['note'],
        'Contents': response,
        'ContentsFormat': formats['json'],
        'ReadableContentsFormat': formats['markdown'],
        'HumanReadable': human_readable,
        'EntryContext': entry_context
    })

    Create a virtual machine instance with the specified OS image

    demisto parameter: (string) resource_group
        Resource group to which the new VM will belong

    demisto parameter: (string) virtual_machine_name
        Name to assign to the new virtual machine

    demisto parameter: (string) virtual_machine_location
        Region in which the vm will be hosted

    demisto parameter: (string) nic_name
        The name of the Network Interface to link the VM with. This must be created from the Azure Portal

    demisto parameter: (string) vm_size
        The name of a VirtualMachineSize which determines the size of the deployed vm

    demisto parameter: (string) os_image
        Choose the base operating system image of the vm

    demisto parameter: (string) sku
        SKU of the image to be used

    demisto parameter: (string) publisher
        Name of the publisher of the image

    demisto parameter: (string) version
        Version of the image to use

    demisto parameter: (string) offer
        Specifies the offer of the platform image or marketplace image used
        to create the virtual machine

    demisto parameter: (string) admin_username
        Admin Username to be used when creating the VM

    demisto parameter: (string) admin_password
        Admin Password to be used when creating the VM

    returns:
        Virtual Machine Object
    
Create a virtual machine instance with the specified OS image
demisto parameter: (string) resource_group
Resource group to which the new VM will belong

demisto parameter: (string) virtual_machine_name
Name to assign to the new virtual machine

demisto parameter: (string) virtual_machine_location
Region in which the vm will be hosted

demisto parameter: (string) nic_name
The name of the Network Interface to link the VM with. This must be created from the Azure Portal

demisto parameter: (string) vm_size
The name of a VirtualMachineSize which determines the size of the deployed vm

demisto parameter: (string) os_image
Choose the base operating system image of the vm

demisto parameter: (string) sku
SKU of the image to be used

demisto parameter: (string) publisher
Name of the publisher of the image

demisto parameter: (string) version
Version of the image to use

demisto parameter: (string) offer
Specifies the offer of the platform image or marketplace image used
to create the virtual machine

demisto parameter: (string) admin_username
Admin Username to be used when creating the VM

demisto parameter: (string) admin_password
Admin Password to be used when creating the VM

Virtual Machine Object
Create a virtual machine instance with the specified OS image demisto parameter : ( string ) resource_group Resource group to which the new VM will belong demisto parameter : ( string ) virtual_machine_name Name to assign to the new virtual machine demisto parameter : ( string ) virtual_machine_location Region in which the vm will be hosted demisto parameter : ( string ) nic_name The name of the Network Interface to link the VM with . This must be created from the Azure Portal demisto parameter : ( string ) vm_size The name of a VirtualMachineSize which determines the size of the deployed vm demisto parameter : ( string ) os_image Choose the base operating system image of the vm demisto parameter : ( string ) sku SKU of the image to be used demisto parameter : ( string ) publisher Name of the publisher of the image demisto parameter : ( string ) version Version of the image to use demisto parameter : ( string ) offer Specifies the offer of the platform image or marketplace image used to create the virtual machine demisto parameter : ( string ) admin_username Admin Username to be used when creating the VM demisto parameter : ( string ) admin_password Admin Password to be used when creating the VM Virtual Machine Object
def create_vm_command():
    args = demisto.args()
    response = create_vm(args)
    vm_name = response.get('name').lower()
    properties = response.get('properties')
    os_disk = properties.get('storageProfile', {}).get('osDisk')
    datadisk = os_disk.get('diskSizeGB', 'NA')
    vm_id = properties.get('vmId')
    os_type = os_disk.get('osType')
    provisioning_state = properties.get('provisioningState')
    location = response.get('location')
    vm = {
        'Name': vm_name,
        'ID': vm_id,
        'Size': datadisk,
        'OS': os_type,
        'ProvisioningState': provisioning_state,
        'Location': location,
        'ResourceGroup': args.get('resource_group')
    }
    title = 'Created Virtual Machine "{}"'.format(vm_name)
    human_readable = tableToMarkdown(title, vm, removeNull=True)
    entry_context = {'Azure.Compute(val.Name && val.Name === obj.Name)': vm}
    demisto.results({
        'Type': entryTypes['note'],
        'Contents': response,
        'ContentsFormat': formats['json'],
        'ReadableContentsFormat': formats['markdown'],
        'HumanReadable': human_readable,
        'EntryContext': entry_context
    })
def create_vm_command ( ) : args = demisto . args ( ) response = create_vm ( args ) vm_name = response . get ( 'name' ) . lower ( ) properties = response . get ( 'properties' ) os_disk = properties . get ( 'storageProfile' , { } ) . get ( 'osDisk' ) datadisk = os_disk . get ( 'diskSizeGB' , 'NA' ) vm_id = properties . get ( 'vmId' ) os_type = os_disk . get ( 'osType' ) provisioning_state = properties . get ( 'provisioningState' ) location = response . get ( 'location' ) vm = { 'Name' : vm_name , 'ID' : vm_id , 'Size' : datadisk , 'OS' : os_type , 'ProvisioningState' : provisioning_state , 'Location' : location , 'ResourceGroup' : args . get ( 'resource_group' ) } title = 'Created Virtual Machine "{}"' . format ( vm_name ) human_readable = tableToMarkdown ( title , vm , removeNull = True ) entry_context = { 'Azure.Compute(val.Name && val.Name === obj.Name)' : vm } demisto . results ( { 'Type' : entryTypes [ 'note' ] , 'Contents' : response , 'ContentsFormat' : formats [ 'json' ] , 'ReadableContentsFormat' : formats [ 'markdown' ] , 'HumanReadable' : human_readable , 'EntryContext' : entry_context } )
Create a virtual machine instance with the specified OS image
demisto parameter: (string) resource_group
Resource group to which the new VM will belong
Create a virtual machine instance with the specified OS image demisto parameter : ( string ) resource_group Resource group to which the new VM will belong
"""
    Create a virtual machine instance with the specified OS image

    demisto parameter: (string) resource_group
        Resource group to which the new VM will belong

    demisto parameter: (string) virtual_machine_name
        Name to assign to the new virtual machine

    demisto parameter: (string) virtual_machine_location
        Region in which the vm will be hosted

    demisto parameter: (string) nic_name
        The name of the Network Interface to link the VM with. This must be created from the Azure Portal

    demisto parameter: (string) vm_size
        The name of a VirtualMachineSize which determines the size of the deployed vm

    demisto parameter: (string) os_image
        Choose the base operating system image of the vm

    demisto parameter: (string) sku
        SKU of the image to be used

    demisto parameter: (string) publisher
        Name of the publisher of the image

    demisto parameter: (string) version
        Version of the image to use

    demisto parameter: (string) offer
        Specifies the offer of the platform image or marketplace image used
        to create the virtual machine

    demisto parameter: (string) admin_username
        Admin Username to be used when creating the VM

    demisto parameter: (string) admin_password
        Admin Password to be used when creating the VM

    returns:
        Virtual Machine Object
    """ # Retrieve relevant properties to return to context