Skip to content

Commit

Permalink
Change api url for fetching time machine using name to get complete i…
Browse files Browse the repository at this point in the history
…nfo same as uuid
  • Loading branch information
bhati-pradeep committed Oct 16, 2023
1 parent d0dfb22 commit 1501ab7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions plugins/module_utils/ndb/time_machines.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ def get_time_machine(self, uuid=None, name=None, query=None):
if uuid:
resp = self.read(uuid=uuid, query=query)
elif name:
endpoint = "{0}/{1}".format("name", name)
resp = self.read(endpoint=endpoint, query=query)
if not query:
query = {}
query["vaue_type"] = "name"
query["value"] = name
resp = self.read(query=query)
if isinstance(resp, list):
if not resp:
return None, "Time machine with name {0} not found".format(name)
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ntnx_ndb_time_machines_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def get_time_machine(module, result):
resp, err = tm.get_time_machine(uuid=uuid, name=name, query=query_params)
if err:
result["error"] = err
module.fail_json(msg="Failed fetching sla info", **result)
module.fail_json(msg="Failed fetching time machine info", **result)
result["response"] = resp


Expand Down

0 comments on commit 1501ab7

Please sign in to comment.