Public/Migrate-Image.ps1

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


function Migrate-Image {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [String[]]$ImageUuid,
        [Parameter(Mandatory=$true)]
        [String]$ClusterUuid
    )

    $data = @{
        "image_reference_list" = @()
        "cluster_reference" = @{
            "kind" = "cluster"
            "uuid" = $ClusterUuid
        }
    }

    foreach ($_ImageUuid in $ImageUuid) {
        $data.image_reference_list += @{
            "kind" = "image"
            "uuid" = $_ImageUuid
        }
    }

    $response = Send-Request -method "POST" -endpoint "/images/migrate" -data $data
    return $response
}