Reply
Highlighted

Update Name attribute for a fixed address using infoblox API

Member
Posts: 2
363     0

Hi,

 

I was wandering if anyone can help me use the infoblox API to update the name attribute for a fixed IP adress. 

I know that its possible to update record fo type host, but is there capability in the API to update that name attribute if the record wasnt of type host?

 

MicrosoftTeams-image.png

Highlighted

Re: Update Name attribute for a fixed address using infoblox API

Authority
Posts: 16
364     0

Yes, it is possible to update the 'name' field of the Fixed Address. But beware that 'name' is not the same as a hostname in DNS, it is just a name of the object and it has no impact to DNS resolution. Below I show 3 steps:

 

1. Lookup the fixed address 172.16.4.4, to retrieve the object reference (_ref).

 

$ curl -k -u admin:infoblox -X GET 'https://192.168.2.51/wapi/v2.10.5/fixedaddress?ipv4addr=172.16.4.4'
[
    {
        "_ref": "fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTcyLjE2LjQuNC4wLi4:172.16.4.4/default", 
        "ipv4addr": "172.16.4.4", 
        "network_view": "default"
    }
]

 

2. Use the object reference to perform an update, changing 'name' to "NameTwo".

 

$ curl -k -u admin:infoblox -H 'Content-Type:application/json' \
-X PUT
'https://192.168.2.51/wapi/v2.10.5/fieGVkX2FkZHJlc3MkMTcyLjE2LjQuNC4wLi4:172.16.4.4/default' \ 
--data '{"name":"NameTwo"}'

 

 

3. Lookup the fixed address 172.16.4.4 again with _ref to verify the 'name' field has changed. 

 

$ curl -k -u admin:infoblox -X GET 'https://192.168.2.51/wapi/v2.10.5/fixedaddress?ipv4addr=172.16.4.4&_return_fields%2B=name'
[
    {
        "_ref": "fixedaddress/ZG5zLmZpeGVkX2FkZHJlc3MkMTcyLjE2LjQuNC4wLi4:172.16.4.4/default", 
        "ipv4addr": "172.16.4.4", 
        "name": "NameTwo", 
        "network_view": "default"
    }
]

 

Highlighted

Re: Update Name attribute for a fixed address using infoblox API

Member
Posts: 2
364     0

Thaks heaps for this works like a charm Smiley Happy

Showing results for 
Search instead for 
Did you mean: 

Recommended for You