dellemc.openmanage.redfish_event_subscription – Manage Redfish Subscriptions

Note

This plugin is part of the dellemc.openmanage collection (version 4.3.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install dellemc.openmanage.

To use it in a playbook, specify: dellemc.openmanage.redfish_event_subscription.

New in version 4.1.0: of dellemc.openmanage

Synopsis

  • This module allows to add or delete Redfish Event subscriptions.

Requirements

The below requirements are needed on the host that executes this module.

  • python >= 2.7.5

Parameters

Parameter Choices/Defaults Comments
baseuri
string / required
IP address of the target out-of-band controller. For example- <ipaddress>:<port>.
destination
string / required
The HTTPS URI of the destination to send events.
HTTPS is required.
event_format_type
string
    Choices:
  • Event ←
  • MetricReport
Specifies the format type of the event to be subscribed.
Event used to subscribe for Event format type.
MetricReport used to subscribe for the metrics report format type.
event_type
string
    Choices:
  • Alert ←
  • MetricReport
Specifies the event type to be subscribed.
Alert used to subscribe for alert.
MetricReport used to subscribe for the metrics report.
password
string / required
Password of the target out-of-band controller.
state
string
    Choices:
  • present ←
  • absent
present adds new event subscription.
absent deletes event subscription with the specified destination.
username
string / required
Username of the target out-of-band controller.

Notes

Note

  • event_type needs to be MetricReport and event_format_type needs to be MetricReport for metrics subscription.

  • event_type needs to be Alert and event_format_type needs to be Event for event subscription.

  • Modifying a subscription is not supported.

  • Context is always set to RedfishEvent.

  • This module does not support check_mode.

Examples

---
- name: Add Redfish metric subscription
  redfish_event_subscription:
    baseuri: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    destination: "https://192.168.1.100:8188"
    event_type: MetricReport
    event_format_type: MetricReport
    state: present

- name: Add Redfish alert subscription
  redfish_event_subscription:
    baseuri: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    destination: "https://server01.example.com:8188"
    event_type: Alert
    event_format_type: Event
    state: present

- name: Delete Redfish subscription with a specified destination
  redfish_event_subscription:
    baseuri: "192.168.0.1"
    username: "user_name"
    password: "user_password"
    destination: "https://server01.example.com:8188"
    state: absent

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
error_info
dictionary
on http error
Details of http error.

Sample:
{'error': {'@Message.ExtendedInfo': [{'Message': 'Unable to complete the operation because the JSON data format entered is invalid.', 'Resolution': 'Do the following and the retry the operation: 1) Enter the correct JSON data format and retry the operation. 2) Make sure that no syntax error is present in JSON data format. 3) Make sure that a duplicate key is not present in JSON data format.', 'Severity': 'Critical'}, {'Message': 'The request body submitted was malformed JSON and could not be parsed by the receiving service.', 'Resolution': 'Ensure that the request body is valid JSON and resubmit the request.', 'Severity': 'Critical'}], 'code': 'Base.1.2.GeneralError', 'message': 'A general error has occurred. See ExtendedInfo for more information.'}}
msg
string
always
Overall status of the task.

Sample:
Successfully added the subscription.
status
dictionary
on adding subscription successfully
Returns subscription object created

Sample:
{'@Message.ExtendedInfo': [{'Message': 'The resource has been created successfully', 'MessageArgs': [], '[email protected]': 0, 'MessageId': 'Base.1.7.Created', 'RelatedProperties': [], '[email protected]': 0, 'Resolution': 'None', 'Severity': 'OK'}, {'Message': 'A new resource is successfully created.', 'MessageArgs': [], '[email protected]': 0, 'MessageId': 'IDRAC.2.2.SYS414', 'RelatedProperties': [], '[email protected]': 0, 'Resolution': 'No response action is required.', 'Severity': 'Informational'}], 'Actions': {'#EventDestination.ResumeSubscription': {'target': '/redfish/v1/EventService/Subscriptions/5d432f36-81f4-11eb-9dc0-2cea7ff7ff9a/Actions/EventDestination.ResumeSubscription'}}, 'Context': 'RedfishEvent', 'DeliveryRetryPolicy': 'RetryForever', 'Description': 'Event Subscription Details', 'Destination': 'https://192.168.1.100:8188', 'EventFormatType': 'Event', 'EventTypes': ['Alert'], '[email protected]': 1, 'HttpHeaders': [], '[email protected]': 0, 'Id': '5d432f36-81f4-11eb-9dc0-2cea7ff7ff9a', 'MetricReportDefinitions': [], '[email protected]': 0, 'Name': 'EventSubscription 5d432f36-81f4-11eb-9dc0-2cea7ff7ff9a', 'OriginResources': [], '[email protected]': 0, 'Protocol': 'Redfish', 'Status': {'Health': 'OK', 'HealthRollup': 'OK', 'State': 'Enabled'}, 'SubscriptionType': 'RedfishEvent'}


Authors

  • Trevor Squillario (@TrevorSquillario)

  • Sachin Apagundi (@sachin-apa)