ironic.networking.api module

Networking API for other parts of Ironic to use.

ironic.networking.api.delete_lag(context, switch_ids, lag_name)[source]

Delete a link aggregation group (LAG) configuration.

This is a convenience function that other parts of Ironic can use to delete LAG configurations.

Parameters:
  • context – request context.

  • switch_ids – List of switch identifiers.

  • lag_name – Name of the LAG to delete.

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the deletion status.

ironic.networking.api.get_networking_api()[source]

Get the networking API instance.

Returns:

NetworkingAPI instance

ironic.networking.api.reset_port(context, switch_id, port_name, native_vlan=None, allowed_vlans=None, default_vlan=None)[source]

Reset a network switch port to default configuration.

This is a convenience function that other parts of Ironic can use to reset network switch ports to their default configurations.

Parameters:
  • context – request context.

  • switch_id – Identifier for the switch.

  • port_name – Name of the port on the switch.

  • native_vlan – VLAN ID to be removed from the port.

  • allowed_vlans – List of allowed VLAN IDs to be removed(optional).

  • default_vlan – VLAN ID to restore onto the port(optional).

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the reset port configuration.

ironic.networking.api.update_lag(context, switch_ids, lag_name, description, mode, native_vlan, aggregation_mode, allowed_vlans=None, default_vlan=None)[source]

Update a link aggregation group (LAG) configuration.

This is a convenience function that other parts of Ironic can use to update LAG configurations.

Parameters:
  • context – request context.

  • switch_ids – List of switch identifiers.

  • lag_name – Name of the LAG.

  • description – Description for the LAG.

  • mode – LAG mode (‘access’ or ‘trunk’).

  • native_vlan – VLAN ID to be set for the LAG.

  • aggregation_mode – Aggregation mode (e.g., ‘lacp’, ‘static’).

  • allowed_vlans – List of allowed VLAN IDs to be added (optional).

  • default_vlan – VLAN ID to removed from the port(optional).

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the updated LAG configuration.

ironic.networking.api.update_port(context, switch_id, port_name, description, mode, native_vlan, allowed_vlans=None, lag_name=None, default_vlan=None)[source]

Update a network switch port configuration.

This is a convenience function that other parts of Ironic can use to update network switch port configurations.

Parameters:
  • context – request context.

  • switch_id – Identifier for the switch.

  • port_name – Name of the port on the switch.

  • description – Description to set for the port.

  • mode – Port mode (‘access’, ‘trunk’, or ‘hybrid’).

  • native_vlan – VLAN ID to be set on the port.

  • allowed_vlans – List of allowed VLAN IDs to be added(optional).

  • default_vlan – VLAN ID to removed from the port(optional).

  • lag_name – LAG name if port is part of a link aggregation group.

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the updated port configuration.