cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
175
Views
0
Helpful
1
Replies

FMC API Move rule to another category/section

VladAndrei
Level 1
Level 1

Hello! 

I am trying to move a rule to a category/section via the API, but I'm not sure how to do it via the PUT endpoint. I have tried this:

PUT with partialUpdate=True with following payload:

{"metadata": {"category":"test_category"}, "id":rule_id}
Response:
code 422, text: Unprocessable Entity - Unrecognized Field 'category' in request payload
 
PUT with partialUpdate=True with following payload:
json_body={"category":"test_category", "id":rule_id}
Response:
code 200, OK
 
But the category is not changed. The rule remains in its original position on the FMC.
 
I have also tried specifying category and automation in the PUT endpoint like so:
api/fmc_config/v1/domain/{domain}/policy/accesspolicies/{policy}/accessrules/{rule_id}?bulk=false&partialUpdate=true&category=test_category
 
but I get status code 400 with the following error: Invalid query parameter for the PUT operation.
 
The only option I could think of is to delete the rule and recreate it with the POST endpoint which allows me to specify category/section, but that would mean the comment history list would be lost.
 
We are using FMC 7.2.4-169
1 Reply 1

Alex Stevenson
Cisco Employee
Cisco Employee

As far as I can tell, moving an existing access control rule to a different category through the Cisco FMC API is not directly supported via a simple API call. The API doesn't provide a straightforward method to change the category of a rule without deleting and recreating it. This would explain the error messages you're receiving: the category field may not be recognized or modifiable through the API for an existing rule.