-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,158 additions
and
1 deletion.
There are no files selected for viewing
131 changes: 131 additions & 0 deletions
131
src/Functions/Public/iaas/Get-vRAExternalNetworkIPRange.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
function Get-vRAExternalNetworkIPRange { | ||
<# | ||
.SYNOPSIS | ||
Get a vRA External Network IP Range | ||
.DESCRIPTION | ||
Get a vRA External Network IP Range | ||
.PARAMETER Id | ||
The ID of the vRA External Network IP Range | ||
.PARAMETER Name | ||
The Name of the vRA External Network IP Range | ||
.INPUTS | ||
System.String | ||
.OUTPUTS | ||
System.Management.Automation.PSObject | ||
.EXAMPLE | ||
Get-vRAExternalNetworkIPRange | ||
.EXAMPLE | ||
Get-vRAExternalNetworkIPRange -Id '3492a6e8-r5d4-1293-b6c4-39037ba693f9' | ||
.EXAMPLE | ||
Get-vRAExternalNetworkIPRange -Name 'TestExternalNetworkIPRange' | ||
#> | ||
[CmdletBinding(DefaultParameterSetName="Standard")][OutputType('System.Management.Automation.PSObject')] | ||
|
||
Param ( | ||
|
||
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName="ById")] | ||
[ValidateNotNullOrEmpty()] | ||
[String[]]$Id, | ||
|
||
[Parameter(Mandatory=$true,ParameterSetName="ByName")] | ||
[ValidateNotNullOrEmpty()] | ||
[String[]]$Name | ||
) | ||
|
||
begin { | ||
$APIUrl = '/iaas/api/external-network-ip-ranges' | ||
|
||
function CalculateOutput([PSCustomObject]$ExternalNetworkIPRange) { | ||
|
||
[PSCustomObject] @{ | ||
Owner = $ExternalNetworkIPRange.owner | ||
Description = $ExternalNetworkIPRange.description | ||
Tags = $ExternalNetworkIPRange.tags | ||
ExternalId = $ExternalNetworkIPRange.externalId | ||
SubnetPrefixLength = $ExternalNetworkIPRange.subnetPrefixLength | ||
Name = $ExternalNetworkIPRange.name | ||
Id = $ExternalNetworkIPRange.id | ||
CreatedAt = $ExternalNetworkIPRange.createdAt | ||
UpdatedAt = $ExternalNetworkIPRange.updatedAt | ||
OrganizationId = $ExternalNetworkIPRange.orgId | ||
StartIPAddress = $ExternalNetworkIPRange.startIPAddress | ||
EndIPAddress = $ExternalNetworkIPRange.endIPAddress | ||
IPVersion = $ExternalNetworkIPRange.ipVersion | ||
AddressSpaceId = $ExternalNetworkIPRange.addressSpaceId | ||
DNSServerAddresses = $ExternalNetworkIPRange.dnsServerAddresses | ||
DNSSearchDomains = $ExternalNetworkIPRange.dnsSearchDomains | ||
Domain = $ExternalNetworkIPRange.domain | ||
GatewayAddress = $ExternalNetworkIPRange.gatewayAddress | ||
Links = $ExternalNetworkIPRange._links | ||
} | ||
} | ||
} | ||
|
||
process { | ||
|
||
try { | ||
|
||
switch ($PsCmdlet.ParameterSetName) { | ||
|
||
# --- Get External Network IP Range by Id | ||
'ById' { | ||
|
||
foreach ($ExternalNetworkIPRangeId in $Id){ | ||
|
||
$URI = "$($APIUrl)?`$filter=id eq '$($ExternalNetworkIPRangeId)'" | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($ExternalNetworkIPRange in $Response.content) { | ||
CalculateOutput $ExternalNetworkIPRange | ||
} | ||
} | ||
|
||
break | ||
} | ||
# --- Get External Network IP Range by Name | ||
'ByName' { | ||
|
||
foreach ($ExternalNetworkIPRangeName in $Name){ | ||
|
||
$URI = "$($APIUrl)?`$filter=name eq '$($ExternalNetworkIPRangeName)'" | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($ExternalNetworkIPRange in $Response.content) { | ||
CalculateOutput $ExternalNetworkIPRange | ||
} | ||
} | ||
|
||
break | ||
} | ||
# --- No parameters passed so return all External Network IP Ranges | ||
'Standard' { | ||
|
||
$URI = $APIUrl | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($ExternalNetworkIPRange in $Response.content) { | ||
CalculateOutput $ExternalNetworkIPRange | ||
} | ||
} | ||
} | ||
} | ||
catch [Exception]{ | ||
|
||
throw | ||
} | ||
} | ||
|
||
end { | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
function Get-vRAFabricAWSVolumeType { | ||
<# | ||
.SYNOPSIS | ||
Get a vRA Fabric AWS Volume Types | ||
.DESCRIPTION | ||
Get a vRA Fabric AWS Volume Types | ||
.INPUTS | ||
None | ||
.OUTPUTS | ||
System.Management.Automation.PSObject | ||
.EXAMPLE | ||
Get-vRAFabricAWSVolumeTypes | ||
#> | ||
[CmdletBinding(DefaultParameterSetName="Standard")][OutputType('System.Management.Automation.PSObject')] | ||
|
||
Param ( | ||
) | ||
|
||
begin { | ||
$APIUrl = '/iaas/api/fabric-aws-volume-types' | ||
|
||
function CalculateOutput([PSCustomObject]$FabricAWSVolumeTypes) { | ||
|
||
[PSCustomObject] @{ | ||
VolumeTypes = $FabricAWSVolumeTypes.volumeTypes | ||
} | ||
} | ||
} | ||
|
||
process { | ||
|
||
try { | ||
|
||
switch ($PsCmdlet.ParameterSetName) { | ||
|
||
# --- Return all Fabric AWS Volume Types | ||
'Standard' { | ||
|
||
$URI = $APIUrl | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($FabricAWSVolumeTypes in $Response.content) { | ||
CalculateOutput $FabricAWSVolumeTypes | ||
} | ||
} | ||
} | ||
} | ||
catch [Exception]{ | ||
|
||
throw | ||
} | ||
} | ||
|
||
end { | ||
|
||
} | ||
} | ||
|
66 changes: 66 additions & 0 deletions
66
src/Functions/Public/iaas/Get-vRAFabricAzureStorageAccount.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
function Get-vRAFabricAzureStorageAccount { | ||
<# | ||
.SYNOPSIS | ||
Get a vRA Fabric Azure Storage Accounts | ||
.DESCRIPTION | ||
Get a vRA Fabric Azure Storage Accounts | ||
.INPUTS | ||
None | ||
.OUTPUTS | ||
System.Management.Automation.PSObject | ||
.EXAMPLE | ||
Get-vRAFabricAzureStorageAccounts | ||
#> | ||
[CmdletBinding(DefaultParameterSetName="Standard")][OutputType('System.Management.Automation.PSObject')] | ||
|
||
Param ( | ||
) | ||
|
||
begin { | ||
$APIUrl = '/iaas/api/fabric-azure-storage-accounts' | ||
|
||
function CalculateOutput([PSCustomObject]$FabricAzureStorageAccounts) { | ||
|
||
# Don't have any Azure accounts so not sure what this is supposed to look like, will test later | ||
# TODO find examples of what these objects look like | ||
|
||
[PSCustomObject] @{ | ||
FabricAzureStorageAccount = $FabricAzureStorageAccounts | ||
} | ||
} | ||
} | ||
|
||
process { | ||
|
||
try { | ||
|
||
switch ($PsCmdlet.ParameterSetName) { | ||
|
||
# --- Return all Fabric AWS Volume Types | ||
'Standard' { | ||
|
||
$URI = $APIUrl | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($FabricAzureStorageAccounts in $Response.content) { | ||
CalculateOutput $FabricAzureStorageAccounts | ||
} | ||
} | ||
} | ||
} | ||
catch [Exception]{ | ||
|
||
throw | ||
} | ||
} | ||
|
||
end { | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
function Get-vRAFabricCompute { | ||
<# | ||
.SYNOPSIS | ||
Get a vRA Fabric Compute | ||
.DESCRIPTION | ||
Get a vRA Fabric Compute | ||
.PARAMETER Id | ||
The ID of the Fabric Compute | ||
.PARAMETER Name | ||
The Name of the Fabric Compute | ||
.INPUTS | ||
System.String | ||
.OUTPUTS | ||
System.Management.Automation.PSObject | ||
.EXAMPLE | ||
Get-vRAFabricCompute | ||
.EXAMPLE | ||
Get-vRAFabricCompute -Id '3492a6e8-r5d4-1293-b6c4-39037ba693f9' | ||
.EXAMPLE | ||
Get-vRAFabricCompute -Name 'TestFabricCompute' | ||
#> | ||
[CmdletBinding(DefaultParameterSetName="Standard")][OutputType('System.Management.Automation.PSObject')] | ||
|
||
Param ( | ||
|
||
[Parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,ParameterSetName="ById")] | ||
[ValidateNotNullOrEmpty()] | ||
[String[]]$Id, | ||
|
||
[Parameter(Mandatory=$true,ParameterSetName="ByName")] | ||
[ValidateNotNullOrEmpty()] | ||
[String[]]$Name | ||
) | ||
|
||
begin { | ||
$APIUrl = '/deployment/api/fabric-computes' | ||
|
||
function CalculateOutput([PSCustomObject]$FabricCompute) { | ||
|
||
[PSCustomObject] @{ | ||
ExternalRegionId = $FabricCompute.externalRegionId | ||
Tags = $FabricCompute.tags | ||
Type = $FabricCompute.type | ||
CustomProperties = $FabricCompute.customProperties | ||
ExternalId = $FabricCompute.externalId | ||
Name = $FabricCompute.name | ||
Id = $FabricCompute.id | ||
CreatedAt = $FabricCompute.createdAt | ||
UpdatedAt = $FabricCompute.updatedAt | ||
OrganizationId = $FabricCompute.organizationId | ||
} | ||
} | ||
} | ||
|
||
process { | ||
|
||
try { | ||
|
||
switch ($PsCmdlet.ParameterSetName) { | ||
|
||
# --- Get FabricCompute by Id | ||
'ById' { | ||
|
||
foreach ($FabricComputeId in $Id){ | ||
|
||
$URI = "$($APIUrl)?`$filter=id eq '$($FabricComputeId)'" | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($FabricCompute in $Response.content) { | ||
CalculateOutput $FabricCompute | ||
} | ||
} | ||
|
||
break | ||
} | ||
# --- Get FabricCompute by Name | ||
'ByName' { | ||
|
||
foreach ($FabricComputeName in $Name){ | ||
|
||
$URI = "$($APIUrl)?`$filter=name eq '$($FabricComputeName)'" | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($FabricCompute in $Response.content) { | ||
CalculateOutput $FabricCompute | ||
} | ||
} | ||
|
||
break | ||
} | ||
# --- No parameters passed so return all FabricComputes | ||
'Standard' { | ||
|
||
$URI = $APIUrl | ||
$Response = Invoke-vRARestMethod -Method GET -URI $URI -Verbose:$VerbosePreference | ||
|
||
foreach ($FabricCompute in $Response.content) { | ||
CalculateOutput $FabricCompute | ||
} | ||
} | ||
} | ||
} | ||
catch [Exception]{ | ||
|
||
throw | ||
} | ||
} | ||
|
||
end { | ||
|
||
} | ||
} | ||
|
Oops, something went wrong.