Reply

Creating an Extensible attribute type list - API

New Member
Posts: 3
2768     0

hey everyone

I'm one of those who hasn't really had to do anything when it comes to using APIs before and I just need some help if anyone has 5min.

 

NIOS Version: 9.0.1

 

Requirement:

automate creating an extensible attribute that is a list and add all of the list items.

 

Example1 (there are multiple attributes that have a large number of values, hence trying to simplify this, the infoblox GUI is not nice for adding big lists)

Name: Melbourne

Values: suburb1, suburb2, suburb3, suburb4... suburb55

 

 

I tried

curl -k1 -u admin:infoblox -H 'content-type: application/json' -X POST "https://<GM_IP>/wapi/v2.12/extensibleattributedef" -d '{"name": "Melbourne","type"': "ENUM","list_values":[{"value": "suburb1"},{"value": "suburb2"},{"value": "suburb3"}]}'

 

any help would be greatly appreciated

thanks

Kate

 

Re: Creating an Extensible attribute type list - API

New Member
Posts: 3
2768     0

so this works fine in Linux however in Windows (which will be ultimately where it is executed from) I am having issues which I assume is due to the ' and maybe the [ ] - anyone any clue on this?

 

thanks

Kate

Re: Creating an Extensible attribute type list - API

New Member
Posts: 3
2768     0

ok if anyone else has issues with this (or I do again and I forget where I put my info)

 

Command

curl -k1 -u <username:password> -X POST "https://<GM_IP>/wapi/v2.13/extensibleattributedef" -H "Content-Type: application/json" -d @import.txt

 

File import.txt

{
"name": "StateX",
"type": "ENUM",
"list_values": [
{"value":"VIC},
{"value":"QLD"},
{"value":"NSW"},
{"value":"TAS"},
{"value":"NT"},
{"value":"WA"},
{"value":"SA"},
{"value":"ACT"}
] 
}

Re: Creating an Extensible attribute type list - API

Moderator
Moderator
Posts: 321
2768     0

Here is one for creating a list type EA, with list values for each of the 50 states:

curl -k1 -u admin:infoblox -X POST 'https://192.168.1.2/wapi/v2.12/extensibleattributedef' \
-H "Content-Type: application/json" -d \
'{
	"name":"State",
	"type":"ENUM",
	"list_values":
	[
		{"value":"AL"},{"value":"AK"},{"value":"AZ"},{"value":"AR"},{"value":"CA"},
		{"value":"CO"},{"value":"CT"},{"value":"DE"},{"value":"DC"},{"value":"FL"},
		{"value":"GA"},{"value":"HI"},{"value":"ID"},{"value":"IL"},{"value":"IN"},
		{"value":"IA"},{"value":"KS"},{"value":"KY"},{"value":"LA"},{"value":"ME"},
		{"value":"MD"},{"value":"MA"},{"value":"MI"},{"value":"MN"},{"value":"MS"},
		{"value":"MO"},{"value":"MT"},{"value":"NE"},{"value":"NV"},{"value":"NH"},
		{"value":"NJ"},{"value":"NM"},{"value":"NY"},{"value":"NC"},{"value":"ND"},
		{"value":"OH"},{"value":"OK"},{"value":"OR"},{"value":"PA"},{"value":"RI"},
		{"value":"SC"},{"value":"SD"},{"value":"TN"},{"value":"TX"},{"value":"UT"},
		{"value":"VT"},{"value":"VA"},{"value":"WA"},{"value":"WV"},{"value":"WI"},
		{"value":"WY"}
	]
}'

Re: Creating an Extensible attribute type list - API

New Member
Posts: 1
2768     0

How can I modify this to add values to an already existing list type EA?

Re: Creating an Extensible attribute type list - API

Moderator
Moderator
Posts: 321
2768     0

You need to send the complete set in order to modify the set,  unfortunately you can't simply add additional values with API.

 

Re: Creating an Extensible attribute type list - API

New Member
Posts: 1
2768     0

Can you elaborate and what needs to be done? Pehaps provide an example.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You