Skip to content

Commit b906357

Browse files
committed
Add document for referring alt-names in bond/bridge/vlan/route/interface
Signed-off-by: Gris Ge <fge@redhat.com>
1 parent d03cb2b commit b906357

File tree

2 files changed

+99
-2
lines changed

2 files changed

+99
-2
lines changed

devel/yaml_api.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,46 @@ names, meaning:
485485
* Applying YAML only append alt-names to existing.
486486
* Only remove names marked with `state: absent`.
487487

488+
When deleting interface using `state: absent`, since version 2.2.58, nmstate
489+
will also purge all existing alternative names.
490+
491+
Since version 2.2.58, anywhere in desired state YAML, you need a interface
492+
name, you can use alternative name instead. For example, you can use
493+
alternative name as interface name, bond port name, VLAN base-iface name,
494+
bridge port name, route next-hop-interface name and etc.
495+
496+
For example:
497+
498+
```yml
499+
---
500+
interfaces:
501+
- name: enp7s0
502+
type: ethernet
503+
state: up
504+
alt-names:
505+
- name: port1
506+
- name: veryveryveryverylonglonglongname
507+
- name: bond99
508+
type: bond
509+
bond:
510+
mode: 0
511+
ports:
512+
- veryveryveryverylonglonglongname
513+
- name: vlan101
514+
type: vlan
515+
state: up
516+
vlan:
517+
base-iface: veryveryveryverylonglonglongname
518+
id: 101
519+
routes:
520+
config:
521+
- destination: 198.51.100.0/24
522+
metric: 150
523+
next-hop-address: 192.0.2.1
524+
next-hop-interface: veryveryveryverylonglonglongname
525+
table-id: 254
526+
```
527+
488528
### IP
489529

490530
This is the example of interface with static IP addresses:

features/alt-name.md

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ and remove explicitly.
1616

1717
Example YAML for adding alternative names:
1818

19-
```rust
19+
```yml
2020
---
2121
interfaces:
2222
- name: enp7s0
@@ -27,7 +27,7 @@ interfaces:
2727
2828
Example YAML for removing alternative names:
2929
30-
```
30+
```yml
3131
---
3232
interfaces:
3333
- name: enp7s0
@@ -37,3 +37,60 @@ interfaces:
3737
- name: veryveryveryverylonglonglongname
3838
state: absent
3939
```
40+
41+
42+
Since nmstate 2.2.58, you may refer alt-name as interface name:
43+
44+
```yml
45+
---
46+
interfaces:
47+
- name: veryveryveryverylonglonglongname
48+
tyep: ethernet
49+
state: up
50+
ipv4:
51+
enabled: false
52+
```
53+
54+
Since nmstate 2.2.58, you may refer alt-name as route next-hop-interface:
55+
56+
```yml
57+
---
58+
routes:
59+
config:
60+
- destination: 198.51.100.0/24
61+
metric: 150
62+
next-hop-address: 192.0.2.1
63+
next-hop-interface: veryveryveryverylonglonglongname
64+
table-id: 254
65+
```
66+
67+
Since nmstate 2.2.58, you may refer alt-name as
68+
bond/linux-bridge/ovs-bridge/vrf port. Example on linux bridge:
69+
70+
```yml
71+
---
72+
interfaces:
73+
- name: br0
74+
type: linux-bridge
75+
state: up
76+
bridge:
77+
port:
78+
- name: veryveryveryverylonglonglongname
79+
options:
80+
stp:
81+
enabled: false
82+
```
83+
84+
Since nmstate 2.2.58, you may refer alt-name as base-iface of
85+
VLAN/VxLAN/MacSec/MacVlan:
86+
87+
```yml
88+
---
89+
interfaces:
90+
- name: vlan101
91+
type: vlan
92+
state: up
93+
vlan:
94+
base-iface: veryveryveryverylonglonglongname
95+
id: 101
96+
```

0 commit comments

Comments
 (0)