Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Id of Folder #24

Open
MartinDoed opened this issue Sep 29, 2022 · 2 comments
Open

Id of Folder #24

MartinDoed opened this issue Sep 29, 2022 · 2 comments

Comments

@MartinDoed
Copy link

Hi,

I able to create a folder with:
New-PhpIpamSubnet -Params @{ description = "Test"; sectionId = 1; isFolder = 1 }

Now I´m struggling with how I can create a subnet within that folder that I´m just ceated as I´m not able to get the Id of this folder.

When I go back to the GUI and get the Id of that folder from the URL and type 'Get-PhpIPamSubnet -Id xxx' nothing is returned. When using the Id of a subnet the subnet is returned.

In addition Get-PhpIpamAllSubnets does not return any subnets/folders.

Am I´m doing anything wrong here?

Thanks
Martin

@yoke88
Copy link
Owner

yoke88 commented Sep 29, 2022

try below code to get all subnets

Invoke-PhpIpamExecute -method get -controller subnets 

# or
Invoke-PhpIpamExecute -method get -controller subnets -identifiers @("all")

@MartinDoed
Copy link
Author

Thanks for your quick response - it was helpful.

With these lines of code I can get the information I need and procede to create subnets in this newly created folder:

$allFolders= Invoke-PhpIpamExecute -method get -controller folders
$folder = $allFolders.data | Where-Object { $_.description -like "Test" }
$folderId = $folder.id

yoke88 added a commit that referenced this issue Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants