Good afternoon everyone,
I'm trying to amend an existing access rule to enable logging on it. I read the policy and the rule fine. I get the rule output in a variable called data. Then I amend 'logFiles' field from 'False' to 'True' and try to execute a put request with it as the data. Then I get unprocessable entity error. Can anyone explain why it is?
The FMC version is 6.3, I am using Python 3.
The FMC understands the content type of the request entity and the syntax of the request entity is correct but was unable to process the contained instructions. It is not a 400 (Bad Request) which usually happens when a parameter is wrong on you try to post an entry that already exists. You are doing a put, which is correct. Conclusion: This is not an easy syntax fix. Try to manual make the change on the FMC, and see it you get an error.
This is cool, although it counters the info I gave above which is RFC standard, https://tools.ietf.org/html/rfc4918#section-11.2. In my experience syntax errors return an HTTP 400.
422 Unprocessable Entity– The payload is too large. This will occur when you send a payload greater than 2048000 bytes.
– The payload contains an unprocessable or unreadable entity such as a invalid attribut name or incorrect JSON syntax.
Can you post the JSON that you're sending in the PUT request? I've done this same process and from experience I can tell you that you can't just send back all the data that you got in the GET request. Specifically you have to remove the metadata and links attributes from the get result otherwise you will get this message.
For me, it was an ACP rule action set to BLOCK_WITH_RESET. I believe I copied that exactly form the API Explorer. I simply changed that to BLOCK and the error went away. I haven't re-tested it in a while.