Reply
Highlighted

delete an IP address using REST API

tannaalok
New Member
Posts: 0
3111     0

 

My setup is Infoblox 8.0.5-351775 . I am trying to delete an IP address using REST API and I am receiving below error message. The user credentials do have write permission; with the same user credentials, I am able to delete the IP address manually using the Infoblox UI interface. 

 

DEBUG:XXXXXX:https://xx.xxx.xx.xx:443 "DELETE /wapi/v2.0/record:host/xxx:sss.com/defualt HTTP/1.1" 400 None

 

Error": "AdmConDataError: None (IBDataConflicError: IB.Data.Conflict:write permission for the resource record 'xxx.x.com' is required for this operation.)",

"code": "Client.Ibap.Data.Conflict",

"text":"write permission for the resource record 'xxx.x.com' is required for this operation."

 

 

Re: delete an IP address using REST API

Adviser
Posts: 75
3112     0

Hello,

 

You need to pass the object reference for the DELETE operation. Using a GET call, you can first get the object reference of your host record.

 

curl -k -u admin:Infoblox -X GET "https://127.0.0.1/wapi/v2.7/record:host?name=host1.test.com&_return_as_object=1"

Also looking at your WAPI, it seems to delete the host record. If you just want to delete the IP address of a host record, you need to make a PUT call as below. (Replace the object reference and IP address to be deleted that are highlighted below in bold)

curl -k -u admin:Infoblox -H 'content-type: application/json' -X PUT "https://127.0.0.1/wapi/v2.7/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS50ZXN0Lmhvc3Qx:host1.test.com/default?_return_fields%2B=ipv4addrs&_return_as_object=1" -d '{"ipv4addrs-":[{"ipv4addr":"192.168.1.21"}]}'

However if you did intend to delete the host record, you can do so as below. (Replace the object reference highlighted in bold)

curl -k -u admin:Infoblox -H 'content-type: application/json' -X DELETE "https://127.0.0.1/wapi/v2.7/record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmNvbS5pbmZvLmhvc3Qx:host1.info.com/default?_return_as_object=1"

Re: delete an IP address using REST API

biharimukund
Techie
Posts: 1
3112     0

running above commands give below error:

{ "Error": "AdmConProtoError: Unknown argument/field: 'ipv4addrs'",

  "code": "Client.Ibap.Proto",

  "text": "Unknown argument/field: 'ipv4addrs'"

Re: delete an IP address using REST API

Adviser
Posts: 75
3112     0

Hi,

 

Could you please paste the actual curl command you are trying out?

 

Thanks and regards,

Krishna Vasudevan

Showing results for 
Search instead for 
Do you mean 

Recommended for You