requests do not apply #521
Replies: 1 comment 5 replies
-
This topic can get pretty complex but to answer simply, the 'Applies immediately' attribute in the documentation is primarily intended for endpoints that interact with the pfSense configuration. It specifies whether the pfSense configuration is only written to the configuration and must be applied later by calling a separate 'apply' endpoint, or if it is applied on the backend as soon as it's written to configuration. This is intended to allow the same behavior as the 'Apply changes' button in the webConfigurator. For example, with firewall rules, you can continue to create more rules and but the rules will not be applied on the backend until that 'Apply changes' button in the UI is clicked. The same behavior exists in the REST API. You can create and/or modify as many firewall rules as you'd like but the changes do not apply immediately until you call the /api/v2/firewall/apply endpoint. There is also the apply control parameter which changes the behavior to always apply the change automatically by setting This behavior is briefly mentioned in the apply control parameter description, but there is probably some documentation adjustments that need to be made to make this behavior more clear. I can work on some enhanced documentation around this. As for the API call you're making, the 'Applies immediately' attribute isn't really applicable because it does not write anything to the configuration. However, the shutdown is not being performed in your case because the |
Beta Was this translation helpful? Give feedback.
-
Hello,
I probably have a misunderstanding of the documentation, but the POST requests I send are not being applied on pfSense. However, I am getting a "200" status code in response. To keep it simple, I tested the request /api/v2/diagnostics/halt_system from https://mypfsense/api/v2/documentation#/ and it didn't work, which is normal because the API REST details state "Applies immediately: No". I also tested from a Python script:
The response code is "200" but pfSense does not shut down.
How can I apply the request?
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions