phoenixnap.bmc.event_info (1.17.0) — module

Retrieves the event logs for given time period.

| "added in version" 1.0.0 of phoenixnap.bmc"

Authors: Pavle Jojkic (@pajuga) <pavlej@phoenixnap.com>, Goran Jelenic (@goranje) <goranje@phoenixnap.com>

preview | supported by certified

Install collection

Install with ansible-galaxy collection install phoenixnap.bmc:==1.17.0


Add to requirements.yml

  collections:
    - name: phoenixnap.bmc
      version: 1.17.0

Description

Retrieves the event logs for given time period. All date & times are in UTC.

This module has a dependency on requests

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# All the examples assume that you have file config.yaml with your 'clientId' and 'clientSecret'
# in location: ~/.pnap/config.yaml

- name: Retrieve the event logs
  hosts: localhost
  gather_facts: false
  vars_files:
    - ~/.pnap/config.yaml
  tasks:
    - name: Retrieve the event logs for given time period
      phoenixnap.bmc.event_info:
        client_id: "{{ clientId }}"
        client_secret: "{{ clientSecret }}"
        from_date: "2021-12-01T16:24:57.123Z"
        to_date: "2021-12-02T16:24:57.123Z"
        limit: 10
        order: ASC
        username: user@domen.com
        verb: POST
      register: output
    - name: Print the gathered infos
      ansible.builtin.debug:
        var: output.events

Inputs

    
uri:
    description: The request uri.
    type: str

verb:
    description: The HTTP verb corresponding to the action.
    type: str

limit:
    description: Limit the number of records returned.
    type: int

order:
    description: Ordering of the event's time. SortBy can be introduced later on.
    type: str

to_date:
    description: To the date and time (inclusive) to filter event log records by.
    type: str

username:
    description: The username that did the actions.
    type: str

client_id:
    description: Client ID (Application Management)
    type: str

from_date:
    description: From the date and time (inclusive) to filter event log records by.
    type: str

client_secret:
    description: Client Secret (Application Management)
    type: str

Outputs

events:
  contains:
    name:
      description: The name of the event.
      returned: always
      sample: API.CreateServer
      type: str
    timestamp:
      description: The UTC time the event initiated.
      returned: always
      sample: 2020-03-19T16:39.123Z
      type: str
    userInfo:
      contains:
        accountId:
          description: The BMC account ID
          sample: 1234dfgdsf
          type: str
        clientId:
          description: The client ID of the application
          sample: e9d335b1-3aa4-4760-9bad-2595c0449035
          type: str
        username:
          description: The logged in user or owner of the client application
          sample: johnd@phoenixnap.com
          type: str
      description: Details related to the user / application performing this request
      returned: always
      type: list
  description: The events information as list
  returned: success
  type: complex