Public/Get-NgtPolicy.ps1

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


function Get-NgtPolicy {
    [CmdletBinding()]
    param (
        $uuid,
        $name
    )
    
    if ($uuid) {
        $response = Send-Request -method "GET" -endpoint "/ngt_policies/$($uuid)"
        return $response
    }

    $data = @{
        "kind" = "ngt_policy"
    }

    if ($name) {
        $data["filter"] = "name==$($name)"
    }

    $response = Send-Request -method "POST" -endpoint "/ngt_policies/list" -data $data
    return $response.entities
}