Public/Send-Batch.ps1

<#
    .DESCRIPTION
    Wrapper for Nutanix API version 0.3.
 
    .NOTES
    Author: Timothy Rasiah
#>


function Send-Batch {
    [CmdletBinding()]
    param (
        [ValidateSet("SEQUENTIAL", "PARALLEL")]
        [String]$ExecutionOrder = "SEQUENTIAL",
        [ValidateSet("CONTINUE")]
        [String]$ActionOnFailure = "CONTINUE",
        [ValidateCount(0,60)]
        [PSObject[]]$ApiRequestList = @()
    )

    $data = @{
        "execution_order" = $ExecutionOrder
        "action_on_failure" = $ActionOnFailure
        "api_request_list" = $ApiRequestList
    }
    
    $response = Send-Request -method "POST" -endpoint "/batch" -data $data
    return $response
}