subnet type
This commit is contained in:
@@ -9,15 +9,28 @@ public class Subnetwork {
|
|||||||
public int SectionId { get; }
|
public int SectionId { get; }
|
||||||
public string Description { get; }
|
public string Description { get; }
|
||||||
public string LinkedSubnet { get; }
|
public string LinkedSubnet { get; }
|
||||||
public int FirewallAddressObject { get; }
|
public string FirewallAddressObject { get; }
|
||||||
public int VrfId { get; }
|
public int VrfId { get; }
|
||||||
public int MasterSubnetId { get; }
|
public int MasterSubnetId { get; }
|
||||||
public bool AllowRequests { get; }
|
public bool AllowRequests { get; }
|
||||||
public int VlanId { get; }
|
public int VlanId { get; }
|
||||||
public bool ShowName { get; }
|
public bool ShowName { get; }
|
||||||
public int Device { get; }
|
public int DeviceId { get; }
|
||||||
|
public string Permissions { get; }
|
||||||
public bool PingSubnet { get; }
|
public bool PingSubnet { get; }
|
||||||
public bool DiscoverSubnet { get; }
|
public bool DiscoverSubnet { get; }
|
||||||
|
public bool DNSRecursive { get; }
|
||||||
|
public bool DNSRecords { get; }
|
||||||
|
public int NameserverId { get; }
|
||||||
|
public bool ScanAgent { get; }
|
||||||
|
public bool IsFolder { get; }
|
||||||
|
public bool IsFull { get; }
|
||||||
|
public int TagId { get; }
|
||||||
|
public int Threshold { get; }
|
||||||
|
public int LocationId { get; }
|
||||||
|
public DateTime? EditDate { get; }
|
||||||
|
public DateTime? LastScan { get; }
|
||||||
|
public DateTime? LastDiscovery { get; }
|
||||||
public bool ResolveDNS { get; }
|
public bool ResolveDNS { get; }
|
||||||
public Subnetwork(
|
public Subnetwork(
|
||||||
int id,
|
int id,
|
||||||
@@ -26,16 +39,28 @@ public class Subnetwork {
|
|||||||
int sectionId,
|
int sectionId,
|
||||||
string description,
|
string description,
|
||||||
string linkedSubnet,
|
string linkedSubnet,
|
||||||
int firewallAddressObject,
|
string firewallAddressObject,
|
||||||
int vrfId,
|
int vrfId,
|
||||||
int masterSubnetId,
|
int masterSubnetId,
|
||||||
string permissions,
|
|
||||||
bool allowRequests,
|
bool allowRequests,
|
||||||
int vlanId,
|
int vlanId,
|
||||||
bool showName,
|
bool showName,
|
||||||
int device,
|
int deviceId,
|
||||||
|
string permissions,
|
||||||
bool pingSubnet,
|
bool pingSubnet,
|
||||||
bool discoverSubnet,
|
bool discoverSubnet,
|
||||||
|
bool dnsRecursive,
|
||||||
|
bool dnsRecords,
|
||||||
|
int nameserverId,
|
||||||
|
bool scanAgent,
|
||||||
|
bool isFolder,
|
||||||
|
bool isFull,
|
||||||
|
int tagId,
|
||||||
|
int threshold,
|
||||||
|
int locationId,
|
||||||
|
DateTime? editDate,
|
||||||
|
DateTime? lastScan,
|
||||||
|
DateTime? lastDiscovery,
|
||||||
bool resolveDNS
|
bool resolveDNS
|
||||||
) {
|
) {
|
||||||
this.Id = id;
|
this.Id = id;
|
||||||
@@ -50,9 +75,22 @@ public class Subnetwork {
|
|||||||
this.AllowRequests = allowRequests;
|
this.AllowRequests = allowRequests;
|
||||||
this.VlanId = vlanId;
|
this.VlanId = vlanId;
|
||||||
this.ShowName = showName;
|
this.ShowName = showName;
|
||||||
this.Device = device;
|
this.DeviceId = deviceId;
|
||||||
|
this.Permissions = permissions;
|
||||||
this.PingSubnet = pingSubnet;
|
this.PingSubnet = pingSubnet;
|
||||||
this.DiscoverSubnet = discoverSubnet;
|
this.DiscoverSubnet = discoverSubnet;
|
||||||
|
this.DNSRecursive = dnsRecursive;
|
||||||
|
this.DNSRecords = dnsRecords;
|
||||||
|
this.NameserverId = nameserverId;
|
||||||
|
this.ScanAgent = scanAgent;
|
||||||
|
this.IsFolder = isFolder;
|
||||||
|
this.IsFull = isFull;
|
||||||
|
this.TagId = tagId;
|
||||||
|
this.Threshold = threshold;
|
||||||
|
this.LocationId = locationId;
|
||||||
|
this.EditDate = editDate;
|
||||||
|
this.LastScan = lastScan;
|
||||||
|
this.LastDiscovery = lastDiscovery;
|
||||||
this.ResolveDNS = resolveDNS;
|
this.ResolveDNS = resolveDNS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,5 +3,14 @@ using System;
|
|||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public enum subcontrollers {
|
public enum subcontrollers {
|
||||||
nameservers
|
nameservers,
|
||||||
|
tags,
|
||||||
|
devices,
|
||||||
|
device_types,
|
||||||
|
vlans,
|
||||||
|
vrfs,
|
||||||
|
scanagents,
|
||||||
|
locations,
|
||||||
|
nat,
|
||||||
|
racks
|
||||||
}
|
}
|
||||||
@@ -2,8 +2,7 @@ function Invoke-Request {
|
|||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
param (
|
param (
|
||||||
[parameter(Mandatory=$true)]
|
[parameter(Mandatory=$true)]
|
||||||
[ValidateSet("POST","GET","PATCH","DELETE")]
|
[methods]
|
||||||
[string]
|
|
||||||
$Method,
|
$Method,
|
||||||
[parameter(Mandatory=$true)]
|
[parameter(Mandatory=$true)]
|
||||||
[ValidateSet("user","vlan","subnets","addresses","sections","vrf","l2domains","tools")]
|
[ValidateSet("user","vlan","subnets","addresses","sections","vrf","l2domains","tools")]
|
||||||
@@ -50,7 +49,7 @@ function Invoke-Request {
|
|||||||
Headers = $_headers
|
Headers = $_headers
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($Method -match "POST|PATCH") {
|
if ($Method -eq [methods]::POST -or $Method -eq [methods]) {
|
||||||
if ($Params -is [PSCustomObject]) {
|
if ($Params -is [PSCustomObject]) {
|
||||||
$_params = @{};
|
$_params = @{};
|
||||||
$Params | Get-Member -MemberType *Property | Where-Object {
|
$Params | Get-Member -MemberType *Property | Where-Object {
|
||||||
@@ -65,9 +64,9 @@ function Invoke-Request {
|
|||||||
|
|
||||||
if ($_response.code -match "20\d") {
|
if ($_response.code -match "20\d") {
|
||||||
switch ($Type) {
|
switch ($Type) {
|
||||||
"address" { $_response.data | ForEach-Object { New-Object -TypeName "PS.IPAM.Address" -ArgumentList $_.psobject.properties.value } }
|
"address" { $_response.data | ForEach-Object { New-Object -TypeName "Address" -ArgumentList $_.psobject.properties.value } }
|
||||||
"subnet" { $_response.data | ForEach-Object { New-Object -TypeName "PS.IPAM.Subnetwork" -ArgumentList $_.psobject.properties.value } }
|
"subnet" { $_response.data | ForEach-Object { New-Object -TypeName "Subnetwork" -ArgumentList $_.psobject.properties.value } }
|
||||||
"tag" { $_response.data | ForEach-Object { New-Object -TypeName "PS.IPAM.Tag" -ArgumentList $_.psobject.properties.value } }
|
"tag" { $_response.data | ForEach-Object { New-Object -TypeName "Tag" -ArgumentList $_.psobject.properties.value } }
|
||||||
Default { $_response.data }
|
Default { $_response.data }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using namespace ps.ipam
|
||||||
|
|
||||||
Get-ChildItem "$(Split-Path $script:MyInvocation.MyCommand.Path)\functions" -Filter "*.ps1" -Recurse | ForEach-Object {
|
Get-ChildItem "$(Split-Path $script:MyInvocation.MyCommand.Path)\functions" -Filter "*.ps1" -Recurse | ForEach-Object {
|
||||||
. $_.FullName
|
. $_.FullName
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user