mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-29 19:50:25 -07:00
p[a-e]*: normalize docs (#9372)
* p[a-e]*: normalize docs * Update plugins/modules/packet_volume.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
d96e56048f
commit
bef82e28a2
17 changed files with 867 additions and 945 deletions
|
@ -8,150 +8,149 @@ from __future__ import absolute_import, division, print_function
|
|||
__metaclass__ = type
|
||||
|
||||
|
||||
DOCUMENTATION = '''
|
||||
|
||||
DOCUMENTATION = r"""
|
||||
module: pagerduty_alert
|
||||
short_description: Trigger, acknowledge or resolve PagerDuty incidents
|
||||
description:
|
||||
- This module will let you trigger, acknowledge or resolve a PagerDuty incident by sending events
|
||||
- This module will let you trigger, acknowledge or resolve a PagerDuty incident by sending events.
|
||||
author:
|
||||
- "Amanpreet Singh (@ApsOps)"
|
||||
- "Xiao Shen (@xshen1)"
|
||||
- "Amanpreet Singh (@ApsOps)"
|
||||
- "Xiao Shen (@xshen1)"
|
||||
requirements:
|
||||
- PagerDuty API access
|
||||
- PagerDuty API access
|
||||
extends_documentation_fragment:
|
||||
- community.general.attributes
|
||||
- community.general.attributes
|
||||
attributes:
|
||||
check_mode:
|
||||
support: full
|
||||
diff_mode:
|
||||
support: none
|
||||
check_mode:
|
||||
support: full
|
||||
diff_mode:
|
||||
support: none
|
||||
options:
|
||||
name:
|
||||
type: str
|
||||
description:
|
||||
- PagerDuty unique subdomain. Obsolete. It is not used with PagerDuty REST v2 API.
|
||||
api_key:
|
||||
type: str
|
||||
description:
|
||||
- The pagerduty API key (readonly access), generated on the pagerduty site.
|
||||
- Required if O(api_version=v1).
|
||||
integration_key:
|
||||
type: str
|
||||
description:
|
||||
- The GUID of one of your 'Generic API' services.
|
||||
- This is the 'integration key' listed on a 'Integrations' tab of PagerDuty service.
|
||||
service_id:
|
||||
type: str
|
||||
description:
|
||||
- ID of PagerDuty service when incidents will be triggered, acknowledged or resolved.
|
||||
- Required if O(api_version=v1).
|
||||
service_key:
|
||||
type: str
|
||||
description:
|
||||
- The GUID of one of your 'Generic API' services. Obsolete. Please use O(integration_key).
|
||||
state:
|
||||
type: str
|
||||
description:
|
||||
- Type of event to be sent.
|
||||
required: true
|
||||
choices:
|
||||
- 'triggered'
|
||||
- 'acknowledged'
|
||||
- 'resolved'
|
||||
api_version:
|
||||
type: str
|
||||
description:
|
||||
- The API version we want to use to run the module.
|
||||
- V1 is more limited with option we can provide to trigger incident.
|
||||
- V2 has more variables for example, O(severity), O(source), O(custom_details), etc.
|
||||
default: 'v1'
|
||||
choices:
|
||||
- 'v1'
|
||||
- 'v2'
|
||||
version_added: 7.4.0
|
||||
client:
|
||||
type: str
|
||||
description:
|
||||
- The name of the monitoring client that is triggering this event.
|
||||
required: false
|
||||
client_url:
|
||||
type: str
|
||||
description:
|
||||
- The URL of the monitoring client that is triggering this event.
|
||||
required: false
|
||||
component:
|
||||
type: str
|
||||
description:
|
||||
- Component of the source machine that is responsible for the event, for example C(mysql) or C(eth0).
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
custom_details:
|
||||
type: dict
|
||||
description:
|
||||
- Additional details about the event and affected system.
|
||||
- A dictionary with custom keys and values.
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
desc:
|
||||
type: str
|
||||
description:
|
||||
- For O(state=triggered) - Required. Short description of the problem that led to this trigger. This field (or a truncated version)
|
||||
will be used when generating phone calls, SMS messages and alert emails. It will also appear on the incidents tables in the PagerDuty UI.
|
||||
The maximum length is 1024 characters.
|
||||
- For O(state=acknowledged) or O(state=resolved) - Text that will appear in the incident's log associated with this event.
|
||||
required: false
|
||||
default: Created via Ansible
|
||||
incident_class:
|
||||
type: str
|
||||
description:
|
||||
- The class/type of the event, for example C(ping failure) or C(cpu load).
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
incident_key:
|
||||
type: str
|
||||
description:
|
||||
- Identifies the incident to which this O(state) should be applied.
|
||||
- For O(state=triggered) - If there's no open (i.e. unresolved) incident with this key, a new one will be created. If there's already an
|
||||
open incident with a matching key, this event will be appended to that incident's log. The event key provides an easy way to 'de-dup'
|
||||
problem reports. If no O(incident_key) is provided, then it will be generated by PagerDuty.
|
||||
- For O(state=acknowledged) or O(state=resolved) - This should be the incident_key you received back when the incident was first opened by a
|
||||
trigger event. Acknowledge events referencing resolved or nonexistent incidents will be discarded.
|
||||
required: false
|
||||
link_url:
|
||||
type: str
|
||||
description:
|
||||
- Relevant link url to the alert. For example, the website or the job link.
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
link_text:
|
||||
type: str
|
||||
description:
|
||||
- A short description of the link_url.
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
source:
|
||||
type: str
|
||||
description:
|
||||
- The unique location of the affected system, preferably a hostname or FQDN.
|
||||
- Required in case of O(state=trigger) and O(api_version=v2).
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
severity:
|
||||
type: str
|
||||
description:
|
||||
- The perceived severity of the status the event is describing with respect to the affected system.
|
||||
- Required in case of O(state=trigger) and O(api_version=v2).
|
||||
default: 'critical'
|
||||
choices:
|
||||
- 'critical'
|
||||
- 'warning'
|
||||
- 'error'
|
||||
- 'info'
|
||||
version_added: 7.4.0
|
||||
'''
|
||||
name:
|
||||
type: str
|
||||
description:
|
||||
- PagerDuty unique subdomain. Obsolete. It is not used with PagerDuty REST v2 API.
|
||||
api_key:
|
||||
type: str
|
||||
description:
|
||||
- The pagerduty API key (readonly access), generated on the pagerduty site.
|
||||
- Required if O(api_version=v1).
|
||||
integration_key:
|
||||
type: str
|
||||
description:
|
||||
- The GUID of one of your 'Generic API' services.
|
||||
- This is the 'integration key' listed on a 'Integrations' tab of PagerDuty service.
|
||||
service_id:
|
||||
type: str
|
||||
description:
|
||||
- ID of PagerDuty service when incidents will be triggered, acknowledged or resolved.
|
||||
- Required if O(api_version=v1).
|
||||
service_key:
|
||||
type: str
|
||||
description:
|
||||
- The GUID of one of your 'Generic API' services. Obsolete. Please use O(integration_key).
|
||||
state:
|
||||
type: str
|
||||
description:
|
||||
- Type of event to be sent.
|
||||
required: true
|
||||
choices:
|
||||
- 'triggered'
|
||||
- 'acknowledged'
|
||||
- 'resolved'
|
||||
api_version:
|
||||
type: str
|
||||
description:
|
||||
- The API version we want to use to run the module.
|
||||
- V1 is more limited with option we can provide to trigger incident.
|
||||
- V2 has more variables for example, O(severity), O(source), O(custom_details) and so on.
|
||||
default: 'v1'
|
||||
choices:
|
||||
- 'v1'
|
||||
- 'v2'
|
||||
version_added: 7.4.0
|
||||
client:
|
||||
type: str
|
||||
description:
|
||||
- The name of the monitoring client that is triggering this event.
|
||||
required: false
|
||||
client_url:
|
||||
type: str
|
||||
description:
|
||||
- The URL of the monitoring client that is triggering this event.
|
||||
required: false
|
||||
component:
|
||||
type: str
|
||||
description:
|
||||
- Component of the source machine that is responsible for the event, for example C(mysql) or C(eth0).
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
custom_details:
|
||||
type: dict
|
||||
description:
|
||||
- Additional details about the event and affected system.
|
||||
- A dictionary with custom keys and values.
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
desc:
|
||||
type: str
|
||||
description:
|
||||
- For O(state=triggered) - Required. Short description of the problem that led to this trigger. This field (or a truncated version) will
|
||||
be used when generating phone calls, SMS messages and alert emails. It will also appear on the incidents tables in the PagerDuty UI. The
|
||||
maximum length is 1024 characters.
|
||||
- For O(state=acknowledged) or O(state=resolved) - Text that will appear in the incident's log associated with this event.
|
||||
required: false
|
||||
default: Created via Ansible
|
||||
incident_class:
|
||||
type: str
|
||||
description:
|
||||
- The class/type of the event, for example C(ping failure) or C(cpu load).
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
incident_key:
|
||||
type: str
|
||||
description:
|
||||
- Identifies the incident to which this O(state) should be applied.
|
||||
- For O(state=triggered) - If there is no open (in other words unresolved) incident with this key, a new one will be created. If there is already an
|
||||
open incident with a matching key, this event will be appended to that incident's log. The event key provides an easy way to 'de-dup'
|
||||
problem reports. If no O(incident_key) is provided, then it will be generated by PagerDuty.
|
||||
- For O(state=acknowledged) or O(state=resolved) - This should be the incident_key you received back when the incident was first opened
|
||||
by a trigger event. Acknowledge events referencing resolved or nonexistent incidents will be discarded.
|
||||
required: false
|
||||
link_url:
|
||||
type: str
|
||||
description:
|
||||
- Relevant link URL to the alert. For example, the website or the job link.
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
link_text:
|
||||
type: str
|
||||
description:
|
||||
- A short description of the O(link_url).
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
source:
|
||||
type: str
|
||||
description:
|
||||
- The unique location of the affected system, preferably a hostname or FQDN.
|
||||
- Required in case of O(state=trigger) and O(api_version=v2).
|
||||
required: false
|
||||
version_added: 7.4.0
|
||||
severity:
|
||||
type: str
|
||||
description:
|
||||
- The perceived severity of the status the event is describing with respect to the affected system.
|
||||
- Required in case of O(state=trigger) and O(api_version=v2).
|
||||
default: 'critical'
|
||||
choices:
|
||||
- 'critical'
|
||||
- 'warning'
|
||||
- 'error'
|
||||
- 'info'
|
||||
version_added: 7.4.0
|
||||
"""
|
||||
|
||||
EXAMPLES = '''
|
||||
EXAMPLES = r"""
|
||||
- name: Trigger an incident with just the basic options
|
||||
community.general.pagerduty_alert:
|
||||
name: companyabc
|
||||
|
@ -226,7 +225,7 @@ EXAMPLES = '''
|
|||
integration_key: xxx
|
||||
incident_key: somekey
|
||||
state: resolved
|
||||
'''
|
||||
"""
|
||||
import json
|
||||
|
||||
from ansible.module_utils.basic import AnsibleModule
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue