- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Creating an Extensible attribute type list - API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2024 08:18 PM
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
Solved! Go to Solution.
Re: Creating an Extensible attribute type list - API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 04:20 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 05:22 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2024 06:06 PM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2024 07:09 AM
How can I modify this to add values to an already existing list type EA?
Re: Creating an Extensible attribute type list - API
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 08:41 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 11:47 AM
Can you elaborate and what needs to be done? Pehaps provide an example.