It would be great if we could modify these options to customize at least the ExpectedStatusCodes and RetryFunc in some scenarios. The default retryCheck returns true for 5xx responses, but for services like managed HSM, we should not retry on a 503 status code due to capacity check failure.
Since the SDK method signatures are defined and should not change, one way to pass custom information is through the ctx parameter. We can then apply them during the NewRequest method.
Is there an existing issue for this?
Community Note
Currently, the RequestOptions are generated by Pandora and cannot be customized by the method caller. For example, see managedhsms/method_createorupdate.go#L25-L34.
It would be great if we could modify these options to customize at least the
ExpectedStatusCodes
andRetryFunc
in some scenarios. The default retryCheck returns true for 5xx responses, but for services like managed HSM, we should not retry on a 503 status code due to capacity check failure.Proposal
Since the SDK method signatures are defined and should not change, one way to pass custom information is through the
ctx
parameter. We can then apply them during the NewRequest method.If this looks reasonable and acceptable, I'd be happy to submit a PR to add this feature.
Service Name
sdk
API Versions Required
N/A
References
No response