Skip to content
Merged
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ Name | Description |
[linode.cloud.lock_list](./docs/modules/lock_list.md)|List and filter on Locks.|
[linode.cloud.maintenance_policy_list](./docs/modules/maintenance_policy_list.md)|List and filter on Maintenance Policies.|
[linode.cloud.monitor_alert_channel_list](./docs/modules/monitor_alert_channel_list.md)|List and filter on Alert Channels.|
[linode.cloud.monitor_alert_definition_entities_list](./docs/modules/monitor_alert_definition_entities_list.md)|List and filter on Alert Definition Entities.|
[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.|
[linode.cloud.monitor_services_alert_definition_list](./docs/modules/monitor_services_alert_definition_list.md)|List and filter on Alert Definitions.|
[linode.cloud.network_transfer_prices_list](./docs/modules/network_transfer_prices_list.md)|List and filter on Network Transfer Prices.|
Expand Down
76 changes: 76 additions & 0 deletions docs/modules/monitor_alert_definition_entities_list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# monitor_alert_definition_entities_list

List and filter on Alert Definition Entities.
Comment thread
yec-akamai marked this conversation as resolved.

WARNING! This module makes use of beta endpoints and requires the C(api_version) field be explicitly set to C(v4beta).

- [Minimum Required Fields](#minimum-required-fields)
- [Examples](#examples)
- [Parameters](#parameters)
- [Return Values](#return-values)

## Minimum Required Fields
| Field | Type | Required | Description |
|-------------|-------|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `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). |

## Examples

```yaml
- name: List all entities for a specific alert definition
linode.cloud.monitor_alert_definition_entities_list:
service_type: dbaas
id: 12345
api_version: v4beta
```


## Parameters

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `service_type` | <center>`str`</center> | <center>**Required**</center> | The parent Service Type for the Alert Definition Entities. |
| `id` | <center>`int`</center> | <center>**Required**</center> | The parent Alert Definition for the Alert Definition Entities. |
| `order` | <center>`str`</center> | <center>Optional</center> | The order to list Alert Definition Entities in. **(Choices: `desc`, `asc`; Default: `asc`)** |
| `order_by` | <center>`str`</center> | <center>Optional</center> | The attribute to order Alert Definition Entities by. |
| [`filters` (sub-options)](#filters) | <center>`list`</center> | <center>Optional</center> | A list of filters to apply to the resulting Alert Definition Entities. |
| `count` | <center>`int`</center> | <center>Optional</center> | The number of Alert Definition Entities to return. If undefined, all results will be returned. |

### filters

| Field | Type | Required | Description |
|-----------|------|----------|------------------------------------------------------------------------------|
| `name` | <center>`str`</center> | <center>**Required**</center> | The name of the field to filter on. Valid filterable fields can be found [here](TODO). |
| `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. |

## Return Values

- `alert_definition_entities` - The returned Alert Definition Entities.

- Sample Response:
```json
[
{
"id": "1",
"label": "mydatabase-1",
"url": "/v4/databases/mysql/instances/1",
"type": "dbaas"
},
{
"id": "2",
"label": "mydatabase-2",
"url": "/v4/databases/mysql/instances/2",
"type": "dbaas"
},
{
"id": "3",
"label": "mydatabase-3",
"url": "/v4/databases/mysql/instances/3",
"type": "dbaas"
}
]

```
- See the [Linode API response documentation](TODO) for a list of returned fields
Comment thread
yec-akamai marked this conversation as resolved.


52 changes: 25 additions & 27 deletions docs/modules/monitor_services_alert_definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Manage an alert definition for a specific service type. Akamai refers to these a
| `description` | <center>`str`</center> | <center>Optional</center> | An additional description for the alert definition. **(Updatable)** |
| `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)** |
| `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. |
| `scope` | <center>`str`</center> | <center>Optional</center> | The alert scope. Supported values include account, entity, and region. Defaults to entity. **(Choices: `account`, `entity`, `region`)** |
| `regions` | <center>`list`</center> | <center>Optional</center> | The regions to monitor for this alert definition. **(Updatable)** |
| `status` | <center>`str`</center> | <center>Optional</center> | The current status of the alert. **(Choices: `enabled`, `disabled`; Updatable)** |
| `wait` | <center>`bool`</center> | <center>Optional</center> | Wait for the alert definition ready (not in progress). **(Default: `False`)** |
| `wait_timeout` | <center>`int`</center> | <center>Optional</center> | The amount of time, in seconds, to wait for the alert definition. **(Default: `600`)** |
Expand Down Expand Up @@ -111,30 +113,27 @@ Manage an alert definition for a specific service type. Akamai refers to these a
- Sample Response:
```json
{
"id": 12345,
"label": "Test Alert for DBAAS",
"service_type": "dbaas",
"severity": 1,
"type": "user",
"description": "A test alert for dbaas service",
"scope": "entity",
"regions": [],
"entities": {
"url": "/monitor/services/dbaas/alert-definitions/12345/entities",
"count": 1,
"has_more_resources": false
},
"alert_channels": [
{
"id": 10000,
"label": "Read-Write Channel",
"type": "alert-channels",
"type": "email",
"url": "/monitor/alert-channels/10000"
}
],
"class": "dedicated",
"created": "2025-03-20T01:42:11",
"created_by": "system",
"description": "Alert triggers when dedicated plan nodes consistently reach critical memory usage, risking application performance degradation.",
"entity_ids": [
"126905",
"126906",
"137435",
"141496",
"190003",
"257625",
"257626"
],
"has_more_resources": false,
"id": 10000,
"label": "High Memory Usage Plan Dedicated",
"rule_criteria": {
"rules": [
{
Expand All @@ -147,26 +146,25 @@ Manage an alert definition for a specific service type. Akamai refers to these a
"value": "primary"
}
],
"label": "Memory Usage",
"metric": "memory_usage",
"label": "High CPU Usage",
"metric": "cpu_usage",
"operator": "gt",
"threshold": 95,
"threshold": 90,
"unit": "percent"
}
]
},
"service_type": "dbaas",
"severity": 2,
"status": "enabled",
"trigger_conditions": {
"criteria_condition": "ALL",
"evaluation_period_seconds": 300,
"polling_interval_seconds": 300,
"polling_interval_seconds": 60,
"trigger_occurrences": 3
},
"type": "system",
"updated": "2025-03-20T01:42:11",
"updated_by": "system"
"class": "alert",
"status": "active",
"created": "2024-01-01T00:00:00",
"updated": "2024-01-01T00:00:00",
"updated_by": "tester"
}
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-alert-definition) for a list of returned fields
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,88 +39,27 @@ WARNING! This module makes use of beta endpoints and requires the C(api_version)
```json
[
{
"alert_channels": [
{
"id": 10000,
"label": "Read-Write Channel",
"type": "alert-channels",
"url": "/monitor/alert-channels/10000"
}
],
"class": "dedicated",
"created": "2025-03-20T01:42:11",
"created_by": "system",
"description": "Alert triggers when dedicated plan nodes consistently reach critical memory usage, risking application performance degradation.",
"entity_ids": [
"126905",
"126906",
"137435",
"141496",
"190003",
"257625",
"257626"
],
"has_more_resources": false,
"id": 10000,
"label": "High Memory Usage Plan Dedicated",
"rule_criteria": {
"rules": [
{
"aggregate_function": "avg",
"dimension_filters": [
{
"dimension_label": "node_type",
"label": "Node Type",
"operator": "eq",
"value": "primary"
}
],
"label": "Memory Usage",
"metric": "memory_usage",
"operator": "gt",
"threshold": 95,
"unit": "percent"
}
]
},
"id": 12345,
"label": "Test Alert for DBAAS",
"service_type": "dbaas",
"severity": 2,
"status": "enabled",
"trigger_conditions": {
"criteria_condition": "ALL",
"evaluation_period_seconds": 300,
"polling_interval_seconds": 300,
"trigger_occurrences": 3
"severity": 1,
"type": "user",
"description": "A test alert for dbaas service",
"scope": "entity",
"regions": [],
"entities": {
"url": "/monitor/services/dbaas/alert-definitions/12345/entities",
"count": 1,
"has_more_resources": false
},
"type": "system",
"updated": "2025-03-20T01:42:11",
"updated_by": "system"
},
{
"alert_channels": [
{
"id": 10000,
"label": "Read-Write Channel",
"type": "alert-channels",
"type": "email",
"url": "/monitor/alert-channels/10000"
}
],
"class": null,
"created": "2025-03-20T02:15:18",
"created_by": "John Q. Linode",
"description": "Custom alert set up for high memory usage for shared plan nodes.",
"entity_ids": [
"126907",
"126908",
"137436",
"141497",
"190004",
"257627",
"257628"
],
"has_more_resources": false,
"id": 10001,
"label": "High Memory Usage Plan Shared",
"rule_criteria": {
"rules": [
{
Expand All @@ -133,26 +72,25 @@ WARNING! This module makes use of beta endpoints and requires the C(api_version)
"value": "primary"
}
],
"label": "Memory Usage",
"metric": "memory_usage",
"label": "High CPU Usage",
"metric": "cpu_usage",
"operator": "gt",
"threshold": 95,
"threshold": 90,
"unit": "percent"
}
]
},
"service_type": "dbaas",
"severity": 2,
"status": "enabled",
"trigger_conditions": {
"criteria_condition": "ALL",
"evaluation_period_seconds": 300,
"polling_interval_seconds": 300,
"polling_interval_seconds": 60,
"trigger_occurrences": 3
},
"type": "user",
"updated": "2025-03-20T02:15:18",
"updated_by": "John Q. Linode"
"class": "alert",
"status": "active",
"created": "2024-01-01T00:00:00",
"updated": "2024-01-01T00:00:00",
"updated_by": "tester"
}
]

Expand Down
50 changes: 23 additions & 27 deletions docs/modules/monitor_services_alert_definition_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,27 @@ Get info about a Linode Alert Definition.
- Sample Response:
```json
{
"id": 12345,
"label": "Test Alert for DBAAS",
"service_type": "dbaas",
"severity": 1,
"type": "user",
"description": "A test alert for dbaas service",
"scope": "entity",
"regions": [],
"entities": {
"url": "/monitor/services/dbaas/alert-definitions/12345/entities",
"count": 1,
"has_more_resources": false
},
"alert_channels": [
{
"id": 10000,
"label": "Read-Write Channel",
"type": "alert-channels",
"type": "email",
"url": "/monitor/alert-channels/10000"
}
],
"class": "dedicated",
"created": "2025-03-20T01:42:11",
"created_by": "system",
"description": "Alert triggers when dedicated plan nodes consistently reach critical memory usage, risking application performance degradation.",
"entity_ids": [
"126905",
"126906",
"137435",
"141496",
"190003",
"257625",
"257626"
],
"has_more_resources": false,
"id": 10000,
"label": "High Memory Usage Plan Dedicated",
"rule_criteria": {
"rules": [
{
Expand All @@ -72,26 +69,25 @@ Get info about a Linode Alert Definition.
"value": "primary"
}
],
"label": "Memory Usage",
"metric": "memory_usage",
"label": "High CPU Usage",
"metric": "cpu_usage",
"operator": "gt",
"threshold": 95,
"threshold": 90,
"unit": "percent"
}
]
},
"service_type": "dbaas",
"severity": 2,
"status": "enabled",
"trigger_conditions": {
"criteria_condition": "ALL",
"evaluation_period_seconds": 300,
"polling_interval_seconds": 300,
"polling_interval_seconds": 60,
"trigger_occurrences": 3
},
"type": "system",
"updated": "2025-03-20T01:42:11",
"updated_by": "system"
"class": "alert",
"status": "active",
"created": "2024-01-01T00:00:00",
"updated": "2024-01-01T00:00:00",
"updated_by": "tester"
}
```
- See the [Linode API response documentation](https://techdocs.akamai.com/linode-api/reference/get-alert-definition) for a list of returned fields
Expand Down
Loading
Loading