Reply
Highlighted
Accepted Solution

How to decommission an IP using REST API call ?

aadil7799
Techie
Posts: 3
2734     0

Can ayone help me by providing a logic for making the the used IP in a CIRD to unused ?

 

Please advice.

 

Thanks..!!

Re: How to decommission an IP using REST API call ?

MRichard Community Manager
Community Manager
Posts: 101
2735     0

You ned to identify the reference of the IP address first.  For example this search will return a list of IP addresses, their extensible attributes, and the reference to any objects, leases, etc. attached to that IP address.

 

curl -k1 -u admin:infoblox -X GET 'https://192.168.1.2/wapi/v1.2/ipv4address' -d 'network=172.16.123.0/24' -d '_return_fields%2b=extattrs'

 

A set of results will look like this:  (with the important part in bold)

 

[
    {
        ...
    }
    {
        "_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTAuOS4xNi4xMC8w:172.16.123.10",
        "extattrs": {},
        "ip_address": "172.16.123.10",
        "is_conflict": false,
        "mac_address": "",
        "names": [
            "test.example.org"
        ],
        "network": "172.16.123.0/24",
        "network_view": "default",
        "objects": [
            "record:host/ZG5zLmhvc3QkLl9kZWZhdWx0Lm5ldHdvcmsucmljaGFyZC50ZXN0:test.example.org/Internal"
        ],
        "status": "USED",
        "types": [
            "HOST"
        ],
        "usage": [
            "DNS"
        ]
    },
    {
        ...
    }
]

 

To reclaim the IP address and delete all records associated with that address, perform a delete for that IP address's object reference:

 

curl -k1 -u admin:infoblox -X  DELETE 'https://192.168.1.2/wapi/v1.2/ipv4address/Li5pcHY0X2FkZHJlc3MkMTAuOS4xNi4xMC8w:172.16.123.10'

 

 

Re: How to decommission an IP using REST API call ?

aadil7799
Techie
Posts: 3
2735     0

Thanks for the reply..!!!

 

Delete will make the used IP as unused. And it will not delete the IP  address from the subnet.

 

This is my understanding.. correct..??

Re: How to decommission an IP using REST API call ?

MRichard Community Manager
Community Manager
Posts: 101
2735     0

That's correct, IP addresses cannot be deleted.  They're not a true object, even though they act like it sometimes.  They're a component of the network where they reside.

Showing results for 
Search instead for 
Do you mean 

Recommended for You