cisco.catalystcenter.pnp_network_devices_info module -- Information module for Pnp Network Devices

Note

This module is part of the cisco.catalystcenter collection (version 2.11.0).

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

To use it in a playbook, specify: cisco.catalystcenter.pnp_network_devices_info.

New in cisco.catalystcenter 2.11.0

Synopsis

  • Get all Pnp Network Devices.

  • Get Pnp Network Devices by id.

  • Retrieves details of Plug and Play PNP devices based on specified parameters.

  • Retrieves details of a specific Plug and Play PNP device using its unique identifier.

Note

This module has a corresponding action plugin.

Requirements

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

  • catalystcentersdk >= 3.2.3.0.0

  • python >= 3.12

Parameters

Parameter

Comments

catalystcenter_debug

aliases: dnac_debug

boolean

Flag for Cisco Catalyst Center SDK to enable debugging.

Choices:

catalystcenter_host

aliases: dnac_host

string / required

The Cisco Catalyst Center hostname.

catalystcenter_password

aliases: dnac_password

string

The Cisco Catalyst Center password to authenticate.

catalystcenter_port

aliases: dnac_port, catalystcenter_api_port

integer

The Cisco Catalyst Center port.

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

catalystcenter_username

aliases: dnac_username, user

string

The Cisco Catalyst Center username to authenticate.

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

catalystcenter_verify

aliases: dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

catalystcenter_version

aliases: dnac_version

string

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

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

contactedStatus

string

ContactedStatus query parameter. Indicates whether a device has contacted PnP.

headers

dictionary

Additional headers.

hostname

string

Hostname query parameter. The hostname of the device.

id

string

Id path parameter. Unique identifier for the device in PnP.

imageVersion

string

ImageVersion query parameter. The image version of the device.

limit

integer

Limit query parameter. The number of records to show for this page.

macAddress

string

MacAddress query parameter. The MAC address of the device.

offset

integer

Offset query parameter. The first record to show for this page; the first record is numbered 1.

onboardingState

string

OnboardingState query parameter. The state of the workflow being executed on the device. Possible values are | Onboarding State | Description |-----------------------------------|--------------------------------------------------------| | `NOT_CONTACTED` | Device has not yet been claimed. | | `CONNECTING` | The device is establishing a connection with the PnP server. | | `ERROR_SECURING_CONNECTION` | The device failed to establish a connection with the PnP server (e.g., TLS/SSL issues). | | `ERROR_AUTHENTICATING` | The device failed to establish a secure connection with the PnP server. | | `INITIALIZING` | The PnP server is collecting initial device information. | | `INITIALIZED` | The PnP server has collected initial device information. | | `ERROR_INITIALIZING` | The PnP server failed to collect initial device information. | | `ERROR_INITIALIZED_TIMEOUT` | The device stopped contacting PnP server while collecting initial device information. | | `SUDI_AUTHORIZING` | The device is undergoing Secure Unique Device Identifier (SUDI) authorization. | | `ERROR_SUDI_AUTHORIZING` | The device failed during SUDI authorization. | | `SUDI_AUTHORIZED` | The device has successfully completed SUDI authorization. | | `EXECUTING_WORKFLOW` | The device is actively executing its onboarding workflow. | | `EXECUTED_WORKFLOW` | The device has successfully completed its onboarding workflow. | | `ERROR_EXECUTING_WORKFLOW` | The device encountered an error while executing the onboarding workflow. | | `EXECUTING_RESET` | The device is currently being reset. | | `ERROR_EXECUTING_RESET` | The device encountered an error while performing the reset. |.

order

string

Order query parameter. Whether ascending or descending order should be used to sort the response.

pid

string

Pid query parameter. The product ID of the device.

serialNumber

string

SerialNumber query parameter. The serial number of the device.

siteNameHierarchy

string

SiteNameHierarchy query parameter. Hierarchical name of the site the device has been claimed to. A list of site names can be fetched from the `GET /dna/intent/api/v1/sites` API.

smartAccount

string

