- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
The definitive list of REST examples
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-16-2014 11:38 AM - edited 03-15-2017 12:09 PM
A common question we are asked is "Do you have some examples of specific REST calls", or "How can I get started with testing the WAPI?".
The API docs are good if you need the techincal details, but this post hopes to address the overall fundamentals.
The basics:
- use GET to get/search
- use POST to add
- use PUT to modify
- use DELETE to remove
If you want to modify an object, you have to use a GET to read it first.
This will give you the _ref, which will be the URL you use to make the update.
Get a host: GET /wapi/v1.2/record:host?name~=test.com will return: { "result": [ {"_ref": "record:host/ZG5zLmhvc3QkLjEyOC5jb20udGVzdC5nZXJpLnRlc3RfaG9zdA:test_host.test.com/default.GerW", "name": "test_host.test.com",} ], },
To modify a host, you then send a PUT to the _ref url:
PUT /wapi/v2.3/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0Lm9yZy5naC5mb28:foo.gh.org/default Content-Type: application/json {"ipv4addrs": [ { "ipv4addr": "1.1.1.2" } ]}
Note: When making POST or PUT requests, it is easier to send the data as 'application/json' in the body of the message, since it lets you send complex data structures in the payload
Note: There is no '_return_fields=ALL' option, so if you need are particular field returned, you will have to add it manually to your call with a '_return_fields+=myfield'
Now, to the examples:
Search for HOST by name: GET /wapi/v1.2/record:host?name~=my.fqdn.org Search for FixedAddress by MAC GET /wapi/v1.2/fixedaddress?_return_fields%2B=mac&mac=aa:bb:cc:11:22:33 Search for any objects with an IP address GET /wapi/v1.2/ipv4address?status=USED&ip_address=1.1.1.1 Add a HOST POST /wapi/v1.2/record:host Content-Type: application/json { "name":"wapi.test.org", "ipv4addrs":[ { "ipv4addr":"1.1.1.21" } ] } Delete a host ( you need the _ref to the host first ) DELETE /wapi/v1.2/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0Lm9yZy5naC53YXBp Update a host, or change the IP address ( you need the _ref to the host first ) PUT /record:host/ZG5zLmhvc3QkLl9kZWZhdWx0Lm9yZy5naC53YXBp Content-Type: application/json { "ipv4addrs":[ { "ipv4addr":"1.1.1.31" } ] } Add or remove IP addresses from a HOST ( without altering the original list ) Use 'ipv4addrs+' or 'ipv4addrs-' PUT /record:host/ZG5zLmhvc3QkLl9kZWZhdWx0Lm9yZy5naC53YXBp Content-Type: application/json { "ipv4addrs+":[ { "ipv4addr":"2.2.2.22" } { "ipv4addr":"4.4.4.24" } ] } PUT /record:host/ZG5zLmhvc3QkLl9kZWZhdWx0Lm9yZy5naC53YXBp Content-Type: application/json { "ipv4addrs-":[ { "ipv4addr":"3.3.3.33" } ] } Add a HOST with next_available IP address from a network POST /wapi/v1.2/record:host Content-Type: application/json { "name":"wapi.test.org", "ipv4addrs":[ { "ipv4addr":"func:nextavailableip:10.1.1.0/24" } ] } 'func:' syntax also supports these forms: func:nextavailableip:network/ZG54dfgsrDFEFfsfsLzA:10.0.0.0/8/default func:nextavailableip:10.0.0.0/8 func:nextavailableip:10.0.0.0/8,external func:nextavailableip:10.0.0.3-10.0.0.10 OR you can use the longhand form: POST /wapi/v1.2/record:host Content-Type: application/json { "name":"wapi.test.org", "ipv4addrs":[ ipv4addr" : { "_function" : 'next_available_ip' , "_object_field" : 'value' , "_object" : '10.10.10.0/24' , "_parameters" : { "num" : 1, "exclude" : [ '45.0.1.1' , '45.0.1.2' ], } } ] } Add a HOST with next_available IP address from a network using a complex search ( e.g Extensible Attributes ). You need to pass the search criteria in the _object_parameters field not also that '_object' changes from a reference to a type POST /wapi/v1.2/record:host Content-Type: application/json { "name":"wapi.test.org", "ipv4addrs":[ ipv4addr" : { "_function" : 'next_available_ip' , "_object_field" : 'value' , "_object" : 'network' "_object_parameters" : { "*Site" : "Santa Clara" }, "_parameters" : { "num" : 1, "exclude" : [ '45.0.1.1' , '45.0.1.2' ], } } ] } Add a HOST with a fixed address POST /wapi/v1.2/record:host Content-Type: application/json { "name":"wapi.test.org", "ipv4addrs":[ { "ipv4addr":"1.1.1.21", "mac":"aa:bb:cc:11:22:21" } ] } Add a Fixed address POST /wapi/v1.2/fixedaddress Content-Type: application/json { "ipv4addr": "1.1.1.21", "mac": "aa:bb:cc:11:22:21" } Add a Fixed address Reservtion POST /wapi/v1.2/fixedaddress Content-Type: application/json { "ipv4addr": "1.1.1.21", "mac": "00:00:00:00:00:00" } Search for a subnet GET /wapi/v1.2/network?network=1.1.1.0/24 Get Next Available address from a subnet ( you need the _ref to the subnet first ) POST /wapi/v1.2/network/ZG5zLm5ldHdvcmsuMC8yNC83?_function=next_available_ip Content-Type: application/json {"num": 1} Get the next 5 IP addresses ( you need the _ref to the subnet first ) POST /wapi/v1.2/network/ZG5zLm5ldHdvcmsuMC8yNC83?_function=next_available_ip Content-Type: application/json {"num": 5} Get all the addresses (and records) in a subnet GET /wapi/v1.2/ipv4address?network=1.1.1.0/24 Get all the IP addresses in a given range GET /wapi/v1.2/ipv4address?ip_address>=1.1.1.1&ip_address<=1.1.1.10 Search for HOSTS by Extensible Attribute ( prepend '*' to the front of the EA name ) GET /wapi/v1.2/record:host?_return_fields%2B=extattrs&*Floor=3rd Add extensible Attributes to an object PUT /wapi/v1.2/record:host/ZG5zLmhvc.... Content-Type: application/json { "extattrs": { "Site": { "value": "East" } } } Add a HOST with aliases POST /wapi/v1.2/record:host Content-Type: application/json { "name":"wapialiased.test.org", "ipv4addrs":[ { "ipv4addr":"1.1.1.21"} ], "aliases": [ "remote","pointer" ] } Get all the aliases on a host GET /wapi/v1.2/record:host?_return_fields%2B=aliases&name=wapialiased.test.org Remove or modify aliases from a host ( send an enpty alias list, or a new list ) ( you need the _ref to the host first ) PUT /wapi/v1.2/record:host/ZG5zLmhvc3l9kZWZhdWx0Lm9yZy5naC53YXBpYWxpYXNlZA Content-Type: application/json { "aliases": [ ] } Add a CNAME POST /wapi/v1.2/record:cname Content-Type: application/json { "name":"cname.test.org", "canonical" : "wapi.test.org" } DELETE a CNAME ( you need the _ref to the cname first ) DELETE /wapi/v1.2/record:cname/ZG5zLmJpbm... Move a cname to point to a new canonical ( you need the _ref to the cname first ) PUT /wapi/v1.2/record:cname/ZG5zLmJpbmRfY Content-Type: application/json { "canonical" : "wapi-new.test.org" } Add a network or a container ( NIOS will auto create the container if it needs to ) POST /wapi/v1.2/network Content-Type: application/json { "network": "45.0.45.0/24" } Add a network and assign to a member POST /wapi/v1.2/network Content-Type: application/json { "network": "45.0.46.0/24", "members": [ { "_struct": "dhcpmember", "ipv4addr" : "192.168.1.3" } ] } Add a DHCP range POST /wapi/v1.2/range Content-Type: application/json { "start_addr": "45.0.46.20", "end_addr": "45.0.46.101", "server_association_type": "MEMBER" , "member": { "_struct": "dhcpmember", "ipv4addr" : "192.168.1.3" } } Add a DHCP reserved range ( If you don't assign a member, the range just gets created as 'reserved') POST /wapi/v1.2/range Content-Type: application/json { "start_addr": "45.0.46.20", "end_addr": "45.0.46.101", } Add a zone association to a network ( 'is_default' is a BOOLEAN, so you don't quote the word 'true' ) PUT /wapi/v1.2/network/ZG5zLm5l... Content-Type: application/json { "zone_associations": [ { "fqdn": "test.org", "is_default" : true } ] } List the zone_associations on a network GET /wapi/v1.2/network/ZG5zLm5l...?_return_fields%2B=zone_associations Add a zone, of type forward 'forwarding_servers' are the grid members that will forward for that zone POST /wapi/v1.2.1/zone_forward { "fqdn": "foo.com", "forward_to": [ {"address": "1.1.1.1", "name": "ns.foo.com"}, {"address": "1.1.1.2", "name": "ns2.foo.com"}], "forwarding_servers": [ {"name": "infoblox2.localdomain"}, {"name": "infoblox1.localdomain"} ] }' Get grid service status GET /wapi/v1.4/grid POST /wapi/v1.4/grid/b25lLmNsdXN0ZXIkMA:Infoblox?_function=requestrestartservicestatus Content-Type: application/json {"service_option": "All|DNS|DHCP"} Restart services GET /wapi/v1.4/grid POST /wapi/v1.4/grid/b25lLmNsdXN0ZXIkMA:Infoblox?_function=restartservices Content-Type: application/json { "member_order" : "SIMULTANEOUSLY", "service_option": "ALL" } {"service_option": "All|DNS|DHCP"} Export a database POST /wapi/v1.4/fileop?_function=getgriddata Content-Type: application/json {"type": "BACKUP"} GET /http_direct_file_io/... Content-type: application/force-download And remember to remove the stored file via the token POST /wapi/v1.4/fileop?_function=downloadcomplete Content-Type: application/json {"token": "eJydULFuwyAQ3e9...="} Export a CSV file POST /wapi/v1.5/fileop?_function=csv_export Content-Type: application/json {"_object": "record:host"} You will get back a URL for the download, and a token for the download session. you can download the file directly from the URL GET /http_direct_file_io/... Content-type: application/force-download And remember to remove the stored file via the token POST /wapi/v1.4/fileop?_function=downloadcomplete Content-Type: application/json {"token": "eJydULFuwyAQ3e9...="} Export the results of a WAPI call and save the data to disk (Yes, you can cache results ) POST /wapi/v1.5/fileop?_function=read Content-Type: application/json { "_encoding" : "JSON" "_filename" : "allhosts.corp.org.json" "_object" : "record:host" "_return_fields" : "name,extattrs" "zone" : "corp.org" } The file will be in a folder 'wapi_output' in the HTTP file distribution
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2014 01:33 AM
Great post, helped a lot more than the documentation!
Thanks!!!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2014 08:18 AM
Very helpfull !!
but it would be great if properly arrange REST commands are added...
e.g :
For Associating Domain to a Subnet
curl -k -u admin:infoblox -H "Content-Type: application/json" -X PUT https://130.175.209.15/wapi/v1.2.1/network/ZG5zLm5ldHdvcmskMTMwLjE3MS4wLjAvMTYvMA \-d '{ "zone_associations":[{ "fqdn":"aa.eds.com", "is_default":false, "view":"default" }]}'
what if you don't want to use
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2014 09:45 AM
what if you don't want to use curl ?
what if you are using some other client to make the REST calls ?
what if you aren't using a linux shell ?
There is something other than
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-20-2014 02:40 PM
There is something other than Linux?
Good insctructions. Could we get bit more?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2014 07:39 AM
examples of using ibapauth cookie vs always sending credentials
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2014 04:20 PM
My biggest question about this is whether there is some dead-simple / low overhead request that can be used as a throwaway on the first request to get the ibapauth cookie generated? I assume there is no way to get the cookie generated without making some sort of request. There isn't a small, plain file of some sort that could be retrieved like nios_version.txt, is there?
simple request to get a cookie
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2014 04:41 PM
Adding a fixed address
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2014 02:08 AM
Hi,
can someone please give me an example for adding a fixed address with curl?
does using ibapauth to maintain a "session" decrease overhead?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2014 02:15 PM
Have been tempted to test this myself just to get a solid empirical answer, but those who can see inside can probably answer based on how it was designed.
Is there real benefit in decreased overhead if one uses the ibapauth cookie to avoid re-authenticating in a series of requests?
I assume the benefit would be greater if the grid is configured to externally authenticate than if accounts are defined internally to the grid. Right?
Range?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 09:57 AM
How about an example for the RANGE object?
yes, using the cookie saves a
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2014 11:32 AM
yes, using the cookie saves a lot of overhead.
the downside is that because it is an HTTPONLY cookie you can't remove it from the browser. so there is no clean logout.
this has been fixed in WAPI version 1.5 with the '/logout' uri
WAPI Documentation?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2014 05:23 AM
Adding new IP to existing Host Object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2015 03:40 AM
Is there any way to add additional IP to a Host object knowing only the _ref but not knowing the list of existing IP addresses? The below example requires to get all v4 and v6 addresses first as this API call overwrites existing addresses.
Update a host, or change the IP address
( you need the _ref to the host first )
PUT /record:host/ZG5zLmhvc3QkLl9kZWZhdWx0Lm9yZy5naC53YXBp Content-Type: application/json { "ipv4addrs":[ { "ipv4addr":"1.1.1.31" } ] }
Use ipv4addrs+ to add one or more IP addresses to host record
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2015 07:54 AM
If you have an existing host record and you want to add one or more new IP addresses for that host record, you can do that by using the field name 'ipv4addrs+' when you do the HTTP PUT to modify the host record. This does NOT require you to know what the existing IP addresses are for that host. This functionality is documented for WAPI 1.1 (NIOS 6.7) and later, but actually works in WAPI 1.0 (NIOS 6.6) as well.
Here's a working example in Python (with no error checking, obviously):
import requests import sys import json request_params = {'name': 'host1.example.com'} r = requests.get('https://gm.example.com/wapi/v1.0/record:host', params=request_params, auth=('admin', 'infoblox')) host_ref = r.json()[0]['_ref'] request_data = {'ipv4addrs+': [{'ipv4addr': '192.168.201.16'}]} r = requests.put('https://gm.example.com/wapi/v1.0/' + host_ref, data=json.dumps(request_data), auth=('admin', 'infoblox'))
Note that you can add multiple IP addresses by simply including more items in the list:
request_data = {'ipv4addrs+': [{'ipv4addr': '192.168.201.17'}, {'ipv4addr': '192.168.201.18'}]} r = requests.put('https://gm.example.com/wapi/v1.0/' + host_ref, data=json.dumps(request_data), auth=('admin', 'infoblox'))
Finally, note that you can also use the field name 'ipv4addrs-' to remove one or more IP addresses for that host; for example, the following code would remove all the IP addresses added above:
request_data = {'ipv4addrs-': [{'ipv4addr': '192.168.201.16'}, {'ipv4addr': '192.168.201.17'}, {'ipv4addr': '192.168.201.18'}]} r = requests.put('https://gm.example.com/wapi/v1.0/' + host_ref, data=json.dumps(request_data), auth=('admin', 'infoblox'))
All,
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2015 05:19 PM
All,
I've made this thread sticky/featured, so it should remain "a-top" the list. If you haven't read about the upcoming changes to the site, please take a look at this blog: https://community.infoblox.com/blogs/2015/04/01/it-may-be-april-1-no-joke-big-changes-coming-communi...
As we continue to build out the plan for the updates, we want to hear from you. Please comment on the blog so we can continue to track requests. I'll keep the community updated on a weekly blog. "Plan the work, and work the plan..."
Best,
Eric
Top-Level Subnet
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2015 11:10 AM
Listing all subnets within a given subnet
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2015 07:04 AM
I think what you're asking for is as follows: You have a network container, i.e., a subnet that contains other subnets (and that shows up as a folder icon in the Infoblox IPAM view). You would like a list of all subnets that are contained within that network container. So, for example, if 10.0.0.0/8 is a network container, you would like a list of the subnets into which 10.0.0.0/8 has been divided (e.g., 10.1.0.0/16, 10.2.0.0/16, etc.). Note that it is possible that some of these subnets are actually network containers themselves (for example, 10.1.0.0/16 might be further divided into multiple /24 subnets), while some of the subnets are not further divided (for example, 10.2.0.0/16 might be a "leaf" network containing DHCP ranges, etc.).
In the context of the Web API there are network container objects that contain other networks or network containers, and network objects that do not. In order to find out how a given network container is subnetted using the Web API, you have to retrieve the child networks and network containers via two separate searches that reference the parent network container. For example, the following curl command will return all networks (but *not* network containers) within the network container 10.0.0.0/8 :
curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v1.0/network?network_container=10.0.0.0/8'
while the command
curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v1.0/networkcontainer?network_container=10.0.0.0/8'
will return all network containers (but *not* networks) within 10.0.0.0/8.
Canonical
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2015 04:23 PM
Getting a list of all canonical names
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-29-2015 07:16 AM
By "get a list of these" do you mean getting a list of all canonical names pointed to by CNAME records? Canonical names are not stored as a separate database object in the NIOS database. Rather they are simply values stored in the "canonical" field of record:cname objects. So to extract a list of all canonical names you have to first retrieve the list of all record:cname objects and then iterate through that list, extracting the values of the "canonical" field.
Here's an example of how to do that in Python:
# Import the required Python modules. import requests import json import getpass import sys # Set parameters to access the NIOS WAPI. url = 'https://gm.example.com/wapi/v1.0/' id = 'api-test' # Userid with WAPI access valid_cert = True # False if GM uses self-signed certificate # Prompt for the API user password. pw = getpass.getpass('Password for user ' + id + ': ') # Retrieve all CNAME records (up to a max of 5000) in the default DNS view. dns_view = 'default' max_results = -5000 req_params = {'view': dns_view, '_max_results': str(max_results)} r = requests.get(url + 'record:cname', params=req_params, auth=(id, pw), verify=valid_cert) if r.status_code != requests.codes.ok: print r.text exit_msg = 'Error {} finding CNAME records: {}' sys.exit(exit_msg.format(r.status_code, r.reason)) results = r.json() # For each CNAME record keep track of the canonical name pointed # to by that record, by adding the canonical name to a Python set. canonicals = set() for result in results: canonicals.add(result['canonical']) # Sort the resulting set of canonical names and print them. for canonical in sorted(canonicals): print canonical
Recall that a canonical name can be any valid domain name; it does not necessarily have to correspond to a DNS record in your NIOS database. So there is no separate operation to create (or delete) a canonical name; you simply use the canonical name as the value of the "canonical" field when creating a record:cname object.
Change a fixed MAC address
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-30-2015 05:56 AM
Hi,
it is possible to change a fixed MAC address?
Does anyone know how?
Where's the beef?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2015 12:58 PM
Hey all,
I am for a sample for the equlivant for
Infoblox?_function=restartservices
in 1.7.1
When I try:
https://server/wapi/v1.7.1/Infoblox?_function=restartservices
POST Array
(
[member_order] => SEQUENTIALLY
[restart_option] => RESTART_IF_NEEDED
[service_option] => DNS
)
It returns:
{
"Error": "AdmConProtoError: Unknown object type (Infoblox)",
"code": "Client.Ibap.Proto",
"text": "Unknown object type (Infoblox)"
}
How to restart services with WAPI
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2015 01:54 PM
I was able to use the Web API (WAPI version 2.1) to successfully restart services. Based on my testing I believe the key points are as follows:
- You need to do a POST request.
- The URL must reference the object reference for the grid (as obtained from a previous GET request).
- The function name (i.e., "restartservices") and its arguments (e.g., "member_order") must be passed as parameters as part of the URL.
The following example curl command will return the object reference for the grid:
curl --tlsv1 --insecure --user admin:xxxxxx' 'https://gm.example.com/wapi/v2.1/grid
Assuming that the object reference is "grid/b25lLmNsdXN0ZXIkMA:example-grid", the following example curl command will restart services for DNS:
curl --tlsv1 --insecure --user admin:xxxxxx' -X POST 'https://gm.example.com/wapi/v2.1/grid/b25lLmNsdXN0ZXIkMA:example-grid?_function=restartservices&memb...
How to remove a reserved IP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2015 10:22 AM
Removing a host record
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2015 08:47 AM
1. In this case you are using a host record (record:host object) to reserve an IP address, so you need to remove the host record in order to free up the IP address. This is a two-step process: First you need to get the object reference for the host record, using a GET request against a URL like
https://gm.example.com/wapi/v2.1/record:host?name=host1.test.com
For example, a curl command like the following will do this (assuming that you have only a single DNS view or that the name "host1.test.com" is unique across views):
curl --tlsv1 --insecure -user 'admin:infoblox' 'https://gm.example.com/wapi/v2.1/record:host?name=host1.test.com'
The result of this WAPI operation will include a _ref
field with an object reference like the following:
record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5leGFtcGxlLnJlc2VydmVk:host1.test.com/default
You then have to send a DELETE request referencing this object reference, for example as follows:
curl --tlsv1 --insecure --user 'admin:infoblox' -X DELETE 'https://gm.example.com/wapi/v2.1/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5leGFtcGxlLnJlc2VydmVk:ho...
I'll respond to your second question a little later once I have a chance to look at it more closely.
WAPI 1.7.1 Where's the beef?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2015 11:49 AM
Can someone point me to the API documentation for 1.7.1 I can not find it anywhere..
OR... alternatively can someone update The definitive rest examples to include 1.7.1?
OR.. I am looking to search for a record by it's mac address.
https://HOST/wapi/v1.7.1/search?objtype=All&search_string:=00:01:04:FF:A3:01
https://HOST/wapi/v1.7.1/search?objtype=AllNetwork&search_string:=00:01:04:FF:A3:01
https://HOST/wapi/v1.7.1/search?objtype=record:host_ipv4addr&search_string:=00:01:04:FF:A3:01
None of these work.
Thanks
Paul
1.7.1 documentation, and using the search object
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2015 02:42 PM
"Can someone point me to the API documentation for 1.7.1" You can find documentation for your release of NIOS under the help section of the UI. Click on the blue tab in the upper right that has a question mark (?) in a circle, and then in the resulting navigation bar click on the plus sign (+) for "Documentation". It should contain links to HTML versions of four manuals, including the WAPI manual.
"I am looking to search for a record by it's mac address." I was able to do this using the following Curl command on my NIOS 7.1 (WAPI 2.1) system:
curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v1.7.1/search?search_string:=00:80:77:7d:e1:cb'
(In this case the query returned objects relating to a DHCP fixed address I had defined.)
Corrected example for adding a host using next_available_ip
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-24-2015 07:26 AM
The following shows how to add a host record using the next_available_ip function in current (7.x) versions of NIOS; it corrects one of the examples given in the original "Definitive List of REST Examples" above:
curl --tlsv1 --insecure --user 'admin:infoblox' -H "Content-Type: application/json" -X POST https://gm.example.com/wapi/v2.0/record:host -d '{"name": "test.example.com", "ipv4addrs": [{"ipv4addr": {"_object_function": "next_available_ip", "_object": "network", "_object_parameters": {"network": "10.0.0.0/24"}, "_result_field": "ips", "_parameters": {"num": 1, "exclude": ["10.0.0.4"]}}}]}'
A more readable version of the POST body is as follows:
{ "name": "test.example.com", "ipv4addrs": [ { "ipv4addr": { "_object_function": "next_available_ip", "_object": "network", "_object_parameters": {"network": "10.0.0.0/24"}, "_result_field": "ips", "_parameters": { "num": 1, "exclude": ["10.0.0.4"] } } } ] }
Add Permissions
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2015 09:03 AM
infoblox WAPI and .Net integration
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2015 11:10 AM
Hi All,
I have to use the Infoblox WAPI with .Net code in a restful approach.Do we have some examples in .Net ?