cisco.dnac.network_device (2.0.7) — module

Manage NetworkDevice objects of Devices

| "added in version" 1.0.0 of cisco.dnac"

Authors: Rafael Campos (@racampos)

This plugin has a corresponding action plugin.

Install collection

Install with ansible-galaxy collection install cisco.dnac:==2.0.7


Add to requirements.yml

  collections:
    - name: cisco.dnac
      version: 2.0.7

Description

Returns list of network devices based on filter criteria such as management IP address, mac address, hostname, location name and a wide variety of additional criteria. You can also use the asterisk in any value to conduct a wildcard search. For example, to find all hostnames beginning with myhost in the IP address range 192.25.18.n, issue the following request GET fqdnoripofdnacenterplatform/dna/intent/api/v1/network-device? hostname=myhost* & managementIpAddress=192.25.18.* For a complete list of parameter names that you can use for filtering this request, see the DNA Center API Reference documentation. Note If id parameter is provided, it will return the list of network-devices for the given ids and ignores the other request parameters.

Adds the device with given credential.

Sync the devices provided as input.

Deletes the network device for the given Id.

Returns the network device details for the given device ID.

Returns brief summary of device info such as hostname, management IP address for the given device Id.

Returns the list of network devices for the given pagination range.

Returns the count of network devices based on the filter criteria by management IP address, mac address, hostname and location name.

Returns the network device by specified IP address.

Returns the network device with given serial number.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get_device_list
  cisco.dnac.network_device:
    state: query  # required
    associated_wlc_ip: SomeValue  # string
    collection_interval: SomeValue  # string
    collection_status: SomeValue  # string
    error_code: SomeValue  # string
    error_description: SomeValue  # string
    family: SomeValue  # string
    hostname: SomeValue  # string
    id: SomeValue  # string
    license_name: SomeValue  # string
    license_status: SomeValue  # string
    license_type: SomeValue  # string
    location: SomeValue  # string
    location_name: SomeValue  # string
    mac_address: SomeValue  # string
    management_ip_address: SomeValue  # string
    module_equpimenttype: SomeValue  # string
    module_name: SomeValue  # string
    module_operationstatecode: SomeValue  # string
    module_partnumber: SomeValue  # string
    module_servicestate: SomeValue  # string
    module_vendorequipmenttype: SomeValue  # string
    not_synced_for_minutes: SomeValue  # string
    platform_id: SomeValue  # string
    reachability_status: SomeValue  # string
    role: SomeValue  # string
    serial_number: SomeValue  # string
    series: SomeValue  # string
    software_type: SomeValue  # string
    software_version: SomeValue  # string
    type: SomeValue  # string
    up_time: SomeValue  # string
  register: nm_get_device_list
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: add_device
  cisco.dnac.network_device:
    state: create  # required
    cliTransport: SomeValue  # string, required
    enablePassword: SomeValue  # string, required
    ipAddress:  # required
    - SomeValue  # string
    password: SomeValue  # string, required
    snmpAuthPassphrase: SomeValue  # string, required
    snmpAuthProtocol: SomeValue  # string, required
    snmpMode: SomeValue  # string, required
    snmpPrivPassphrase: SomeValue  # string, required
    snmpPrivProtocol: SomeValue  # string, required
    snmpROCommunity: SomeValue  # string, required
    snmpRWCommunity: SomeValue  # string, required
    snmpRetry: 1  #  integer, required
    snmpTimeout: 1  #  integer, required
    snmpUserName: SomeValue  # string, required
    userName: SomeValue  # string, required
    computeDevice: True  # boolean
    extendedDiscoveryInfo: SomeValue  # string
    httpPassword: SomeValue  # string
    httpPort: SomeValue  # string
    httpSecure: True  # boolean
    httpUserName: SomeValue  # string
    merakiOrgId:
    - SomeValue  # string
    netconfPort: SomeValue  # string
    serialNumber: SomeValue  # string
    snmpVersion: SomeValue  # string
    type: # valid values are 'COMPUTE_DEVICE',
      # 'MERAKI_DASHBOARD',
      # 'NETWORK_DEVICE',
      # 'NODATACHANGE'.
      SomeValue  # string
    updateMgmtIPaddressList:
    - existMgmtIpAddress: SomeValue  # string
      newMgmtIpAddress: SomeValue  # string
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: sync_devices
  cisco.dnac.network_device:
    state: update  # required
    cliTransport: SomeValue  # string, required
    enablePassword: SomeValue  # string, required
    ipAddress:  # required
    - SomeValue  # string
    password: SomeValue  # string, required
    snmpAuthPassphrase: SomeValue  # string, required
    snmpAuthProtocol: SomeValue  # string, required
    snmpMode: SomeValue  # string, required
    snmpPrivPassphrase: SomeValue  # string, required
    snmpPrivProtocol: SomeValue  # string, required
    snmpROCommunity: SomeValue  # string, required
    snmpRWCommunity: SomeValue  # string, required
    snmpRetry: 1  #  integer, required
    snmpTimeout: 1  #  integer, required
    snmpUserName: SomeValue  # string, required
    userName: SomeValue  # string, required
    computeDevice: True  # boolean
    extendedDiscoveryInfo: SomeValue  # string
    httpPassword: SomeValue  # string
    httpPort: SomeValue  # string
    httpSecure: True  # boolean
    httpUserName: SomeValue  # string
    merakiOrgId:
    - SomeValue  # string
    netconfPort: SomeValue  # string
    serialNumber: SomeValue  # string
    snmpVersion: SomeValue  # string
    type: # valid values are 'COMPUTE_DEVICE',
      # 'MERAKI_DASHBOARD',
      # 'NETWORK_DEVICE',
      # 'NODATACHANGE'.
      SomeValue  # string
    updateMgmtIPaddressList:
    - existMgmtIpAddress: SomeValue  # string
      newMgmtIpAddress: SomeValue  # string
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: delete_device_by_id
  cisco.dnac.network_device:
    state: delete  # required
    id: SomeValue  # string, required
    is_force_delete: True  # boolean
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get_device_by_id
  cisco.dnac.network_device:
    state: query  # required
    id: SomeValue  # string, required
  register: nm_get_device_by_id
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get_device_summary
  cisco.dnac.network_device:
    state: query  # required
    id: SomeValue  # string, required
    summary: True  # boolean, required
  register: nm_get_device_summary
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get_network_device_by_pagination_range
  cisco.dnac.network_device:
    state: query  # required
    records_to_return: 1  #  integer, required
    start_index: 1  #  integer, required
  register: nm_get_network_device_by_pagination_range
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get_device_count
  cisco.dnac.network_device:
    state: query  # required
    count: True  # boolean, required
  register: nm_get_device_count
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get_network_device_by_ip
  cisco.dnac.network_device:
    state: query  # required
    ip_address: SomeValue  # string, required
  register: nm_get_network_device_by_ip
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: get_device_by_serial_number
  cisco.dnac.network_device:
    state: query  # required
    serial_number: SomeValue  # string, required
  register: nm_get_device_by_serial_number

