Public/Get-Subnet.ps1

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


function Get-Subnet {
    [CmdletBinding()]
    param (
        $uuid
    )
    
    $data = @{
        "kind" = "subnet"
    }

    if (-not $uuid) {
        $response = Send-Request -method "POST" -endpoint "/subnets/list" -data $data
        return $response.entities
    }

    $response = Send-Request -method "GET" -endpoint "/subnets/$($uuid)"
    return $response
}