Skip to content

Commit d080802

Browse files
Merge branch 'dev' into proj/private-image-sharing
2 parents 9c59873 + f14ce9f commit d080802

19 files changed

+2080
-34
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Name | Description |
4444
[linode.cloud.ip_share](./docs/modules/ip_share.md)|Manage the Linode shared IPs.|
4545
[linode.cloud.lke_cluster](./docs/modules/lke_cluster.md)|Manage Linode LKE clusters.|
4646
[linode.cloud.lke_node_pool](./docs/modules/lke_node_pool.md)|Manage Linode LKE cluster node pools.|
47+
[linode.cloud.monitor_services_alert_definition](./docs/modules/monitor_services_alert_definition.md)|Manage an alert definition for a specific service type. Akamai refers to these as user alerts. You need read_only access to the scope for the selected serviceType. |
4748
[linode.cloud.nodebalancer](./docs/modules/nodebalancer.md)|Manage a Linode NodeBalancer.|
4849
[linode.cloud.nodebalancer_node](./docs/modules/nodebalancer_node.md)|Manage Linode NodeBalancer Nodes.|
4950
[linode.cloud.nodebalancer_stats](./docs/modules/nodebalancer_stats.md)|Get info about a Linode Node Balancer Stats.|
@@ -87,6 +88,7 @@ Name | Description |
8788
[linode.cloud.ipv6_range_info](./docs/modules/ipv6_range_info.md)|Get info about a Linode IPv6 range.|
8889
[linode.cloud.lke_cluster_info](./docs/modules/lke_cluster_info.md)|Get info about a Linode LKE cluster.|
8990
[linode.cloud.lke_version_info](./docs/modules/lke_version_info.md)|Get info about a Linode LKE Version.|
91+
[linode.cloud.monitor_services_alert_definition_info](./docs/modules/monitor_services_alert_definition_info.md)|Get info about a Linode Alert Definition.|
9092
[linode.cloud.nodebalancer_info](./docs/modules/nodebalancer_info.md)|Get info about a Linode Node Balancer.|
9193
[linode.cloud.object_cluster_info](./docs/modules/object_cluster_info.md)|**NOTE: This module has been deprecated because it relies on deprecated API endpoints. Going forward, `region` will be the preferred way to designate where Object Storage resources should be created.**|
9294
[linode.cloud.object_storage_quota_info](./docs/modules/object_storage_quota_info.md)|Get info about a Linode Object Storage Quota.|
@@ -130,6 +132,9 @@ Name | Description |
130132
[linode.cloud.lke_type_list](./docs/modules/lke_type_list.md)|List and filter on LKE Types.|
131133
[linode.cloud.lke_version_list](./docs/modules/lke_version_list.md)|List and filter on LKE Versions.|
132134
[linode.cloud.maintenance_policy_list](./docs/modules/maintenance_policy_list.md)|List and filter on Maintenance Policies.|
135+
[linode.cloud.monitor_alert_channel_list](./docs/modules/monitor_alert_channel_list.md)|List and filter on Alert Channels.|
136+
[linode.cloud.monitor_services_alert_definition_by_service_type_list](./docs/modules/monitor_services_alert_definition_by_service_type_list.md)|The return alert definitions by service type. **Note: filters and order are currently NOT supported by this endpoint.|
137+
[linode.cloud.monitor_services_alert_definition_list](./docs/modules/monitor_services_alert_definition_list.md)|List and filter on Alert Definitions.|
133138
[linode.cloud.network_transfer_prices_list](./docs/modules/network_transfer_prices_list.md)|List and filter on Network Transfer Prices.|
134139
[linode.cloud.nodebalancer_list](./docs/modules/nodebalancer_list.md)|List and filter on Node Balancers.|
135140
[linode.cloud.nodebalancer_type_list](./docs/modules/nodebalancer_type_list.md)|List and filter on Node Balancer Types.|
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# monitor_alert_channel_list
2+
3+
List and filter on Alert Channels.
4+
5+
WARNING! This module makes use of beta endpoints and requires the C(api_version) field be explicitly set to C(v4beta).
6+
7+
- [Minimum Required Fields](#minimum-required-fields)
8+
- [Examples](#examples)
9+
- [Parameters](#parameters)
10+
- [Return Values](#return-values)
11+
12+
## Minimum Required Fields
13+
| Field | Type | Required | Description |
14+
|-------------|-------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
15+
| `api_token` | `str` | **Required** | The Linode account personal access token. It is necessary to run the module. <br/>It can be exposed by the environment variable `LINODE_API_TOKEN` instead. <br/>See details in [Usage](https://github.com/linode/ansible_linode?tab=readme-ov-file#usage). |
16+
17+
## Examples
18+
19+
```yaml
20+
- name: List all of available alert channels to the account
21+
linode.cloud.monitor_alert_channel_list:
22+
api_version: v4beta
23+
```
24+
25+
26+
## Parameters
27+
28+
| Field | Type | Required | Description |
29+
|-----------|------|----------|------------------------------------------------------------------------------|
30+
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list Alert Channels in. **(Choices: `desc`, `asc`; Default: `asc`)** |
31+
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order Alert Channels by. |
32+
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting Alert Channels. |
33+
| `count` | <center>`int`</center> | <center>Optional</center> | The number of Alert Channels to return. If undefined, all results will be returned. |
34+
35+
### filters
36+
37+
| Field | Type | Required | Description |
38+
|-----------|------|----------|------------------------------------------------------------------------------|
39+
| `name` | <center>`str`</center> | <center>**Required**</center> | The name of the field to filter on. Valid filterable fields can be found [here](https://techdocs.akamai.com/linode-api/reference/get-alert-channels). |
40+
| `values` | <center>`list`</center> | <center>**Required**</center> | A list of values to allow for this field. Fields will pass this filter if at least one of these values matches. |
41+
42+
## Return Values
43+
44+
- `alert_channels` - The returned Alert Channels.
45+
46+
- Sample Response:
47+
```json
48+
[
49+
{
50+
"alerts": [
51+
{
52+
"id": 10000,
53+
"label": "High Memory Usage Plan Dedicated",
54+
"type": "alerts-definitions",
55+
"url": "/monitor/alerts-definitions/10000"
56+
},
57+
{
58+
"id": 10001,
59+
"label": "High Memory Usage Plan Shared",
60+
"type": "alerts-definitions",
61+
"url": "/monitor/alerts-definitions/10001"
62+
}
63+
],
64+
"channel_type": "email",
65+
"content": {
66+
"email": {
67+
"email_addresses": [
68+
"Users-with-read-write-access-to-resources"
69+
]
70+
}
71+
},
72+
"created": "2025-03-20T01:41:09",
73+
"created_by": "system",
74+
"id": 10000,
75+
"label": "Read-Write Channel",
76+
"type": "system",
77+
"updated": "2025-03-20T01:41:09",
78+
"updated_by": "system"
79+
}
80+
]
81+
82+
```
83+
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-alert-channels) for a list of returned fields
84+
85+
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
1+
# monitor_services_alert_definition
2+
3+
Manage an alert definition for a specific service type. Akamai refers to these as user alerts. You need read_only access to the scope for the selected serviceType.
4+
5+
- [Minimum Required Fields](#minimum-required-fields)
6+
- [Examples](#examples)
7+
- [Parameters](#parameters)
8+
- [Return Values](#return-values)
9+
10+
## Minimum Required Fields
11+
| Field | Type | Required | Description |
12+
|-------------|-------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
13+
| `api_token` | `str` | **Required** | The Linode account personal access token. It is necessary to run the module. <br/>It can be exposed by the environment variable `LINODE_API_TOKEN` instead. <br/>See details in [Usage](https://github.com/linode/ansible_linode?tab=readme-ov-file#usage). |
14+
15+
## Examples
16+
17+
```yaml
18+
- name: Create an alert definition for a service type (dbaas)
19+
linode.cloud.monitor_services_alert_definition:
20+
service_type: 'dbaas'
21+
description: 'An alert definition for ansible test.'
22+
label: 'ansible-test'
23+
severity: 1
24+
rule_criteria:
25+
rules:
26+
- aggregate_function: 'avg'
27+
dimension_filters:
28+
- dimension_label: 'node_type'
29+
label: 'Node Type'
30+
operator: 'eq'
31+
value: 'primary'
32+
label: 'Memory Usage'
33+
metric: 'memory_usage'
34+
operator: 'gt'
35+
threshold: 90
36+
unit: 'percent'
37+
trigger_conditions:
38+
criteria_condition: 'ALL'
39+
evaluation_period_seconds: 300
40+
polling_interval_seconds: 300
41+
trigger_occurrences: 1
42+
channel_ids: '{{ alert_channels }}'
43+
state: present
44+
```
45+
46+
```yaml
47+
- name: Delete alert definition
48+
linode.cloud.monitor_services_alert_definition:
49+
service_type: 'dbaas'
50+
id: 123
51+
state: absent
52+
register: delete
53+
```
54+
55+
56+
## Parameters
57+
58+
| Field | Type | Required | Description |
59+
|-----------|------|----------|------------------------------------------------------------------------------|
60+
| `service_type` | <center>`str`</center> | <center>**Required**</center> | The Akamai Cloud Computing service being monitored. |
61+
| `channel_ids` | <center>`list`</center> | <center>**Required**</center> | The identifiers for the alert channels to use for the alert. Run the List alert channels operation and store the id for the applicable channels. **(Updatable)** |
62+
| `label` | <center>`str`</center> | <center>**Required**</center> | The name of the alert definition. This is used for display purposes in Akamai Cloud Manager. **(Updatable)** |
63+
| [`rule_criteria` (sub-options)](#rule_criteria) | <center>`dict`</center> | <center>**Required**</center> | Details for the rules required to trigger the alert. **(Updatable)** |
64+
| `severity` | <center>`int`</center> | <center>**Required**</center> | The severity of the alert. Supported values include 3 for info, 2 for low, 1 for medium, and 0 for severe. **(Choices: `0`, `1`, `2`, `3`; Updatable)** |
65+
| [`trigger_conditions` (sub-options)](#trigger_conditions) | <center>`dict`</center> | <center>**Required**</center> | The conditions that need to be met to send a notification for the alert. **(Updatable)** |
66+
| `state` | <center>`str`</center> | <center>**Required**</center> | The desired state of the target. **(Choices: `present`, `absent`)** |
67+
| `description` | <center>`str`</center> | <center>Optional</center> | An additional description for the alert definition. **(Updatable)** |
68+
| `entity_ids` | <center>`list`</center> | <center>Optional</center> | The id for each individual entity from a service_type. Get this value by running the list operation for the appropriate entity. For example, if your entity is one of your PostgreSQL databases, run the List PostgreSQL Managed Databases operation and store the id for the appropriate database from the response. You also need read_only access to the scope for the service_type for each of the entity_ids. **(Updatable)** |
69+
| `id` | <center>`int`</center> | <center>Optional</center> | The unique identifier assigned to the alert definition. Run the List alert definitions operation and store the id for the applicable alert definition. Required for updating. |
70+
| `status` | <center>`str`</center> | <center>Optional</center> | The current status of the alert. **(Choices: `enabled`, `disabled`; Updatable)** |
71+
| `wait` | <center>`bool`</center> | <center>Optional</center> | Wait for the alert definition ready (not in progress). **(Default: `False`)** |
72+
| `wait_timeout` | <center>`int`</center> | <center>Optional</center> | The amount of time, in seconds, to wait for the alert definition. **(Default: `600`)** |
73+
74+
### rule_criteria
75+
76+
| Field | Type | Required | Description |
77+
|-----------|------|----------|------------------------------------------------------------------------------|
78+
| [`rules` (sub-options)](#rules) | <center>`list`</center> | <center>Optional</center> | The individual rules that make up the alert definition. |
79+
80+
### rules
81+
82+
| Field | Type | Required | Description |
83+
|-----------|------|----------|------------------------------------------------------------------------------|
84+
| `aggregate_function` | <center>`str`</center> | <center>Optional</center> | The aggregation function applied to the metric. **(Choices: `avg`, `sum`, `min`, `max`)** |
85+
| [`dimension_filters` (sub-options)](#dimension_filters) | <center>`list`</center> | <center>Optional</center> | Individual objects that define dimension filters for the rule. |
86+
| `metric` | <center>`str`</center> | <center>Optional</center> | The metric to query. |
87+
| `operator` | <center>`str`</center> | <center>Optional</center> | The operator to apply to the metric. Available values are eq for equal, gt for greater than, lt for less than, gte for greater than or equal, and lte for less than or equal. **(Choices: `eq`, `gt`, `lt`, `gte`, `lte`)** |
88+
| `threshold` | <center>`float`</center> | <center>Optional</center> | The predefined value or condition that triggers an alert when met or exceeded. |
89+
90+
### dimension_filters
91+
92+
| Field | Type | Required | Description |
93+
|-----------|------|----------|------------------------------------------------------------------------------|
94+
| `dimension_label` | <center>`str`</center> | <center>Optional</center> | The name of the dimension to be used in the filter. |
95+
| `operator` | <center>`str`</center> | <center>Optional</center> | The operator to apply to the dimension filter. Available values are eq for equal, neq for not equal, startswith, and endswith. **(Choices: `eq`, `neq`, `startswith`, `endswith`)** |
96+
| `value` | <center>`str`</center> | <center>Optional</center> | The value to compare the dimension_label against. |
97+
98+
### trigger_conditions
99+
100+
| Field | Type | Required | Description |
101+
|-----------|------|----------|------------------------------------------------------------------------------|
102+
| `criteria_condition` | <center>`str`</center> | <center>Optional</center> | Signifies the logical operation applied when multiple metrics are set for an alert definition. For example, if you wanted to apply both cpu_usage > 90 and memory_usage > 80, ALL is the criteria_condition. Currently, only ALL is supported. **(Choices: `ALL`)** |
103+
| `evaluation_period_seconds` | <center>`int`</center> | <center>Optional</center> | The time period over which data is collected before evaluating whether the alert definition's threshold has been met or exceeded. |
104+
| `polling_interval_seconds` | <center>`int`</center> | <center>Optional</center> | The frequency at which the metric is checked for a change in state. For example, with cpu_usage set as your metric and this set to 300, your cpu_usage is checked every 5 minutes for some change in its state. |
105+
| `trigger_occurrences` | <center>`int`</center> | <center>Optional</center> | The minimum number of consecutive polling_interval_seconds periods that the threshold needs to be breached to trigger the alert. |
106+
107+
## Return Values
108+
109+
- `alert_definition` - The alert definition in JSON serialized form.
110+
111+
- Sample Response:
112+
```json
113+
{
114+
"alert_channels": [
115+
{
116+
"id": 10000,
117+
"label": "Read-Write Channel",
118+
"type": "alert-channels",
119+
"url": "/monitor/alert-channels/10000"
120+
}
121+
],
122+
"class": "dedicated",
123+
"created": "2025-03-20T01:42:11",
124+
"created_by": "system",
125+
"description": "Alert triggers when dedicated plan nodes consistently reach critical memory usage, risking application performance degradation.",
126+
"entity_ids": [
127+
"126905",
128+
"126906",
129+
"137435",
130+
"141496",
131+
"190003",
132+
"257625",
133+
"257626"
134+
],
135+
"has_more_resources": false,
136+
"id": 10000,
137+
"label": "High Memory Usage Plan Dedicated",
138+
"rule_criteria": {
139+
"rules": [
140+
{
141+
"aggregate_function": "avg",
142+
"dimension_filters": [
143+
{
144+
"dimension_label": "node_type",
145+
"label": "Node Type",
146+
"operator": "eq",
147+
"value": "primary"
148+
}
149+
],
150+
"label": "Memory Usage",
151+
"metric": "memory_usage",
152+
"operator": "gt",
153+
"threshold": 95,
154+
"unit": "percent"
155+
}
156+
]
157+
},
158+
"service_type": "dbaas",
159+
"severity": 2,
160+
"status": "enabled",
161+
"trigger_conditions": {
162+
"criteria_condition": "ALL",
163+
"evaluation_period_seconds": 300,
164+
"polling_interval_seconds": 300,
165+
"trigger_occurrences": 3
166+
},
167+
"type": "system",
168+
"updated": "2025-03-20T01:42:11",
169+
"updated_by": "system"
170+
}
171+
```
172+
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-alert-definition) for a list of returned fields
173+
174+

0 commit comments

Comments
 (0)