Skip to main content
mrashid
Staff
Staff
November 6, 2024

Technical Tip: How to set a specific policy installation target in a policy package through JSON API

  • November 6, 2024
  • 0 replies
  • 784 views
Description This article describes how to configure installation target for a specific policy in a policy package using JSON API.
Scope FortiManager
Solution

Solution:

To add a device under a specific policy installation target, use the following API syntax:


{
"session": "{{session}}",
"id": 1,
"method": "add",
"params": [
{
"data": [
{
"name": "<FGT Name>",
"vdom": "<vdom name>"
}
],
"url": "/pm/config/adom/<adom>/pkg/<pkg name>/firewall/policy/<id>/scope member"
}
]


}

To append to existing members, the following API syntax can be used.

{
"session": "{{session}}",
"id": 1,
"method": "set",
"params": [
{
"data": [
{
"name": "<FGT Name>",
"vdom": "<vdom name>"
}
],
"url": "/pm/config/adom/<adom>/pkg/<pkg name>/firewall/policy/<id>/scope member"
}
]


}

 

Note: Replace FortiGate Name, VDOM name, DOM, pkg name and ID (policy ID) with actual values or variables.

 

Related documents: