Skip to content

[ISSUE] WebPolicyAPI.web_policy_edit(self, **kwargs) returns 400 Bad Request, no matter the body #458

@yolanv

Description

@yolanv

Description
Calling web_policy_edit() to update a ZCC web policy always results in a 400 (Bad Request), regardless of the approach used.

Reproduction

 from zscaler import ZscalerClient

  config = {
      "clientId": "xxx",
      "clientSecret": "xxx",
      "vanityDomain": "example",
  }

  with ZscalerClient(config) as client:
      policies, resp, err = client.zcc.web_policy.list_by_company(
          query_params={"device_type": "windows"}
      )
      policy = policies[0]

      policy_dict = policy.as_dict()
      policy_dict["policy_extension"]["some_uri_field"] = "https://example.com"
      result, _, err = client.zcc.web_policy.web_policy_edit(**policy_dict)
      print(err)  # 400 Bad Request

Expected behavior
web_policy_edit() should successfully update the policy when passing back a policy retrieved from list_by_company() with modifications.

Is it a regression?
Tested on 1.9.13 and 1.9.14, both have the same issue.

Other Information

  • OS: macOS
  • Version: 1.9.14

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

🚀 Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions