Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,25 @@ LogicMonitor Ansible Collection Release Notes

.. contents:: Topics

v2.1.0
======

New Modules
-----------

- lm_ops_note: Manage LogicMonitor Ops Notes (i.e. add, update, remove)

Feature Enhancement
-------------------

- lm_info: Add new target ``ops_note`` to allow users to gather information about ops notes.
- lm_info: Add new target ``device_group_devices`` to allow users to gather information about devices in a specific device group.

Improvements
------------

- Added pagination to lm_info module GET requests to allow users to gather information about more than 1000 resources.

v2.0.3
======

Expand Down Expand Up @@ -39,7 +58,7 @@ New Event Source
v1.3.0
======

Licence Update
License Update
--------------

- Changed license to BSD (3-clause) from GPL-V3
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ Name | Description
[logicmonitor.integration.lm_escalation_chain](https://github.com/ansible-collections/logicmonitor/blob/main/docs/logicmonitor.integration.lm_escalation_chain_module.md)|Manage LogicMonitor escalation chains (i.e. add, update, remove)
[logicmonitor.integration.lm_datasource](https://github.com/ansible-collections/logicmonitor/blob/main/docs/logicmonitor.integration.lm_datasource_module.md)|Manage LogicMonitor device datasources (i.e. sdt)
[logicmonitor.integration.lm_website_check](https://github.com/ansible-collections/logicmonitor/blob/main/docs/logicmonitor.integration.lm_website_check_module.md)|Manage LogicMonitor website checks (i.e. sdt a ping or web check)
[logicmonitor.integration.lm_ops_note](https://github.com/ansible-collections/logicmonitor/blob/main/docs/logicmonitor.integration.lm_ops_note_module.md)|Manage LogicMonitor ops notes (i.e. add, update, remove)

### EventSources
Name | Description
Expand Down
46 changes: 45 additions & 1 deletion docs/logicmonitor.integration.lm_info_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Gather information about LogicMonitor objects (i.e. collectors, devices, device
<ul>
<li>The full path of the device group to target.</li>
<li>The Root group full_path should be denoted by empty string "" or "/".</li>
<li>This parameter is only valid when using the "device_group" target.</li>
</ul>
</td>
</tr>
Expand Down Expand Up @@ -392,7 +393,50 @@ Gather information about LogicMonitor objects (i.e. collectors, devices, device
- name: Output
debug:
msg: '{{ output }}'

----
- name: Gather information about all ops notes
hosts: localhost
tasks:
- name: Running module
lm_info:
target: ops_note
company: batman
access_id: "id123"
access_key: "key123"
register: output
- name: Output
debug:
msg: '{{ output }}'
---
- name: Gather information about an ops note
hosts: localhost
tasks:
- name: Running module
lm_info:
target: ops_note
company: batman
access_id: "id123"
access_key: "key123"
id: "cNaa1ByBTOSIBi7V61JmVg"
register: output
- name: Output
debug:
msg: '{{ output }}'
---
- name: Gather information about a device groups devices
hosts: localhost
tasks:
- name: Running module
lm_info:
target: device_group_devices
company: batman
access_id: "id123"
access_key: "key123"
id: 16
register: output
- name: Output
debug:
msg: '{{ output }}'
```

<a name="return-values"></a>
Expand Down
225 changes: 225 additions & 0 deletions docs/logicmonitor.integration.lm_ops_note_module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
# logicmonitor.integration.lm_ops_note

Manage LogicMonitor ops notes

- [Synopsis](#synopsis)
- [Requirements](#requirements)
- [Parameters](#parameters)
- [Examples](#examples)
- [Return Values](#return-values)

<a name="synopsis"></a>

## Synopsis

- This module can be used to manage LogicMonitor ops notes (i.e. add, update, remove).

<a name="requirements"></a>

## Requirements

- Python **>= 2.7**
- Python [``requests``](https://github.com/psf/requests) library **>=2.24.0**
- An existing LogicMonitor account
- [API tokens](https://logicmonitor.com/support/settings/users-and-roles/api-tokens) used for authentication. Please
contact your LogicMonitor admin if you need new API tokens created for your account.

<a name="parameters"></a>

## Parameters

<table border=0 cellpadding=0 class="documentation-table">
<tr>
<th colspan="1">Parameter</th>
<th>Choices/<font color="blue">Default</font></th>
<th width="100%">Comments</th>
</tr>
<tr>
<td colspan="1">
<a name="action"></a>
<b>action</b>
<div>
<span>string</span>
</div>
</td>
<td>
<b>Choices:</b>
<ul>
<li>add</li>
<li>update</li>
<li>remove</li>
</ul>
</td>
<td>
<div>The action you want to perform on the ops note.</div>
<div>Required for all operations.</div>
</td>
</tr>
<tr>
<td colspan="1">
<a name="note"></a>
<b>note</b>
<div>
<span>string</span>
</div>
</td>
<td></td>
<td>
<div>The content of the ops note.</div>
<div>Required for add and update operations.</div>
</td>
</tr>
<tr>
<td colspan="1">
<a name="id"></a>
<b>id</b>
<div>
<span>integer</span>
</div>
</td>
<td></td>
<td>
<div>The ID of the ops note.</div>
<div>Required for update and remove operations.</div>
</td>
</tr>
<tr>
<td colspan="1">
<a name="tags"></a>
<b>tags</b>
<div>
<span>list</span>
</div>
</td>
<td></td>
<td>
<div>The tags associated with the ops note.</div>
<div>Optional for add and update operations.</div>
</td>
</tr>
<tr>
<td colspan="1">
<a name="scopes"></a>
<b>scopes</b>
<div>
<span>list</span>
</div>
</td>
<td></td>
<td>
<div>The scopes associated with the ops note. Scopes are IDs of the resources to which the ops note applies.</div>
<div>Optional for add and update operations.</div>
</td>
</tr>
<tr>
<td colspan="1">
<a name="scope_type"></a>
<b>scope_type</b>
<div>
<span>integer</span>
</div>
</td>
<td>
<b>Choices:</b>
<ul>
<li>device</li>
<li>device_group</li>
<li>website</li>
</ul>
</td>
<td>
<div>The type of scope associated with the ops note.</div>
<div>Optional for add and update operations.</div>
</td>
</tr>
<tr>
<td colspan="1">
<a name="note_time"></a>
<b>note_time</b>
<div>
<span>integer</span>
</div>
</td>
<td></td>
<td>
<ul>
<li>The time that the Ops note should be created.</li>
<li>Format must be "yyyy-MM-dd HH:mm" or "yyyy-MM-dd HH:mm z" where z is "am" or "pm".
The former is used for 24-hr clock while the latter is a 12-hr clock.</li>
<li>Defaults to the time action is executed.</li>
<li>Required in case note time differs from the execution time of action.</li>
</td>
</tr>
</table>

<a name="examples"></a>

## Examples

```yaml
- name: Add Ops Note
hosts: localhost
collections:
- logicmonitor.integration
tasks:
- name: Running module
lm_ops_note:
action: add
company: batman
access_id: "id123"
access_key: "key123"
note: "This is a test ops note"
tags: [ "MyTag", "MyOtherTag" ]
scope_type: "device"
scopes: [ "123", "456" ]
register: output
- name: Output
debug:
msg: '{{ output }}'
```

```yaml
- name: Update Ops Note
hosts: localhost
collections:
- logicmonitor.integration
tasks:
- name: Running module
lm_ops_note:
action: update
company: batman
access_id: "id123"
access_key: "key123"
id: "cNaa1ByBTOSIBi7V61JmVg"
note: "This is an updated test ops note"
register: output
- name: Output
debug:
msg: '{{ output }}'
```

```yaml
- name: Remove Ops Note
hosts: localhost
collections:
- logicmonitor.integration
tasks:
- name: Running module
lm_ops_note:
action: remove
company: batman
access_id: "id123"
access_key: "key123"
id: "cNaa1ByBTOSIBi7V61JmVg"
register: output
- name: Output
debug:
msg: '{{ output }}'
```

<a name="return-values"></a>

## Return Values

Common return values are
documented [here](https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values)
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace: logicmonitor
name: integration
version: 2.0.3
version: 2.1.0
readme: README.md
authors:
- Ansible (github.com/ansible)
Expand Down
Loading