Reply

Trying to create namedacl - returns error with the access_list payload format

New Member
Posts: 1
1346     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."
}
"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

Moderator
Moderator
Posts: 315
1347     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"
		}
	]
}'
Showing results for 
Search instead for 
Did you mean: 

Recommended for You