Skip to content

Commit

Permalink
docs: module return values
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemental committed May 27, 2024
1 parent f170e99 commit b42893e
Showing 1 changed file with 70 additions and 4 deletions.
74 changes: 70 additions & 4 deletions plugins/modules/grafana_contact_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,75 @@
RETURN = """
contact_point:
description: Contact point created or updated by the module.
returned: changed
returned: success
type: complex
contains:
uid:
description: The uid of the contact point.
returned: success
type: str
sample:
- ddmyrs0f74t8hc
name:
description: The name of the contact point.
returned: success
type: str
sample:
- supportmail
type:
description: The type of the contact point.
returned: success
type: str
sample:
- email
disableResolveMessage:
description: Is the resolve message of the contact point disabled.
returned: success
type: bool
sample:
- false
settings:
description: The type specific settings of the contact point.
returned: success
type: dict
sample:
- addresses: "[email protected]"
singleEmail: false
secureFields:
description: The secure fields config of the contact point.
returned: success
type: dict
diff:
description: Difference between previous and updated contact point.
return: changed
type: dict
contains:
before:
description: Previous contact point.
return: changed
type: complex
sample:
- uid: ddmyrs0f74t8hc
name: supportmail
type: email
disableResolveMessage: false
settings:
addresses: [email protected]
singleEmail: false
secureFields: {}
after:
description: Current contact point.
return: changed
type: complex
sample:
- uid: ddmyrs0f74t8hc
name: supportmail
type: email
disableResolveMessage: true
settings:
addresses: [email protected]
singleEmail: false
secureFields: {}
"""

import json
Expand Down Expand Up @@ -963,7 +1030,6 @@ def grafana_create_contact_point(self, data, payload):
contact_point = json.loads(to_text(r.read()))
return {
"changed": True,
"state": data["state"],
"contact_point": contact_point,
}
else:
Expand All @@ -985,7 +1051,7 @@ def grafana_update_contact_point(self, data, payload):
del contact_point["provenance"]

if self.contact_point == contact_point:
return {"changed": False}
return {"changed": False, "contact_point": contact_point}
else:
return {
"changed": True,
Expand All @@ -1006,7 +1072,7 @@ def grafana_delete_contact_point(self, data):
)

if info["status"] == 202:
return {"state": "absent", "changed": True}
return {"changed": True, "contact_point": contact_point}
elif info["status"] == 404:
return {"changed": False}
else:
Expand Down

0 comments on commit b42893e

Please sign in to comment.