Skip to content

Commit

Permalink
Add new data type for retention options
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Sep 21, 2024
1 parent 54fa582 commit 9a6efc9
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
28 changes: 20 additions & 8 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Configures IcingaDB
* `icingadb::redis::service`: Manage IcingaDB Redis server service
* `icingadb::service`: Manage IcingaDB service

### Data types

* [`IcingaDB::RetentionOptions`](#IcingaDB--RetentionOptions)

## Classes

### <a name="icingadb"></a>`icingadb`
Expand Down Expand Up @@ -405,14 +409,7 @@ Default value: `undef`

##### <a name="-icingadb--retention_options"></a>`retention_options`

Data type:

```puppet
Hash[Enum[
'acknowledgement','comment','downtime',
'flapping','notification','state'
], Integer[1]]
```
Data type: `IcingaDB::RetentionOptions`

Map of history category to number of days to retain its data in order to
enable retention only for specific categories or to override the number
Expand Down Expand Up @@ -759,3 +756,18 @@ Data type: `Stdlib::Absolutepath`



## Data types

### <a name="IcingaDB--RetentionOptions"></a>`IcingaDB::RetentionOptions`

The IcingaDB::RetentionOptions data type.

Alias of

```puppet
Hash[Enum[
'acknowledgement','comment','downtime',
'flapping','notification','state'
], Integer[1]]
```

5 changes: 1 addition & 4 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,7 @@
Pattern[/^\d+\.?\d*[d|h|m|s]?$/] $logging_interval = '20s',
Optional[Integer[1]] $retention_history_data = undef,
Optional[Integer[1]] $retention_sla_data = undef,
Hash[Enum[
'acknowledgement','comment','downtime',
'flapping','notification','state'
], Integer[1]] $retention_options = {},
IcingaDB::RetentionOptions $retention_options = {},
) {
require icingadb::globals

Expand Down
7 changes: 7 additions & 0 deletions types/retentionoptions.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type IcingaDB::RetentionOptions = Hash[
Enum[
'acknowledgement','comment','downtime',
'flapping','notification','state'
],
Integer[1]
]

0 comments on commit 9a6efc9

Please sign in to comment.