- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Function next_available_network is not valid for this object(NetworkContainer)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
07-16-2015 02:23 PM
Hi,
I am trying to execute function next_available_network on a NetworkContainer. But I am getting this error
{ "Error": "AdmConProtoError: Function next_available_network is not valid for this object",
"code": "Client.Ibap.Proto",
"text": "Function next_available_network is not valid for this object"
}
When I try to execute this on network uri with NetworkContainer reference, it fails with
{ "Error": "AdmConDataError: .com.infoblox.dns.network_container has no member common_properties",
"code": "Client.Ibap.Data",
"text": ".com.infoblox.dns.network_container has no member common_properties"
}
Can someone show me the sample curl command to execute next_available_network function for NetworkContainer ?
Thanks
Imtiaz
Re: Function next_available_network is not valid for this object(NetworkContainer)
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
09-10-2015 03:13 PM - edited 09-10-2015 03:16 PM
Hi IAhmad, there are two common use cases for this function:
FIRST SCENARIO:
If you want a list of potential available networks with a given CIDR inside a network container, then this is a two-step process, where you first must get the reference of the network container where you want to create the next available network:
curl -k -u admin -X GET https://jfigueira-demo/wapi/v1.4.1/networkcontainer Enter host password for user 'admin': [ { "_ref": "networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDEwLjAuMC4wLzgvMA:10.0.0.0/8/default", "network": "10.0.0.0/8", "network_view": "default" }, { "_ref": "networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDEwLjEwLjAuMC8xNi8w:10.10.0.0/16/default", "network": "10.10.0.0/16", "network_view": "default" }, { "_ref": "networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDEwLjEwLjEyOC4wLzE3LzA:10.10.128.0/17/default", "network": "10.10.128.0/17", "network_view": "default" }, { "_ref": "networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDEwLjk2LjAuMC8xMS8w:10.96.0.0/11/default", "network": "10.96.0.0/11", "network_view": "default" }, { "_ref": "networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDE3Mi4xNi4wLjAvMTYvMA:172.16.0.0/16/default", "network": "172.16.0.0/16", "network_view": "default" }, { "_ref": "networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDE3Mi4xNy4wLjAvMTYvMA:172.17.0.0/16/default", "network": "172.17.0.0/16", "network_view": "default" } ]
Then if, for example, we pick the first container found which is the 10/8 container, we can use a POST call to find the next available network:
curl -k -u admin -X POST https://jfigueira-demo/wapi/v1.4.1/networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDEwLjAuMC4wLzvMA:10.0.0.0/8/default?_function=next_available_network -H "Content-Type:application/json" -d '{"num": 1,"cidr": 24}' Enter host password for user 'admin': { "networks": [ "10.0.3.0/24", "10.0.4.0/24", "10.0.5.0/24", "10.0.6.0/24", "10.0.7.0/24" ] }
SECOND SCENARIO:
If you want to actually create the network(s) you will have to do this a little bit differently.
Please note that this requires WAPI version 1.5 at a minimum, and you will receive the reference of the newly-created network (it would only work with one network at a time):
curl -k -u admin -X POST https://jfigueira-demo/wapi/v1.5/network -H "Content-Type:application/json" -d '{"network":"func:nextavailablenetwork:10.0.0.0/8,default,24"}' Enter host password for user 'admin': "network/ZG5zLm5ldHdvcmskMTAuMC42LjAvMjQvMA:10.0.6.0/24/default"
I hope this helps!
Re: Function next_available_network is not valid for this object(NetworkContainer)
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
04-28-2016 09:32 AM - edited 04-28-2016 09:46 AM
To be deleted