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

Accept and pass kwargs to _api.get() #665

Closed
efojs opened this issue Jan 17, 2023 · 1 comment
Closed

Accept and pass kwargs to _api.get() #665

efojs opened this issue Jan 17, 2023 · 1 comment
Labels
enhancement New features/functionality

Comments

@efojs
Copy link

efojs commented Jan 17, 2023

I get 500 sometimes when requesting /assets/<uuid>.

Error message recommends to retry: "Please wait a moment and try your request again"
I want to retry by passing retry_on to RESTfly's APISession._req:

retry_codes = kwargs.pop('retry_on', []).

via

tenableio.assets.details(uuid, retry_on=[500])

But AssetsAPI.details() accepts only uuid:

def details(self, uuid):

Would be great to accept and pass kwargs in all methods with return self._api.get()

Or is there a reason that I don't see why kwargs are not passed?

@efojs efojs changed the title Accept and pass kwargs to _api.get() in Accept and pass kwargs to _api.get() Jan 17, 2023
@aseemsavio aseemsavio added the enhancement New features/functionality label Jan 18, 2023
@SteveMcGrath
Copy link
Contributor

Note, that if you want to have a specific exception type retried, then you can always modify the class retry like so:

from restfly.errors import NotFoundError

NotFoundError.retryable = True

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features/functionality
Projects
None yet
Development

No branches or pull requests

3 participants