Hi all,
I am looking for a way to create a new IPAM.Subnet, 192.168.3.0 /28, to an existing Group using the RESTful API approach. I have visited the Orion SDK Swagger Doc and learned that there is an endpoint, /CreateSubnetForGroup, to do so. Also, I have created a new Group, "Subnet Group A" and the Group's SubnetId is 100 (checked in the SWQL Studio).
However, I received an HTTP-400 Bad Request response with the message "Hierarchy group with id/name '100' not found" after requesting this endpoint. A similar error happens even if I change the JSON payload hierarchyGroup value from "100" to "Subnet Group A". After some tests, the only available value for the hierarchyGroup value I know is "IP Networks". With this value, I can obtain the HTTP-200 response, and the Subnet is created successfully. However, the Subnet is created in the "IP Networks" group hierarchy but not the "Subnet Group A".
Is there a way to create a subnet in the target Group directly? or how to reposition that subnet from the "IP Networks" group to the "Subnet Group A" using the API approach?
Any help would be appreciated. Thanks.
API Endpoint:
/Invoke/IPAM.SubnetManagement/CreateSubnetForGroup
API Request:
curl -X POST \
'https://localhost:17774/SolarWinds/InformationService/v3/Json/Invoke/IPAM.SubnetManagement/CreateSubnetForGroup' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic 123456789=' \
--data-raw '{
"subnetAddress": "192.168.3.0",
"rawCidr": 28,
"hierarchyGroup": "100"
}'
Group View in the Manage Subnets & IP Addresses page (localhost/.../subnets.aspx) (before subnet creation)
Group View in the Manage Subnets & IP Addresses page (localhost/.../subnets.aspx) (after subnet creation)
