Skip to content

Commit

Permalink
- Add InfoBlox and NSX Policy Manager data source references.
Browse files Browse the repository at this point in the history
- Add entity cmdlet (Get-vRNICheckPointManagers) to retrieve registered CheckPoint Managers
  • Loading branch information
smitmartijn committed Jan 7, 2019
1 parent cb2130e commit fead6ad
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions PowervRNI.psm1
Expand Up @@ -19,7 +19,9 @@ $Script:DatasourceURLs.Add("hponeview", @("/data-sources/hpov-managers"))
$Script:DatasourceURLs.Add("hpvcmanager", @("/data-sources/hpvc-managers"))
$Script:DatasourceURLs.Add("checkpointfirewall", @("/data-sources/checkpoint-firewalls"))
$Script:DatasourceURLs.Add("panfirewall", @("/data-sources/panorama-firewalls"))
$Script:DatasourceURLs.Add("all", @("/data-sources/vcenters", "/data-sources/nsxv-managers", "/data-sources/cisco-switches", "/data-sources/arista-switches", "/data-sources/dell-switches", "/data-sources/brocade-switches", "/data-sources/juniper-switches", "/data-sources/ucs-managers", "/data-sources/hpov-managers", "/data-sources/hpvc-managers", "/data-sources/checkpoint-firewalls", "/data-sources/panorama-firewalls"))
$Script:DatasourceURLs.Add("infoblox", @("/data-sources/infoblox-managers"))
$Script:DatasourceURLs.Add("nsxpolicymanager", @("/data-sources/policy-managers"))
$Script:DatasourceURLs.Add("all", @("/data-sources/vcenters", "/data-sources/nsxv-managers", "/data-sources/cisco-switches", "/data-sources/arista-switches", "/data-sources/dell-switches", "/data-sources/brocade-switches", "/data-sources/juniper-switches", "/data-sources/ucs-managers", "/data-sources/hpov-managers", "/data-sources/hpvc-managers", "/data-sources/checkpoint-firewalls", "/data-sources/panorama-firewalls", "/data-sources/infoblox-managers", "/data-sources/policy-managers"))

# Keep another list handy which translates the internal vRNI Names for datasources to their relative URLs
$Script:DatasourceInternalURLs = @{}
Expand All @@ -36,6 +38,8 @@ $Script:DatasourceInternalURLs.Add("HPOneViewManagerDataSource", "/data-sources/
$Script:DatasourceInternalURLs.Add("HPVCManagerDataSource", "/data-sources/hpvc-managers")
$Script:DatasourceInternalURLs.Add("CheckpointFirewallDataSource", "/data-sources/checkpoint-firewalls")
$Script:DatasourceInternalURLs.Add("PanFirewallDataSource", "/data-sources/panorama-firewalls")
$Script:DatasourceInternalURLs.Add("InfobloxManagerDataSource", "/data-sources/infoblox-managers")
$Script:DatasourceInternalURLs.Add("PolicyManagerDataSource", "/data-sources/policy-managers")

# This list will be used in Get-vRNIEntity to map entity URLs to their IDs so we can use those IDs in /entities/fetch
$Script:EntityURLtoIdMapping = @{}
Expand All @@ -60,6 +64,7 @@ $Script:EntityURLtoIdMapping.Add("vcenter-managers", "VCenterManager")
$Script:EntityURLtoIdMapping.Add("nsx-managers", "NSXVManager")
$Script:EntityURLtoIdMapping.Add("distributed-virtual-switches", "DistributedVirtualSwitch")
$Script:EntityURLtoIdMapping.Add("distributed-virtual-portgroups", "DistributedVirtualPortgroup")
$Script:EntityURLtoIdMapping.Add("firewall-managers", "CheckpointManager")

# Thanks to PowerNSX (http://github.com/vmware/powernsx) for providing some of the base functions &
# principles on which this module is built on.
Expand Down Expand Up @@ -729,7 +734,7 @@ function New-vRNIDataSource
param (
[Parameter (Mandatory=$true)]
# Which datasource type to create - TODO: make this a dynamic param to get the values from $Script:data
[ValidateSet ("vcenter", "nsxv", "nsxt", "ciscoswitch", "aristaswitch", "dellswitch", "brocadeswitch", "juniperswitch", "ciscoucs", "hponeview", "hpvcmanager", "checkpointfirewall", "panfirewall")]
[ValidateSet ("vcenter", "nsxv", "nsxt", "ciscoswitch", "aristaswitch", "dellswitch", "brocadeswitch", "juniperswitch", "ciscoucs", "hponeview", "hpvcmanager", "checkpointfirewall", "panfirewall", "infoblox", "nsxpolicymanager")]
[string]$DataSourceType,
[Parameter (Mandatory=$true)]
# Username to use to login to the datasource
Expand Down Expand Up @@ -2584,6 +2589,42 @@ function Get-vRNIDistributedSwitchPortGroup
$results
}

function Get-vRNICheckPointManagers
{
<#
.SYNOPSIS
Get available CheckPoint Firewall Managers from vRealize Network Insight.
.DESCRIPTION
vRealize Network Insight has a database of all CheckPoint Firewall Managers in your environment
and this cmdlet will help you discover these managers.
.EXAMPLE
PS C:\> Get-vRNICheckPointManagers
Get all CheckPoint Firewall Managers in the vRNI environment.
.EXAMPLE
PS C:\> Get-vRNICheckPointManagers CP01
Get only the CheckPoint Firewall Managers called 'CP01'
#>
param (
[Parameter (Mandatory=$false)]
# Limit the amount of records returned
[int]$Limit = 0,
[Parameter (Mandatory=$false, Position=1)]
# Limit the amount of records returned
[string]$Name = "",
[Parameter (Mandatory=$False)]
# vRNI Connection object
[ValidateNotNullOrEmpty()]
[PSCustomObject]$Connection=$defaultvRNIConnection
)

# Call Get-vRNIEntity with the proper URI to get the entity results
$results = Get-vRNIEntity -Entity_URI "firewall-managers" -Name $Name -Limit $Limit
$results
}

#----------------------------------------------------------------------------------------------------------------#
#----------------------------------------------------------------------------------------------------------------#
#----------------------------------------- Storage Entities -----------------------------------------------------#
Expand Down

0 comments on commit fead6ad

Please sign in to comment.