-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(documentation): added raw documentation for RandomMac transformer
- Loading branch information
1 parent
365416f
commit b45a380
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docs/built_in_transformers/standard_transformers/random_mac.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
The `RandomMac` transformer is designed to populate specified database columns with random MAC addresses. | ||
|
||
## Parameters | ||
|
||
| Name | Description | Default | Required | Supported DB types | | ||
|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|---------------------| | ||
| column | The name of the column to be affected | | Yes | text, varchar, inet | | ||
| keep_original_vendor | Should the Individual/Group (I/G) and Universal/Local (U/L) bits be preserved from the original MAC address. | `false` | No | - | | ||
| cast_type | Param wich allow to set Individual/Group (I/G) bit in MAC Address. Allowed values [any, individual, group]. If this value is `individual`, the address is meant for a single device (unicast). If it is `group`, the address is for a group of devices, which can include multicast and broadcast addresses. | any | No | | | ||
| management_type | Param wich allow to set Universal/Local (U/L) bit in MAC Address. Allowed values [any, universal, local]. If this bit is `universal`, the address is universally administered (globally unique). If it is `local`, the address is locally administered (such as when set manually or programmatically on a network device). | any | No | | | ||
| engine | The engine used for generating the values [random, hash]. Use hash for deterministic generation | `random` | No |- | | ||
|
||
## Description | ||
|
||
TODO | ||
|
||
|
||
## Example: Generate a Random MAC Address | ||
|
||
This example demonstrates how to configure the RandomMac transformer to inject a random MAC address into the | ||
mac_address column: | ||
|
||
```sql title="Create table mac_addresses and insert data" | ||
CREATE TABLE mac_addresses ( | ||
id SERIAL PRIMARY KEY, | ||
device_name VARCHAR(50), | ||
mac_address MACADDR, | ||
description TEXT | ||
); | ||
|
||
INSERT INTO mac_addresses (device_name, mac_address, description) VALUES | ||
('Device A', '00:1A:2B:3C:4D:5E', 'Description for Device A'), | ||
('Device B', '01:2B:3C:4D:5E:6F', 'Description for Device B'), | ||
('Device C', '02:3C:4D:5E:6F:70', 'Description for Device C'), | ||
('Device D', '03:4D:5E:6F:70:71', 'Description for Device D'), | ||
('Device E', '04:5E:6F:70:71:72', 'Description for Device E'); | ||
|
||
``` | ||
|
||
```yaml title="RandomPerson transformer example" | ||
- schema: public | ||
name: mac_addresses | ||
transformers: | ||
- name: "RandomMac" | ||
params: | ||
column: "mac_address" | ||
engine: "random" | ||
cast_type: "any" | ||
management_type: "any" | ||
``` |