diff --git a/module_utils/decort_utils.py b/module_utils/decort_utils.py index 5bd1911..15845cc 100644 --- a/module_utils/decort_utils.py +++ b/module_utils/decort_utils.py @@ -2004,21 +2004,44 @@ class DecortController(object): self.result['changed'] = True return - def account_find(self, account_name, account_id=0, + def account_find(self, account_name: str, account_id=0, resource_consumption=False, resource_groups_params: None | dict = None, computes_params: None | dict = None, fail_if_not_found=False): - """Find cloud account specified by the name and return facts about the account. Knowing account is - required for certain cloud resource management tasks (e.g. creating new RG). - - @param (string) account_name: name of the account to find. Pass empty string if you want to - find account by ID and make sure you specifit posisite arg_account_id. - @param (int) ccount_id: ID of the account to find. If arg_account_name is empty string, then - arg_account_id must be positive, and method will look for account by the specified ID. - - Returns non zero account ID and a dictionary with account details on success, 0 and empty - dictionary otherwise. + """ + Find account specified by account ID or name and return + a turple with account ID and account info dict. + + @param (string) account_name: name of the account to find. + Pass empty string if you want to find account by ID. + + @param (int) account_id: ID of the account to find. + + @param (bool) resource_consumption: If `True` is specified, + then the method `account_resource_consumption` + will be called passing founded account ID and result of + the call will be added to + account info dict (key `resource_consumption`). + + @param (None | dict) resource_groups_params: If dict is + specified, then the method `account_resource_groups` + will be called passing founded account ID + and `**resource_groups_params`. Result of the call will + be added to account info dict (key `resource_groups`). + + @param (None | dict) computes_params: If dict is + specified, then the method `account_computes` + will be called passing founded account ID + and `**computes_params`. Result of the call will + be added to account info dict (key `computes`). + + @param (bool) fail_if_not_found: If `True` is specified, then + the method `self.amodule.fail_json(**self.result)` will be + called if account is not found. + + Returns non zero account ID and account info dict on success, + 0 and empty dict otherwise (if `fail_if_not_found=False`). """ self.result['waypoints'] = "{} -> {}".format(self.result['waypoints'], "account_find")