Public/Net-Subnet.ps1

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


function New-Subnet {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [String]$Name,
        [Parameter(Mandatory=$true)]
        [ValidateSet("VLAN", "OVERLAY")]
        [String]$SubnetType,
        [String]$Description
    )

    $data = @{
        "spec" = @{
            "name" = $Name
            "resources" = @{
                "subnet_type" = $SubnetType
            }
        }
        "metadata" = @{
            "kind" = "subnet"
        }
    }

    if ($Description) {
        $data.spec["description"] = $Description
    }

    # $response = Send-Request -method "POST" -endpoint "/subnets" -data $data
    # return $response
    
    throw [System.NotImplementedException]
}