Inputs

    
id:
    description:
    - 'Accepts comma separated id''s and return list of network-devices for the given
      id''s. If invalid or not- found id''s are provided, null entry will be returned
      in the list.

      '
    - Device ID.
    - Required for states query and delete.
    type: str

role:
    description:
    - Role query parameter.
    type: str

type:
    description:
    - Type query parameter.
    - InventoryDeviceInfo's type.
    type: str

count:
    description:
    - If true gets the number of objects.
    - Required for state query.
    type: bool

family:
    description:
    - Family query parameter.
    type: str

series:
    description:
    - Series query parameter.
    type: str

summary:
    description:
    - If true gets the summary.
    - Required for state query.
    type: bool

up_time:
    description:
    - UpTime query parameter.
    type: str

hostname:
    description:
    - Hostname query parameter.
    type: str

httpPort:
    description:
    - InventoryDeviceInfo's httpPort.
    type: str

location:
    description:
    - Location query parameter.
    type: str

password:
    description:
    - InventoryDeviceInfo's password.
    required: true
    type: str

snmpMode:
    description:
    - InventoryDeviceInfo's snmpMode.
    required: true
    type: str

userName:
    description:
    - InventoryDeviceInfo's userName.
    required: true
    type: str

ipAddress:
    description:
    - InventoryDeviceInfo's ipAddress (list of strings).
    required: true
    type: list

snmpRetry:
    description:
    - InventoryDeviceInfo's snmpRetry.
    required: true
    type: int

error_code:
    description:
    - ErrorCode query parameter.
    type: str

httpSecure:
    description:
    - InventoryDeviceInfo's httpSecure.
    type: bool

ip_address:
    description:
    - Device IP address.
    - Required for state query.
    type: str

mac_address:
    description:
    - MacAddress query parameter.
    type: str

merakiOrgId:
    description:
    - InventoryDeviceInfo's merakiOrgId (list of strings).
    type: list

module_name:
    description:
    - Module+name query parameter.
    type: str

netconfPort:
    description:
    - InventoryDeviceInfo's netconfPort.
    type: str

