Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Trying to create namedacl - returns error with the access_list payload format
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-09-2024 04:52 PM
758     0
I get this error for the access_list format. I have tried different things . But I am unable to GET access_list or POST it. Appreciate any help on this.
RESPONSE :
{
"Error": "AdmConProtoError: Missing struct type in access_list.",
"code": "Client.Ibap.Proto",
"text": "Missing struct type in access_list."
}
CALL ::
POST : https://gridname/wapi/v2.13.1/namedacl
{
"name": "hello1",
"access_list" : [
{
"address": "22.22.22.22/24",
"permission":"ALLOW"
},
{
"address": "23.22.22.22/24",
"permission":"ALLOW"
}
]
}
Re: Trying to create namedacl - returns error with the access_list payload format
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2024 07:26 AM
758     0
try this call to get a list of all the Named ACLs and their entries:
curl -k -u admin:infoblox -X GET 'https://192.168.1.2/wapi/v2.12/namedacl?_return_fields%2b=access_list,comment'
That should give you a good example of what an ACL entry struct looks like, and from that you should be able build the JSON to create a new one or modify an existing one.
For your example I had to change the addresses to work with the netmask. ( i could have also changed the netmask to /32 ). Here's what it might look like:
curl -k1 -u admin:infoblox -X POST 'https://192.168.1.2/wapi/v2.12/namedacl' \ -H "Content-Type: application/json" -d \ '{ "name": "hello1", "access_list" : [ { "_struct": "addressac", "address": "22.22.22.0/24", "permission":"ALLOW" }, { "_struct": "addressac", "address": "23.22.22.0/24", "permission":"ALLOW" } ] }'