Skip to content

[FEATURE] Ability to not retry requests that are greater than X amount of seconds #303

Open
@jacob-white-simplisafe

Description

@jacob-white-simplisafe

Problem Statement
We are currently using the ZCC API to get service status for all our devices with zcc.devices.download_service_status and are running into issues with the rate limit for this endpoint. When we exceed the rate limit for this endpoint, we will see - zscaler-sdk-python - request_executor - INFO - Hit rate limit or retryable status 429. Retrying request in 593.0 seconds.. This is a problem as we need to return a response in 1 minute. We would like to be able to set a max retry time for our requests and be able to catch an error if the rate limit is too many seconds.

Proposed Solution

with ZscalerClient(
            config={
                "maxRetrySeconds": "50"
            }
        ) as client:
      try:
         results = client.zcc.devices.list_device()
      except zscaler.RetryTooLong:
         print("Retry time is too long.")

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

🚀 Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions