Skip to content

Commit

Permalink
Merge pull request #39 from lbetz/add-type-retetion-options
Browse files Browse the repository at this point in the history
Add new data type for retention options
  • Loading branch information
lbetz authored Sep 24, 2024
2 parents a2999a0 + a7e3ce2 commit 889f5c2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 17 deletions.
23 changes: 10 additions & 13 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Configures IcingaDB

### Data types

* [`IcingaDB::RetentionOptions`](#IcingaDB--RetentionOptions): Data type for retention options of the connection to
the IcingaDB database.
* [`IcingaDB::DBOptions`](#IcingaDB--DBOptions): Data type for options to connect the IcingaDB database.

## Classes
Expand Down Expand Up @@ -399,14 +401,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 @@ -755,6 +750,11 @@ Data type: `Stdlib::Absolutepath`

## Data types

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

Data type for retention options of the connection to
the IcingaDB database.

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

Data type for options to connect the IcingaDB database.
Expand All @@ -763,11 +763,8 @@ Alias of

```puppet
Hash[Enum[
'max_connections',
'max_connections_per_table',
'max_placeholders_per_statement',
'max_rows_per_transaction',
'wsrep_sync_wait'
'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 @@ -172,10 +172,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
10 changes: 10 additions & 0 deletions types/retentionoptions.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @summary
# Data type for retention options of the connection to
# the IcingaDB database.
type IcingaDB::RetentionOptions = Hash[
Enum[
'acknowledgement','comment','downtime',
'flapping','notification','state'
],
Integer[1]
]

0 comments on commit 889f5c2

Please sign in to comment.