Update IP status from Unused to Used Infoblox API

362 views Asked by At

I am working on a script where I am creating VM and assigning available IP address to it given by concerned team. I need to integrate Infoblox API functionality with this

Once the IP is assigned,

  1. I have to find the status of that particular IP address and

    • This part I got the request

https://url/wapi/v2.10.5/ipv4address?ip_address=10.1.0.0

  1. Update the status of that IP from "Unused" to "Used".

Can you please help me with this. Need the API request to modify the status value against IP address

Sample API Response


    [
        {
            "_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTAuMTI0LjExLjIvMA:10.1.1.2",
            "ip_address": "10.1.1.2",
            "is_conflict": false,
            "mac_address": "",
            "names": [],
            "network": "10.1.1.0/7",
            "network_view": "default",
            "objects": [],
            "status": "UNUSED",
            "types": [],
            "usage": []
        }
    ]

I was trying a PUT request like below

```     https://url/wapi/v2.10.5/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5pbmZvLndhcGlhbGlhcw:10.124.11.2/default?_return_fields%2B=aliases&_return_as_object=1" -d '{"status": ["Used"]}'
```

but it is giving error

**{
"Error": "AdmConProtoError: Invalid value for _return_as_object: 1\" -d '{\"status\": [\"Used\"]}'",
"code": "Client.Ibap.Proto",
"text": "Invalid value for _return_as_object: 1\" -d '{\"status\": [\"Used\"]}'"
}**
0

There are 0 answers