You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay, this one is a bit terrible - it's not that you are doing anything wrong, it's just that the FMG API in this case formats the requirement to move the policy not standard. So you have to use the free_form method instead of move for this sort of function. So, first I'll show you how you need to format the call (if you were to be doing it in Postman or something). It would look like this:
Notice that there is no "data" attribute and then a dictionary/hash like there normally is for all other calls. WEIRD RIGHT?!!! Well, I know - it's just not standard. I have complained. In any case to fix your issue NOW, this is all you need to do. If I want to move Policy ID 2 AFTER Policy ID 1 I would write this:
Hi
i have problem to move a rule above or after in a policy package.
data1 = {
"option": "after",
"target": "2002",
}
movpolicy = fmg_instance.move('/pm/config/adom/DEV/pkg/default/firewall/policy/2000', **data1)
print(movpolicy)
that is my statement
but i always receive the folllowing error:
(-7, {'status': {'code': -7, 'message': 'Invalid option'}, 'url': '/pm/config/adom/DEV/pkg/default/firewall/policy/2000'})
that is the debug output on the fmg itself
2020-01-26 09:22:31 { "client": "/usr/local/apache2/bin/httpd:3826", "id": 3, "method": "move", "params": [{ "data": { "option": "after", "target": "2002"}, "url": "/pm/config/adom/DEV/pkg/default/firewall/policy/2000", "session": "JIWaOFrcxZI7r+l4j3ctazebq6DXjqRz/WVCez7XdtQklZOG/xRufvmlrwVhwy0lPjAu9mRw+jGWO19WNT0N+B9Drff9PW5E", "src": "XXXX"}
2020-01-26 09:22:31 Request:
2020-01-26 09:22:31 { "client": "/usr/local/apache2/bin/httpd:3826", "id": 3, "method": "move", "params": [{ "data": { "option": "after", "target": "2002"}, "target start": 2, "url": "/pm/config/adom/DEV/pkg/default/firewall/policy/2000", "session": "JIWaOFrcxZI7r+l4j3ctazebq6DXjqRz/WVCez7XdtQklZOG/xRufvmlrwVhwy0lPjAu9mRw+jGWO19WNT0N+B9Drff9PW5E", "src": "XXXX"}
2020-01-26 09:22:31 Chkperm Response:
2020-01-26 09:22:31 { "id": 3, "result": [{ "status": { "code": 0, "message": "OK"}, "url": "/pm/config/adom/DEV/pkg/default/firewall/policy/2000"}], "session": 48717}
2020-01-26 09:22:31 Response:
2020-01-26 09:22:31 { "id": 3, "result": [{ "status": { "code": -7, "message": "Invalid option"}, "url": "/pm/config/adom/DEV/pkg/default/firewall/policy/2000"}]}2020-01-26 09:22:31
I hope you can help me out.
thx in advance
The text was updated successfully, but these errors were encountered: