cisco.dnac.interface – Manage Interface objects of Devices

Note

This plugin is part of the cisco.dnac collection (version 2.0.7).

To install it use: ansible-galaxy collection install cisco.dnac.

To use it in a playbook, specify: cisco.dnac.interface.

New in version 1.0.0: of cisco.dnac

Synopsis

  • Returns all available Interfaces. This endpoint can return a maximum of 500 Interfaces.

  • Returns the Interface for the given Interface ID.

  • Returns the count of Interfaces for all devices.

  • Returns list of Interfaces by specified IP address.

  • Returns list of Interfaces by specified device.

  • Returns the list of Interfaces for the device for the specified range.

  • Returns the Interface count for the given device.

  • Returns Interface by specified device Id and Interface name.

  • Returns the Interfaces that has ISIS enabled.

  • Returns the Interfaces that has OSPF enabled.

Note

This module has a corresponding action plugin.

Requirements

The below requirements are needed on the host that executes this module.

  • dnacentersdk

Parameters

Parameter Choices/Defaults Comments
count
boolean / required
    Choices:
  • no
  • yes
If true gets the number of objects.
device_id
string / required
Device ID.
id
string / required
Interface ID.
ip_address
string / required
IP address of the Interface.
isis
boolean / required
    Choices:
  • no
  • yes
Specifies that the Interface is isis.
limit
integer
Limit query parameter.
name
string / required
Interface name.
offset
integer
Offset query parameter.
ospf
boolean / required
    Choices:
  • no
  • yes
Specifies that the Interface is ospf.
records_to_return
integer / required
Number of records to return.
start_index
integer / required
Start index.

See Also

See also

cisco.dnac.plugins.module_utils.definitions.interface

The official documentation on the cisco.dnac.plugins.module_utils.definitions.interface module.

Interface reference

Complete reference of the Interface object model.

Interface reference

SDK reference.

Examples

- name: get_all_interfaces
  cisco.dnac.interface:
    state: query  # required
    limit: 1  #  number
    offset: 1  #  number
  register: nm_get_all_interfaces

- name: get_interface_by_id
  cisco.dnac.interface:
    state: query  # required
    id: SomeValue  # string, required
  register: nm_get_interface_by_id

- name: get_device_interface_count
  cisco.dnac.interface:
    state: query  # required
    count: True  # boolean, required
  register: nm_get_device_interface_count

- name: get_interface_by_ip
  cisco.dnac.interface:
    state: query  # required
    ip_address: SomeValue  # string, required
  register: nm_get_interface_by_ip

- name: get_interface_info_by_id
  cisco.dnac.interface:
    state: query  # required
    device_id: SomeValue  # string, required
  register: nm_get_interface_info_by_id

- name: get_device_interfaces_by_specified_range
  cisco.dnac.interface:
    state: query  # required
    device_id: SomeValue  # string, required
    records_to_return: 1  #  integer, required
    start_index: 1  #  integer, required
  register: nm_get_device_interfaces_by_specified_range

- name: get_device_interface_count_by_id
  cisco.dnac.interface:
    state: query  # required
    device_id: SomeValue  # string, required
    count: True  # boolean, required
  register: nm_get_device_interface_count_by_id

- name: get_interface_details
  cisco.dnac.interface:
    state: query  # required
    device_id: SomeValue  # string, required
    name: SomeValue  # string, required
  register: nm_get_interface_details

- name: get_isis_interfaces
  cisco.dnac.interface:
    state: query  # required
    isis: True  # boolean, required
  register: nm_get_isis_interfaces

- name: get_ospf_interfaces
  cisco.dnac.interface:
    state: query  # required
    ospf: True  # boolean, required
  register: nm_get_ospf_interfaces

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
dnac_response
dictionary
always
A dictionary with the response returned by the DNA Center Python SDK

Sample:
{'response': 29, 'version': '1.0'}
missing_params
list / elements=string
when the function request schema is not satisfied
Provided arguments do not comply with the schema of the DNA Center Python SDK function

sdk_function
string
always
The DNA Center SDK function used to execute the task

Sample:
devices.get_all_interfaces


Authors

  • Rafael Campos (@racampos)