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
35 changes: 16 additions & 19 deletions docs/modules/monitor_alert_channel_list.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,34 @@ WARNING! This module makes use of beta endpoints and requires the C(api_version)
```json
[
{
"alerts": [
{
"id": 10000,
"label": "High Memory Usage Plan Dedicated",
"type": "alerts-definitions",
"url": "/monitor/alerts-definitions/10000"
},
{
"id": 10001,
"label": "High Memory Usage Plan Shared",
"type": "alerts-definitions",
"url": "/monitor/alerts-definitions/10001"
}
],
"id": 10000,
"label": "Read-Write Channel",
"channel_type": "email",
"type": "system",
"content": {
"email": {
"email_addresses": [
"Users-with-read-write-access-to-resources"
]
}
},
"details": {
"email": {
"usernames": [],
"recipient_type": "read_write_users"
}
},
"alerts": {
"url": "/monitor/alert-channels/10000/alerts",
"type": "alerts-definitions",
"alert_count": 8
},
"created": "2025-03-20T01:41:09",
"created_by": "system",
"id": 10000,
"label": "Read-Write Channel",
"type": "system",
"updated": "2025-03-20T01:41:09",
"created_by": "system",
"updated_by": "system"
}
]
]

```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-alert-channels) for a list of returned fields
Expand Down
35 changes: 16 additions & 19 deletions plugins/module_utils/doc_fragments/alert_channels_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,32 @@

result_alert_channels_samples = ['''[
{
"alerts": [
{
"id": 10000,
"label": "High Memory Usage Plan Dedicated",
"type": "alerts-definitions",
"url": "/monitor/alerts-definitions/10000"
},
{
"id": 10001,
"label": "High Memory Usage Plan Shared",
"type": "alerts-definitions",
"url": "/monitor/alerts-definitions/10001"
}
],
"id": 10000,
"label": "Read-Write Channel",
"channel_type": "email",
"type": "system",
"content": {
"email": {
"email_addresses": [
"Users-with-read-write-access-to-resources"
]
}
},
"details": {
"email": {
"usernames": [],
"recipient_type": "read_write_users"
}
},
"alerts": {
"url": "/monitor/alert-channels/10000/alerts",
"type": "alerts-definitions",
"alert_count": 8
},
"created": "2025-03-20T01:41:09",
"created_by": "system",
"id": 10000,
"label": "Read-Write Channel",
"type": "system",
"updated": "2025-03-20T01:41:09",
"created_by": "system",
"updated_by": "system"
}
]
]
''']
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- name: monitor_services_alert_channel_list
block:
- name: List available alert channels
linode.cloud.monitor_alert_channel_list:
register: alert_channel_list

- name: Assert monitor_alert_channel_list response
assert:
that:
- alert_channel_list.alert_channels | length > 0

- name: List system alert channels
linode.cloud.monitor_alert_channel_list:
filters:
- name: label
values: ["Read-Write Channel"]
register: alert_channel_list_filter

- name: Assert alert_channel_list_filter response
assert:
that:
- alert_channel_list_filter.alert_channels | length > 0
- alert_channel_list_filter.alert_channels.0.label == 'Read-Write Channel'

environment:
LINODE_UA_PREFIX: '{{ ua_prefix }}'
LINODE_API_TOKEN: '{{ api_token }}'
LINODE_API_URL: '{{ api_url }}'
LINODE_API_VERSION: '{{ api_version }}'
LINODE_CA: '{{ ca_file or "" }}'
Loading