ironic.networking.rpcapi module

Client side of the networking RPC API.

class ironic.networking.rpcapi.NetworkingAPI(topic=None)[source]

Bases: object

Client side of the networking RPC API.

API version history:

1.0 - Initial version.
RPC_API_VERSION = '1.0'
delete_lag(context, switch_ids, lag_name, topic=None)[source]

Delete a link aggregation group (LAG) configuration.

Parameters:
  • context – request context.

  • switch_ids – List of switch identifiers.

  • lag_name – Name of the LAG to delete.

  • topic – RPC topic. Defaults to self.topic.

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the deletion status.

get_switches(context, topic=None)[source]

Get information about all configured switches.

Parameters:
  • context – request context.

  • topic – RPC topic. Defaults to self.topic.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary with switch_id as key and switch_info as value.

get_topic()[source]

Get RPC topic name for the networking service.

reset_port(context, switch_id, port_name, native_vlan, allowed_vlans=None, default_vlan=None, topic=None)[source]

Reset a network switch port to default configuration.

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).

  • topic – RPC topic. Defaults to self.topic.

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the reset port configuration.

update_lag(context, switch_ids, lag_name, description, mode, native_vlan, aggregation_mode, allowed_vlans=None, default_vlan=None, topic=None)[source]

Update a link aggregation group (LAG) configuration.

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).

  • topic – RPC topic. Defaults to self.topic.

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the updated LAG configuration.

update_port(context, switch_id, port_name, description, mode, native_vlan, allowed_vlans=None, default_vlan=None, lag_name=None, topic=None)[source]

Update a port configuration on a switch.

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.

  • topic – RPC topic. Defaults to self.topic.

Raises:

InvalidParameterValue if validation fails.

Raises:

NetworkError if the network operation fails.

Returns:

Dictionary containing the updated port configuration.