Cisco IOS Switch Cisco IOS Switch: Interfaces

Summary

This module contains actions for viewing & managing interfaces on a Cisco IOS v15 switch.

See the Overview page for information on how actions in this plugin work.

Actions

cisco_ios_switch.interfaces.

capable_duplexes

Get the duplexes an interface can support using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

A list of supported duplexes as strings.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.capable_duplexes:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch
  save: port_11_duplexes

cisco_ios_switch.interfaces.

capable_speeds

Get the speeds an interface can support using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

A list of supported speeds as strings.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.capable_speeds:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch
  save: port_11_speeds

cisco_ios_switch.interfaces.

clear_access_vlan

Remove the access VLAN of an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
- cisco_ios_switch.interfaces.clear_access_vlan:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

clear_name

Clear the name of an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
- cisco_ios_switch.interfaces.clear_name:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

disable

Disable an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
- cisco_ios_switch.interfaces.disable:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

enable

Enable an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
- cisco_ios_switch.interfaces.enable:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

ethernet_status_icon

Generate an icon showing the interface port status as an HTML img tag.

Minimum Plugin Version: 1.0.0

Input
Output

A snippet of HTML that can be used in markdown.

Screenshot

ethernet-icon

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
- cisco_ios_switch.interfaces.get_by_port:
    port: Gi0/10
  load:
    cisco_switch: cisco_switch
  save: interface_10

- cisco_ios_switch.interfaces.ethernet_status_icon:
  load:
    interface: interface_10
  save: interface_10_icon

- ppa.ui.output_markdown:
    doc: >
      #### Interface Gi0/10 Ethernet Icon

cisco_ios_switch.interfaces.

ethernet_summary

Generate an HTML interface summary with an icon showing the interface port status.

Minimum Plugin Version: 1.0.0

Input
Output

A snippet of HTML that can be used in markdown.

Screenshot

ethernet-summary

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
- cisco_ios_switch.interfaces.get_by_port:
    port: Gi0/10
  load:
    cisco_switch: cisco_switch
  save: interface_10

- cisco_ios_switch.interfaces.ethernet_summary:
  load:
    interface: interface_10
  save: interface_10_summary

- ppa.ui.output_markdown:
    doc: >
      #### Interface Gi0/10 Summary

cisco_ios_switch.interfaces.

get_all

Get all interfaces from the switch.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

A list of Interface Dictionaries.

Example
1
2
3
4
- cisco_ios_switch.interfaces.get_all:
  load:
    cisco_switch: cisco_switch
  save: interfaces

cisco_ios_switch.interfaces.

get_by_port

Get an interface from the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

A single Interface Dictionary.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.get_by_port:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch
  save: port_11

cisco_ios_switch.interfaces.

get_duplex

Get the duplex property of a switch interface.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

The interface duplex as a string.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.get_duplex:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch
  save: port_11_duplex

cisco_ios_switch.interfaces.

get_name

Get the name of a switch interface.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

The interface name as a string.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.get_name:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch
  save: port_11_name

cisco_ios_switch.interfaces.

get_speed

Get the speed property of a switch interface.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

The interface speed as a string.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.get_speed:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch
  save: port_11_speed

cisco_ios_switch.interfaces.

input_table

Display a list of interfaces in a table, and allow the task operator to make a selection.

The table will have the following columns:

  • Port
  • Name
  • Status
  • VLAN
  • Duplex
  • Speed
  • Type

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • interface_list: a list of Interface Dictionaries

  • exclude_ports: a list of interface ports to exclude from the table (defaults to null)

  • minimum: the minimum number of acceptable selections (defaults to null)

  • maximum: the maximum number of acceptable selections (defaults to null)

Output

A list of Interface Dictionaries.

Example
  • Getting all interfaces from the switch and saving them as variable all_interfaces.

  • Displaying all interfaces other than the uplink, and saving the selection as chosen_interfaces.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
- cisco_ios_switch.interfaces.get_all:
  load:
    cisco_switch: cisco_switch
  save: all_interfaces

- cisco_ios_switch.interfaces.input_table:
    text: Please Select an Interface
    exclude_ports:
      - Gi0/1
    minimum: 1
    maximum: 1
  load:
    interface_list: all_interfaces
  save: selected_interface

cisco_ios_switch.interfaces.

output_table

Display a list of interfaces in a table.

The table will have the following columns:

  • Port
  • Name
  • Status
  • VLAN
  • Duplex
  • Speed
  • Type

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • interface_list: a list of Interface Dictionaries

  • exclude_ports: a list of interface ports to exclude from the table (defaults to null)

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
8
9
- cisco_ios_switch.interfaces.get_all:
  load:
    cisco_switch: cisco_switch
  save: all_interfaces

- cisco_ios_switch.interfaces.output_table:
    text: All Interfaces
  load:
    interface_list: all_interfaces

cisco_ios_switch.interfaces.

set_access_vlan

Set the access VLAN for an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • vlan_id: the ID of the new access VLAN or null to set a blank VLAN

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.set_access_vlan:
    port: Gi0/11
    vlan_id: 200
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

set_default_duplex

Set the duplex of an interface on the switch to its default value using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
- cisco_ios_switch.interfaces.set_default_duplex:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

set_default_speed

Set the speed of an interface on the switch to its default value using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
- cisco_ios_switch.interfaces.set_default_speed:
    port: Gi0/11
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

set_duplex

Set the duplex of an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • duplex: the new interface duplex or null to set the default value

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.set_duplex:
    port: Gi0/11
    duplex: full
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

set_name

Set the name of an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • name: the new interface name or null to set an empty name

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.set_name:
    port: Gi0/11
    name: New Interface Name
  load:
    cisco_switch: cisco_switch

cisco_ios_switch.interfaces.

set_speed

Set the speed of an interface on the switch using its port name.

Minimum Plugin Version: 1.0.0

Input
  • cisco_switch: a CiscoSwitch dictionary

  • port: the interface port

  • speed: the new interface speed or null to set the default value

  • enable_password: an enable password if required

  • progress_bar: set to true to display a progress bar when performing the operation (defaults to false)

  • prompt_timeout: the number of seconds to wait for commands to complete (defaults to 5)

  • connection_timeout: the number of seconds to wait for the connection to establish (defaults to 10)

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- cisco_ios_switch.interfaces.set_speed:
    port: Gi0/11
    speed: 100
  load:
    cisco_switch: cisco_switch