| Description | This article describes how to Find and Replace an address object used in policy package using JSON API. |
| Scope | FortiManager, Postman. |
| Solution |
The Find and Replace address object (or any ADOM level object) involves three steps:
The following process details how to achieve this:
{ "method": "exec", "params": [ { "url": "cache/search/where/used/start", "data": { "obj": "adom/{{ADOM}}/obj/{{Object_Type}}", "mkey": "{{Object_Find}}", "flags": [ "direct used" ] } } ], "id": "2", "session": "{{session}}", "verbose": 1 }
For example:
The output of this request generates a 'token', which is then used in the next query.
{ "method": "exec", "params": [ { "url": "cache/search/where/used/get/detail", "token": "{{token}}" } ], "id": "1", "session": "{{session}}", "verbose": 1 }
In this example, there is an address object 'Test1' that has been used in two firewall polices in a policy package (as seen in step 2 output). Consequently, two requests are required to replace it with another object, 'Test2'.
{ "method": "update", "params": [ { "url": `pm/config/adom/${adom}/pkg/${policy.package_name}/firewall/policy/${policy.policy_id}`, "used objs": { "from": `obj/${objecttype}/${objectFind}`, "to": [ `${objectReplaceWith}` ] } } ], "id": 3, "session": sessionTokenValue };
Postman Release Notes |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.