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

Exceptions when trying to call restart function with correct parameters. #370

Open
itsthekraken opened this issue Jul 10, 2023 · 0 comments

Comments

@itsthekraken
Copy link

itsthekraken commented Jul 10, 2023

When trying to call the object_manager.InfobloxObjectManager(conn).restart_all_services(member=member) function i got the error that i was missing an option:

infoblox_client.exceptions.InfobloxFuncException: Error occurred during function's 'restartservices' call: ref grid/b25lLmNsdXN0ZXIkMA:ANETTA: b'{ "Error": "AdmConDataError: None (IBDataError: IB.Data:'member_order' required)", \n "code": "Client.Ibap.Data", \n "text": "'member_order' required"\n}' [code 400]

I found that the function in the object_manager only provide 2 options to the call but needed 2 more,

Original:

def restart_all_services(self, member):
    if not member._ref:
        member.fetch(only_ref=True)
    self.connector.call_func('restartservices', member._ref,
                                {'restart_option': 'RESTART_IF_NEEDED',
                                'service_option': 'ALL'})

Improved:

def restart_all_services(self, member):
    if not member._ref:
        member.fetch(only_ref=True)
    self.connector.call_func('restartservices', member._ref,
                                {'restart_option': 'RESTART_IF_NEEDED',
                                'service_option': 'ALL',
                                'member_order': 'SEQUENTIALLY',
                                'sequential_delay': 10})

For the sequential_delay i chose a arbitrary integer as i do not know if this is seconds for sure. We can also choose Simultaneously as a member order. I propose to give the function a payload variable to let the user decide what is best. and please put the options in a doc string to clarify what is needed.

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

No branches or pull requests

1 participant