cisco.dnac.discoverys module -- Resource module for Discoverys

Note

This module is part of the cisco.dnac collection (version 6.46.0).

To install it, use: ansible-galaxy collection install cisco.dnac. You need further requirements to be able to use this module, see Requirements for details.

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

New in cisco.dnac 6.46.0

Synopsis

  • Manage operations create, update and delete of the resource Discoverys. - > This API creates a discovery. The response includes a task url that provides access to the task's details. By accessing this URL, users will receive a response containing a resultLocation attribute, which provides details of the discovery settings that was created, including the discovery id.

  • API to delete discovery by the given discovery id. - > API to edit the discovery details of the given discovery id. Updating the discovery details while the discovery is in progress is not allowed.

Note

This module has a corresponding action plugin.

Requirements

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

  • dnacentersdk >= 2.11.0

  • python >= 3.12

Parameters

Parameter

Comments

credentials

dictionary

Discoverys's credentials.

cli

dictionary

Discoverys's cli.

description

string

Description for CLI credential.

globalCredentialIdList

list / elements=string

List of global credential ids.

protocolOrder

string

Connection protocol for the device. Default value is SSH.

username

string

CLI username to login to the device.

httpRead

dictionary

Discoverys's httpRead.

description

string

Description for HTTP(S) read credentials.

globalCredentialIdList

list / elements=string

List of global credential ids.

port

integer

Number of the TCP/UDP port that is used for HTTPS traffic. The default is port number 443 (the well-known port for HTTPS).

protocol

string

Protocol for HTTP credentials.

username

string

Name that is used to authenticate the HTTPS connection. Username cannot contain spaces or angle brackets (< >).

httpWrite

dictionary

Discoverys's httpWrite.

description

string

Description for HTTP(S) write credentials.

globalCredentialIdList

list / elements=string

List of global credential ids.

port

integer

Number of the TCP/UDP port that is used for HTTPS traffic. The default is port number 443 (the well-known port for HTTPS).

protocol

string

Protocol for HTTP credentials.

username

string

Name that is used to authenticate the HTTPS connection. Username cannot contain spaces or angle brackets (< >).

netconf

dictionary

Discoverys's netconf.

description

string

Description for NETCONF credential.

globalCredentialIdList

list / elements=string

List of global credential ids.

port

integer

Netconf Port of the device. Recommended port number is 830.

snmp

dictionary

Discoverys's snmp.

retries

integer

The number of times to repeat the failed SNMP polling request after a timeout. Max value supported is 3. Default is Global SNMP retry (if exists) or 3.

snmpV2Read

dictionary

Discoverys's snmpV2Read.

description

string

Description for SNMP read-only community.

globalCredentialIdList

list / elements=string

List of global credential ids.

snmpV2Write

dictionary

Discoverys's snmpV2Write.

description

string

Description for SNMP read-write community.

globalCredentialIdList

list / elements=string

List of global credential ids.

snmpV3

dictionary

Discoverys's snmpV3.

authType

string

SNMP authentication type. Required if the SNMP security mode is AUTHPRIV or AUTHNOPRIV.

description

string

Description for SNMP V3 credential.

globalCredentialIdList

list / elements=string

List of global credential ids.

mode

string

Security level that an SNMP message requires.

privacyType

string

SNMP privacy type. Required if the SNMP mode is AUTHPRIV.

username

string

Username associated with the SNMPv3 settings. The username can only contain letters, numbers and -_.@ characters.

timeout

integer

The interval (in seconds) after which SNMP failure to respond to the polling request generates a timeout. Max value supported is 300. Default is Global SNMP timeout (if exists) or 5.

discoveryTypeDetails

dictionary

Discoverys's discoveryTypeDetails.

cidrAddress

dictionary

Discoverys's cidrAddress.

cidrPrefix

string

CIDR prefix for the IP address.

cidrSuffix

integer

The CIDR suffix length indicates the number of bits for host addresses, following the prefix. For IPv4, supported lengths range from 20 to 30, where default is 30. For IPv6, they range from 116 to 126, where default is 126.

hopCount

integer

This field defines the CDP level, indicating the number of hops from the seed device to scan. Acceptable values range from 1 to 16, with a default of 16. For instance, a CDP level of 3 means scanning will include up to three hops from the seed device.

ipAddress

string

IPv4 or IPv6 address of the device.

range

list / elements=dictionary

Discoverys's range.

ipAddressEnd

string

End IP address of devices to be discovered.

ipAddressStart

string

Start IP address of the devices to be discovered.

subnetFilter

dictionary

Discoverys's subnetFilter.

cidrAddress

dictionary

Discoverys's cidrAddress.

cidrPrefix

string

CIDR prefix for the IP address.

cidrSuffix

integer

The CIDR suffix length indicates the number of bits for host addresses, following the prefix. For IPv4, supported lengths range from 20 to 30, where default is 30. For IPv6, they range from 116 to 126, where default is 126.

ipAddress

string

IPv4 or IPv6 address of the device.

type

string

Type of the discovery.

dnac_debug

boolean

Flag for Cisco DNA Center SDK to enable debugging.

Choices:

dnac_host

string / required

The Cisco DNA Center hostname.

dnac_password

string

The Cisco DNA Center password to authenticate.

dnac_port

integer

The Cisco DNA Center port.

Default: :ansible-option-default:`443`

dnac_username

aliases: user

string

The Cisco DNA Center username to authenticate.

Default: :ansible-option-default:`"admin"`

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

dnac_version

string

