cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3138
Views
20
Helpful
10
Replies

Comments in access policy rules

tbarton
Level 1
Level 1

I've just begun using the REST API for FMC Version: 6.2.0 to provision access policy rules into a Firepower. This has been a bit of a guessing game, because the API Explorer doesn't seem to cover rules, much less proper JSON for creating them.  So far, I've had good luck creating all aspects of the rules, with one small hitch. I can't seem to figure out how to add comments. Could someone paste the appropriate JSON? Certain other aspects of the rule, for instance the id, are auto-generated by the system and must be left out of the POST. Thinking this might be the case with comments; I've tried leaving out the timestamp, user, etc from inside the comment history, but this doesn't seem to help.

Best regards and thanks in advance for any assistance.

10 Replies 10

tbarton
Level 1
Level 1

Is there anything that I could do to clarify the problem I'm having?

Hello,

Using JSON has been a challenge for me as well. I do not have an answer for you as I am trying to figure out how to  create and load objects and rules using this method.

Is there any code that you could share? I have to recreate about 500 rules that the SF ASA conversion utility did not convert.

Thanks very much

How's your java? I might have some code that I could share, but it wouldn't be helpful unless you were pretty fluent.

aniortegr
Level 1
Level 1

Exactly the same for me. Unable to add a comment on an accessrule via REST\API

I've seen the "commentHistoryList" but it doesn't seem to add the comment...

Anyone have an idea how to do this ?

Thanks.

Oliver Kaiser
Level 7
Level 7

I had to reverse engineer the java code used for the rest api to find this out... been struggling a few months back with the same issue.

From what I have found you need to have a dictionary named 'newComments', I have not found any way to update 'commentHistoryList' and had to delete the commentHistoryList and add 'newComments' if I wanted to add/update a rule that had comments.

Hope that helps. :)

Could you post a JSON example?

I have attached an example to this with the last section of the access rule showing the newComment field.

In the 6.2.1 release of Firepower Management Center the "example" button for POST operations in the access rule section of API Explorer now contains this same example.

Regards,

Neil

*hint* *hint* feature request...

remove newComments and make commentHistoryList editable. :)

I'm attempting to add a comment by modifying an existing rule using a PUT.  JSON is as follows:

 

{  "newComments": [
    "comment1",
    "comment2"
] }

 

which returns the following:

 

"Request UUID and data does not match."

 

Does anyone know what is needed here if doing a PUT?  I've tried adding in other portions such as name and type, but it isn't taking.

Figured it out - the content requires the ID to be passed in. Seems redundant to me as it's also used as part of the path in the call as well.
Review Cisco Networking products for a $25 gift card