- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- How do you remove an IP Address from host using AP...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How do you remove an IP Address from host using API
Hey,
Has anyone found a way where when you have an object with both an IPv4 & IPv6 address and you want to remove/clear one of those, how to do this in the Web API?
I have tried multiple different JSON values like null, "" and specifying the IP you want to keep in ip-address field, and a heap of others but it either processes the request but the result is the IP you are trying to clear is still there, or it complains the the address given is not valid.
Any ideas?
Regards
Tim
- Labels:
-
Object Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Robert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Robert,
Did you try it ?
It will not delete IPv4 (or IPv6), it will just override it with desired value. I didnt find a way how to delete it using "set host".
But using "dbedit" it is working like a charm:
dbeditmodify network_objects HOST_NAME ipaddr update HOST_NAMEquit
or in case you need to delete IPv6:
dbeditmodify network_objects HOST_NAME ipaddr6 update HOST_NAMEquit
Please be aware, that after ipaddr or ipaddr6 there is one space character.
Jozko Mrkvicka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Robert that is what I am using but do matter what you post in those fields it will never clear them. As Jozko said all you can do is change it to a different IP not remove one completely.
Thanks Jozko, thought this may be the case. Was just something that came up while testing new .NET library I am writing and just wanted to make sure there wasn't a way to do it using API. I will just mark it for now and come back to it when the API is updated to allow this.
Thanks
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Tim,
I'm back at work this morning and verified this on my machine.
I've to admit that I was surprised to find out that Juzko was correct. The "set-host" command doesn't clear field values.
This is a bug in API and will be fixed for the next version.
Sorry for inconvenience.
Robert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Robert,
Thanks for update. Just so you know, my testing showed, it seems the same thing happens in NAT settings if you would like to fix it there as well.
Regards
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No problem Tim.
I've set a development task to go over all API commands and verify the correct behaviour.
Robert.