SmartAccount query parameter. The Smart Account associated with the device.

sortBy

string

SortBy query parameter. A property within the response to sort by.

source

string

Source query parameter. The method used to add the device to PnP. | status | Description | | ---------------------- | ------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------- ------------------ | | `NETWORK` | The device discovered and joined PnP over the network. | | `USER` | The device was added to PnP through the UI or API. | | `SMART_ACCOUNT` | The device redirected to PnP through PnP Connect service.

state_

string

State query parameter. The state of the device in the PnP process. Possible values are | State | Description |-----------------------------------|--------------------------------------------------------| | `UNCLAIMED` | Device has not yet been claimed. | | `PENDING_AUTHORIZATION` | Device has been claimed, but requires explicit authorization to start onboarding. This is applicable for Extended Node onboarding workflows. | | `PLANNED` | Device has been claimed. Once it discovers the PnP server, the onboarding workflow will begin. | | `ONBOARDING` | Device has begun the onboarding workflow. | | `PROVISIONED` | Device has completed the onboarding workflow. | | `ERROR` | Device could not complete the onboarding workflow. | | `RESETTING` | Device is in the process of being reset. | | `DELETED` | Device has been deleted and will soon be cleared from the database. |.

svlClaimable

boolean

SvlClaimable query parameter. Indicates whether the device has any neighbors capable of forming a StackWise-Virtual (SVL) link.

Choices:

svlDevice

boolean

SvlDevice query parameter. Indicates whether the device has a formed StackWise-Virtual (SVL) pair.

Choices:

validate_response_schema

boolean

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

Choices:

virtualAccount

string

VirtualAccount query parameter. The Virtual Account associated with the device.

Notes

Note

  • SDK Method used are device_onboarding_pnp.DeviceOnboardingPnp.get_pnp_device_details, device_onboarding_pnp.DeviceOnboardingPnp.get_pnp_device_details_by_id,

  • Paths used are get /dna/intent/api/v1/pnpNetworkDevices, get /dna/intent/api/v1/pnpNetworkDevices/{id},

  • Supports check_mode

  • The plugin runs on the control node and does not use any ansible connection plugins,

  • but instead uses the embedded connection manager from Cisco CATALYST SDK

  • Requires Python >= 3.10, matching the controller Python versions supported by the collection's minimum ansible-core version (see the collection README for the current ansible-core / Python compatibility range)

See Also

See also

Cisco Catalyst Center documentation for Device Onboarding (PnP) GetPnPDeviceDetails

Complete reference of the GetPnPDeviceDetails API.

Cisco Catalyst Center documentation for Device Onboarding (PnP) GetPnPDeviceDetailsByID

Complete reference of the GetPnPDeviceDetailsByID API.

Examples

---
- name: Get all Pnp Network Devices
  cisco.catalystcenter.pnp_network_devices_info:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    headers: "{{my_headers | from_json}}"
    serialNumber: string
    macAddress: str
    state_: string
    onboardingState: string
    hostname: string
    pid: string
    siteNameHierarchy: string
    source: string
    smartAccount: string
    virtualAccount: string
    imageVersion: string
    contactedStatus: string
    svlClaimable: true
    svlDevice: true
    offset: 1
    limit: 0
    sortBy: string
    order: asc
  register: result
- name: Get Pnp Network Devices by id
  cisco.catalystcenter.pnp_network_devices_info:
    catalystcenter_host: "{{catalystcenter_host}}"
    catalystcenter_username: "{{catalystcenter_username}}"
    catalystcenter_password: "{{catalystcenter_password}}"
    catalystcenter_verify: "{{catalystcenter_verify}}"
    catalystcenter_port: "{{catalystcenter_port}}"
    catalystcenter_version: "{{catalystcenter_version}}"
    catalystcenter_debug: "{{catalystcenter_debug}}"
    headers: "{{my_headers | from_json}}"
    id: string
  register: result

Return Values

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

Key

Description

catalystcenter_response

dictionary

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

Returned: always

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

Authors

  • Bryan Vargas (@bvargasre)