Informs the SDK which version of Cisco DNA Center to use.

Default: :ansible-option-default:`"3.1.6.0"`

id

string

Id path parameter. The id of the discovery.

managementIpSelectionMethod

string

When Catalyst Center discovers a device, it uses one of the device's IP addresses as the preferred management IP address for the device. The IP address can be that of a built-in management interface of the device, another physical interface, or a logical interface like Loopback0. You can configure Catalyst Center to log the device's loopback IP address as the preferred management IP address, provided the IP address is reachable from Catalyst Center.

name

string

The name of the discovery job being created. This will be a unique name.

onlyNewDevice

boolean

This flag indicates to discover only new devices that are not in inventory. If set to true, only devices that are not in the inventory will be discovered. If set to false, devices that already exist in the inventory will not be listed in the discovered devices list.

Choices:

updateManagementIp

boolean

This flag indicates if the management IP address of existing devices to be updated as part of this discovery. If set false devices get discovered with the existing management IP address. If set true it overwrites the management IP address with the new IP address used in discovery.

Choices:

validate_response_schema

boolean

Flag for Cisco DNA Center SDK to enable the validation of request bodies against a JSON schema.

Choices:

Notes

Note

  • SDK Method used are devices.Devices.creates_discovery, devices.Devices.deletes_discovery_by_id, devices.Devices.edits_discovery,

  • Paths used are post /dna/intent/api/v1/discoverys, delete /dna/intent/api/v1/discoverys/{id}, put /dna/intent/api/v1/discoverys/{id},

  • Does not support check_mode

  • The plugin runs on the control node and does not use any ansible connection plugins, but instead the embedded connection manager from Cisco DNAC SDK

  • The parameters starting with dnac_ are used by the Cisco DNAC Python SDK to establish the connection

See Also

See also

Cisco DNA Center documentation for Devices CreatesDiscovery

Complete reference of the CreatesDiscovery API.

Cisco DNA Center documentation for Devices DeletesDiscoveryById

Complete reference of the DeletesDiscoveryById API.

Cisco DNA Center documentation for Devices EditsDiscovery

Complete reference of the EditsDiscovery API.

Examples

---
- name: Create
  cisco.dnac.discoverys:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    state: present
    credentials:
      cli:
        description: string
        globalCredentialIdList:
          - string
        protocolOrder: string
        username: string
      httpRead:
        description: string
        globalCredentialIdList:
          - string
        port: 0
        protocol: string
        username: string
      httpWrite:
        description: string
        globalCredentialIdList:
          - string
        port: 0
        protocol: string
        username: string
      netconf:
        description: string
        globalCredentialIdList:
          - string
        port: 0
      snmp:
        retries: 0
        snmpV2Read:
          description: string
          globalCredentialIdList:
            - string
        snmpV2Write:
          description: string
          globalCredentialIdList:
            - string
        snmpV3:
          authType: string
          description: string
          globalCredentialIdList:
            - string
          mode: string
          privacyType: string
          username: string
        timeout: 0
    discoveryTypeDetails:
      cidrAddress:
        cidrPrefix: string
        cidrSuffix: 0
      hopCount: 0
      ipAddress: string
      range:
        - ipAddressEnd: string
          ipAddressStart: string
      subnetFilter:
        cidrAddress:
          cidrPrefix: string
          cidrSuffix: 0
        ipAddress: string
      type: string
    managementIpSelectionMethod: string
    name: string
    onlyNewDevice: true
    updateManagementIp: true
- name: Delete by id
  cisco.dnac.discoverys:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    state: absent
    id: string
- name: Update by id
  cisco.dnac.discoverys:
    dnac_host: "{{dnac_host}}"
    dnac_username: "{{dnac_username}}"
    dnac_password: "{{dnac_password}}"
    dnac_verify: "{{dnac_verify}}"
    dnac_port: "{{dnac_port}}"
    dnac_version: "{{dnac_version}}"
    dnac_debug: "{{dnac_debug}}"
    state: present
    credentials:
      cli:
        description: string
        globalCredentialIdList:
          - string
        protocolOrder: string
        username: string
      httpRead:
        description: string
        globalCredentialIdList:
          - string
        port: 0
        protocol: string
        username: string
      httpWrite:
        description: string
        globalCredentialIdList:
          - string
        port: 0
        protocol: string
        username: string
      netconf:
        description: string
        globalCredentialIdList:
          - string
        port: 0
      snmp:
        retries: 0
        snmpV2Read:
          description: string
          globalCredentialIdList:
            - string
        snmpV2Write:
          description: string
          globalCredentialIdList:
            - string
        snmpV3:
          authType: string
          description: string
          globalCredentialIdList:
            - string
          mode: string
          privacyType: string
          username: string
        timeout: 0
    discoveryTypeDetails:
      cidrAddress:
        cidrPrefix: string
        cidrSuffix: 0
      hopCount: 0
      ipAddress: string
      range:
        - ipAddressEnd: string
          ipAddressStart: string
      subnetFilter:
        cidrAddress:
          cidrPrefix: string
          cidrSuffix: 0
        ipAddress: string
      type: string
    id: string
    managementIpSelectionMethod: string
    onlyNewDevice: true
    updateManagementIp: true

Return Values

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

Key

Description

dnac_response

dictionary

A dictionary or list with the response returned by the Cisco DNAC Python SDK

Returned: always

Sample: :ansible-rv-sample-value:`{"response": {"taskId": "string", "url": "string"}, "version": "string"}`

Authors

  • Rafael Campos (@racampos)