question

vn16 avatar image
0 Likes"
vn16 asked

How do I place a rule between two existing rules from the API?

Currently, whenever I create a new rule from the Fortigate API, it automatically ends up at the bottom. Is there a way that I can tell the API that I want the FortiGate to put the new rule at the top or in between two different rules?

API
10 |600

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

·
justinlum avatar image
0 Likes"
justinlum answered

Hi vn16,

You can use the CMDB API's "move" action for this:

PUT https://<ip>/api/v2/cmdb/firewall/policy/<POLICYID_A>?action=move&before=<POLICYID_B>

This will move <POLICYID_A> before <POLICYID_B>.

Let me know if you have any further questions.

Regards,

Justin

10 |600

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Welcome to FortiAnswers

FortiAnswers is the space dedicated to FortiSASE and FortiOS questions and suggestions.

  • Please review the Community guidelines
  • If you are a moderator, please refer to the Moderation guidelines
  • If something in the above guidelines is unclear, please post your question to the Community Feedback space or the Moderators' space