Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No argument for action change in zpa.policies.update_rule #134

Closed
EddyIskandar opened this issue Aug 15, 2022 · 3 comments
Closed

No argument for action change in zpa.policies.update_rule #134

EddyIskandar opened this issue Aug 15, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@EddyIskandar
Copy link

In zpa.policies.update_rule, there is not argument to change the action of the rule. For example, for access rule, the action is only allow or deny, if user creates a rule that he/she wants to change the action at a later time, there is no argument for this in the function.

@EddyIskandar EddyIskandar added the bug Something isn't working label Aug 15, 2022
@mitchos
Copy link
Owner

mitchos commented Aug 15, 2022

Hi @EddyIskandar thanks for raising this.

I took a look and tried to replicate the issue but I don't seem to have any problems changing an access rule action.

Just to give you some context, I made a design decision to have a single method that covered updating access, timeout and client forwarding rules. I made the decision because if I had a separate method for each then they would essentially be a duplicate with some minor modifications for each rule type (access, timeout, client forwarding).

As a consequence, I admit in hindsight I have been a bit lazy documenting the zpa.policies.update_rule() method. In practicality, kwargs can contain any of the updateable params from either:

  • zpa.policies.add_access_rule(),
  • zpa.policies.add_timeout_rule()
  • zpa.policies.add_client_forwarding_rule()

In testing, I created an access rule and used the following code to update the action:

zpa.policies.update_rule("access", "<Rule ID>", action="DENY")

This worked without issue despite not being listed as a possible kwarg.

Can you please confirm that the functionality works and that the issue is around documentation? Or have I missed the point entirely here and you can you please provide more info? Thanks!

@EddyIskandar
Copy link
Author

EddyIskandar commented Aug 15, 2022 via email

@mitchos
Copy link
Owner

mitchos commented Aug 15, 2022

Great to hear we got you there in the end @EddyIskandar!

I'm going to keep this issue open until I've updated the documentation in the next release.

Please don't hesitate if you bump into any other issues, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants