okta / okta-powershell-cli

Powershell CLI for communicating with the Okta API
Other
15 stars 4 forks source link

Add support for retry request for 429 responses #21

Closed laura-rodriguez closed 9 months ago

laura-rodriguez commented 9 months ago

Feature

Provide a global built-in solution, similar to our SDKs, where devs configure MaxRetries and RequestTimeout, so all 429 requests are internally retried using default calculation based on retry headers.

Description

The Okta.PowerShell module uses a built-in retry strategy to automatically retry on 429 errors.

You can configure the following options when using the built-in retry strategy:

Configuration Option Description
RequestTimeout The waiting time in milliseconds for a request to be resolved by the client. Less than or equal to 0 means "no timeout". The default value is $null (None).
MaxRetries The number of times to retry.

Usage

$Config = Get-OktaConfiguration
$Config.MaxRetries = 2
$Config.RequestTimeout = 6000 

# Invoke your commands as usual
$Result = Invoke-OktaListApplications 

What changed?