.. _vyos.rest.vyos_interfaces_module: ************************* vyos.rest.vyos_interfaces ************************* **Manage interface attributes on a VyOS device via the REST API.** Version added: 1.0.0 .. contents:: :local: :depth: 1 Synopsis -------- - Manages interface base attributes (description, MTU, enabled state, VIFs, duplex, speed) on VyOS devices using the HTTPS REST API. - Mirrors ``vyos.vyos.vyos_interfaces`` but uses HTTP API. - Supports Ethernet, Bonding, VXLAN, Loopback, and Virtual Tunnel interfaces. Requirements ------------ The below requirements are needed on the host that executes this module. - VyOS 1.3+ Parameters ---------- .. raw:: html
Parameter Choices/Defaults Comments
api_key
string / required
API key configured on the device.
config
list / elements=dictionary
List of interface configurations.
description
string
Interface description.
duplex
string
    Choices:
  • auto
  • full
  • half
Duplex mode. Only for Ethernet interfaces.
enabled
boolean
    Choices:
  • no
  • yes ←
Administrative state. true = up, false = admin-down.
mtu
integer
MTU in bytes. Applicable for Ethernet, Bonding, VXLAN, VTI.
name
string / required
Full interface name (e.g. eth0, bond0, vti1, vxlan2).
speed
string
Link speed. Only for Ethernet interfaces.
vifs
list / elements=dictionary
List of VLAN sub-interface configurations.
description
string
VIF description.
enabled
boolean
    Choices:
  • no
  • yes ←
Administrative state of the VIF.
vlan_id
integer / required
802.1Q VLAN ID.
hostname
string / required
IP address or FQDN of the VyOS device.
port
integer
Default:
443
HTTPS port for the REST API.
state
string
    Choices:
  • merged ←
  • replaced
  • overridden
  • deleted
  • gathered
{'merged': 'Merge the provided config with existing interface config.'}
{'replaced': 'Replace per-interface config with provided values.'}
{'overridden': 'Override all interface config with provided values.'}
{'deleted': 'Delete interface config for listed interfaces (or all).'}
{'gathered': 'Read current interface config from device.'}
timeout
integer
Default:
30
Request timeout in seconds.
verify_ssl
boolean
    Choices:
  • no ←
  • yes
Validate the device's TLS certificate.

See Also -------- .. seealso:: :ref:`vyos.vyos.vyos_interfaces_module` The official documentation on the **vyos.vyos.vyos_interfaces** module. :ref:`vyos.rest.vyos_l3_interfaces_module` The official documentation on the **vyos.rest.vyos_l3_interfaces** module. Return Values ------------- Common return values are documented `here `_, the following are the fields unique to this module: .. raw:: html
Key Returned Description
after
list
when changed
Interface configuration after the module ran.

before
list
always
Interface configuration before the module ran.

commands
list
always
REST API set/delete commands issued.

gathered
list
when state is gathered
Interface config read from device (state=gathered).



Status ------ Authors ~~~~~~~ - VyOS Community (@vyos)