Disclaimer: I am a network engineer and am very new to JSON, APIs and any sort of programming. I’ve been able to utilize postman to great success thus far but I am hitting a brick wall.
Here’s an outline with best practices for making your inquiry.
My question: Is there a way to write data that is unique and skip over data that already exists in the destination?
Details (like screenshots):
So I am running a POST request that adds an array of IP addresses and fqdns to our corporate firewalls. I keep getting this error because the device in question already has a lot of the IPs and FQDNs added to it, its just missing a few key ones. It is totally out of the question to delete the current exceptions (one going forward that just isn’t scalable) and this is a core location that our entire network depends on.
Some additional details: I’ve noticed that it always stops at the first set of data (as I said most of the data is already in place, its missing just a few items).
My question: Is it possible to skip, move past or ignore the already duplicate data in the POST request so that the unique data gets written??
{
“status”: {
“success”: false,
“cli”: {
“mode”: “config_mode”,
“depth”: 1,
“command”: “address-object fqdn W-FQDN-M365-outlook.office.com”,
“configuring”: true,
“pending_config”: false,
“restart_required”: “FALSE”
},
“info”: [
{
“level”: “error”,
“code”: “E_EXISTS”,
“message”: “Already exists.”
}
]
}
}
Example snippet of the array:
{
“address_objects”: [
{
“fqdn”: {
“name”: “W-FQDN-M365-outlook.office.com”,
“domain”: “outlook.office.com”,
“zone”: “WAN”,
“dns_ttl”: 0
}
},
{
- this continues on but there are hundreds of objects in the array.
I’ve already tried: Not much, like I said I am new to all this
Thanks in advance for all your help!