platform_id:
    description:
    - PlatformId query parameter.
    type: str

snmpTimeout:
    description:
    - InventoryDeviceInfo's snmpTimeout.
    required: true
    type: int

snmpVersion:
    description:
    - InventoryDeviceInfo's snmpVersion.
    type: str

start_index:
    description:
    - Start index.
    - Required for state query.
    type: int

cliTransport:
    description:
    - InventoryDeviceInfo's cliTransport.
    required: true
    type: str

httpPassword:
    description:
    - InventoryDeviceInfo's httpPassword.
    type: str

httpUserName:
    description:
    - InventoryDeviceInfo's httpUserName.
    type: str

license_name:
    description:
    - License.name query parameter.
    type: str

license_type:
    description:
    - License.type query parameter.
    type: str

serialNumber:
    description:
    - InventoryDeviceInfo's serialNumber.
    type: str

snmpUserName:
    description:
    - InventoryDeviceInfo's snmpUserName.
    required: true
    type: str

computeDevice:
    description:
    - InventoryDeviceInfo's computeDevice.
    type: bool

location_name:
    description:
    - LocationName query parameter.
    type: str

serial_number:
    description:
    - SerialNumber query parameter.
    - Device serial number.
    - Required for state query.
    type: str

software_type:
    description:
    - SoftwareType query parameter.
    type: str

enablePassword:
    description:
    - InventoryDeviceInfo's enablePassword.
    required: true
    type: str

license_status:
    description:
    - License.status query parameter.
    type: str

is_force_delete:
    description:
    - IsForceDelete query parameter.
    type: bool

snmpROCommunity:
    description:
    - InventoryDeviceInfo's snmpROCommunity.
    required: true
    type: str

snmpRWCommunity:
    description:
    - InventoryDeviceInfo's snmpRWCommunity.
    required: true
    type: str

snmpAuthProtocol:
    description:
    - InventoryDeviceInfo's snmpAuthProtocol.
    required: true
    type: str

snmpPrivProtocol:
    description:
    - InventoryDeviceInfo's snmpPrivProtocol.
    required: true
    type: str

software_version:
    description:
    - SoftwareVersion query parameter.
    type: str

associated_wlc_ip:
    description:
    - AssociatedWlcIp query parameter.
    type: str

collection_status:
    description:
    - CollectionStatus query parameter.
    type: str

error_description:
    description:
    - ErrorDescription query parameter.
    type: str

module_partnumber:
    description:
    - Module+partnumber query parameter.
    type: str

records_to_return:
    description:
    - Number of records to return.
    - Required for state query.
    type: int

snmpAuthPassphrase:
    description:
    - InventoryDeviceInfo's snmpAuthPassphrase.
    required: true
    type: str

snmpPrivPassphrase:
    description:
    - InventoryDeviceInfo's snmpPrivPassphrase.
    required: true
    type: str

collection_interval:
    description:
    - CollectionInterval query parameter.
    type: str

module_servicestate:
    description:
    - Module+servicestate query parameter.
    type: str

reachability_status:
    description:
    - ReachabilityStatus query parameter.
    type: str

module_equpimenttype:
    description:
    - Module+equpimenttype query parameter.
    type: str

extendedDiscoveryInfo:
    description:
    - InventoryDeviceInfo's extendedDiscoveryInfo.
    type: str

management_ip_address:
    description:
    - ManagementIpAddress query parameter.
    type: str

not_synced_for_minutes:
    description:
    - NotSyncedForMinutes query parameter.
    type: str

updateMgmtIPaddressList:
    description:
    - InventoryDeviceInfo's updateMgmtIPaddressList (list of objects).
    elements: dict
    suboptions:
      existMgmtIpAddress:
        description:
        - It is the network device's existMgmtIpAddress.
        type: str
      newMgmtIpAddress:
        description:
        - It is the network device's newMgmtIpAddress.
        type: str
    type: list

module_operationstatecode:
    description:
    - Module+operationstatecode query parameter.
    type: str

module_vendorequipmenttype:
    description:
    - Module+vendorequipmenttype query parameter.
    type: str

Outputs

dnac_response:
  description: A dictionary with the response returned by the DNA Center Python SDK
  returned: always
  sample:
    response: 29
    version: '1.0'
  type: dict
missing_params:
  description: Provided arguments do not comply with the schema of the DNA Center
    Python SDK function
  returned: when the function request schema is not satisfied
  sample: null
  type: list
sdk_function:
  description: The DNA Center SDK function used to execute the task
  returned: always
  sample: devices.add_device
  type: str

See also