cisco.dnac.pnp_device_info module – Information module for Pnp Device

Note

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

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

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

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

New in version 3.1.0: of cisco.dnac

Synopsis

  • Get all Pnp Device.

  • Get Pnp Device by id.

  • Returns device details specified by device id.

  • Returns list of devices based on filter crieteria. If a limit is not specified, it will default to return 50 devices. Pagination and sorting are also supported by this endpoint.

Note

This module has a corresponding action plugin.

Requirements

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

  • dnacentersdk >= 2.5.0

  • python >= 3.5

Parameters

Parameter

Comments

cmState

list / elements=string

CmState query parameter. Device Connection Manager State.

dnac_debug

boolean

Flag for Cisco DNA Center SDK to enable debugging.

Choices:

  • no ← (default)

  • yes

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: 443

dnac_username

aliases: user

string

The Cisco DNA Center username to authenticate.

Default: “admin”

dnac_verify

boolean

Flag to enable or disable SSL certificate verification.

Choices:

  • no

  • yes ← (default)

dnac_version

string

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

Default: “2.3.3.0”

headers

dictionary

Additional headers.

hostname

string

Hostname query parameter. Device Hostname.

id

string

Id path parameter.

lastContact

boolean

LastContact query parameter. Device Has Contacted lastContact > 0.

Choices:

  • no

  • yes

limit

integer

Limit query parameter. Limits number of results.

macAddress

string

MacAddress query parameter. Device Mac Address.

name

list / elements=string

Name query parameter. Device Name.

offset

integer

Offset query parameter. Index of first result.

onbState

list / elements=string

OnbState query parameter. Device Onboarding State.

pid

list / elements=string

Pid query parameter. Device ProductId.

projectId

list / elements=string

ProjectId query parameter. Device Project Id.

projectName

list / elements=string

ProjectName query parameter. Device Project Name.

serialNumber

list / elements=string

SerialNumber query parameter. Device Serial Number.

siteName

string

SiteName query parameter. Device Site Name.

smartAccountId

list / elements=string

SmartAccountId query parameter. Device Smart Account.

sort

list / elements=string

Sort query parameter. Comma seperated list of fields to sort on.

sortOrder

string

SortOrder query parameter. Sort Order Ascending (asc) or Descending (des).

source

list / elements=string

Source query parameter. Device Source.

state_

list / elements=string

State query parameter. Device State.

validate_response_schema

boolean

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

Choices:

  • no

  • yes ← (default)

virtualAccountId

list / elements=string

VirtualAccountId query parameter. Device Virtual Account.

workflowId

list / elements=string

WorkflowId query parameter. Device Workflow Id.

workflowName

list / elements=string

WorkflowName query parameter. Device Workflow Name.

Notes

Note

  • SDK Method used are device_onboarding_pnp.DeviceOnboardingPnp.get_device_by_id, device_onboarding_pnp.DeviceOnboardingPnp.get_device_list,

  • Paths used are get /dna/intent/api/v1/onboarding/pnp-device, get /dna/intent/api/v1/onboarding/pnp-device/{id},

  • Supports 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

Examples

- name: Get all Pnp Device
  cisco.dnac.pnp_device_info:
    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}}"
    headers: "{{my_headers | from_json}}"
    limit: 0
    offset: 0
    sort: []
    sortOrder: string
    serialNumber: []
    state_: []
    onbState: []
    cmState: []
    name: []
    pid: []
    source: []
    projectId: []
    workflowId: []
    projectName: []
    workflowName: []
    smartAccountId: []
    virtualAccountId: []
    lastContact: True
    macAddress: string
    hostname: string
    siteName: string
  register: result

- name: Get Pnp Device by id
  cisco.dnac.pnp_device_info:
    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}}"
    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

dnac_response

dictionary

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

Returned: always

Sample: “{\n \”_id\”: \”string\”,\n \”deviceInfo\”: {\n \”source\”: \”string\”,\n \”serialNumber\”: \”string\”,\n \”stack\”: true,\n \”mode\”: \”string\”,\n \”state\”: \”string\”,\n \”location\”: {\n \”siteId\”: \”string\”,\n \”address\”: \”string\”,\n \”latitude\”: \”string\”,\n \”longitude\”: \”string\”,\n \”altitude\”: \”string\”\n },\n \”description\”: \”string\”,\n \”onbState\”: \”string\”,\n \”authenticatedMicNumber\”: \”string\”,\n \”authenticatedSudiSerialNo\”: \”string\”,\n \”capabilitiesSupported\”: [\n \”string\”\n ],\n \”featuresSupported\”: [\n \”string\”\n ],\n \”cmState\”: \”string\”,\n \”firstContact\”: 0,\n \”lastContact\”: 0,\n \”macAddress\”: \”string\”,\n \”pid\”: \”string\”,\n \”deviceSudiSerialNos\”: [\n \”string\”\n ],\n \”lastUpdateOn\”: 0,\n \”workflowId\”: \”string\”,\n \”workflowName\”: \”string\”,\n \”projectId\”: \”string\”,\n \”projectName\”: \”string\”,\n \”deviceType\”: \”string\”,\n \”agentType\”: \”string\”,\n \”imageVersion\”: \”string\”,\n \”fileSystemList\”: [\n {\n \”type\”: \”string\”,\n \”writeable\”: true,\n \”freespace\”: 0,\n \”name\”: \”string\”,\n \”readable\”: true,\n \”size\”: 0\n }\n ],\n \”pnpProfileList\”: [\n {\n \”profileName\”: \”string\”,\n \”discoveryCreated\”: true,\n \”createdBy\”: \”string\”,\n \”primaryEndpoint\”: {\n \”port\”: 0,\n \”protocol\”: \”string\”,\n \”ipv4Address\”: {},\n \”ipv6Address\”: {},\n \”fqdn\”: \”string\”,\n \”certificate\”: \”string\”\n },\n \”secondaryEndpoint\”: {\n \”port\”: 0,\n \”protocol\”: \”string\”,\n \”ipv4Address\”: {},\n \”ipv6Address\”: {},\n \”fqdn\”: \”string\”,\n \”certificate\”: \”string\”\n }\n }\n ],\n \”imageFile\”: \”string\”,\n \”httpHeaders\”: [\n {\n \”key\”: \”string\”,\n \”value\”: \”string\”\n }\n ],\n \”neighborLinks\”: [\n {\n \”localInterfaceName\”: \”string\”,\n \”localShortInterfaceName\”: \”string\”,\n \”localMacAddress\”: \”string\”,\n \”remoteInterfaceName\”: \”string\”,\n \”remoteShortInterfaceName\”: \”string\”,\n \”remoteMacAddress\”: \”string\”,\n \”remoteDeviceName\”: \”string\”,\n \”remotePlatform\”: \”string\”,\n \”remoteVersion\”: \”string\”\n }\n ],\n \”lastSyncTime\”: 0,\n \”ipInterfaces\”: [\n {\n \”status\”: \”string\”,\n \”macAddress\”: \”string\”,\n \”ipv4Address\”: {},\n \”ipv6AddressList\”: [\n {}\n ],\n \”name\”: \”string\”\n }\n ],\n \”hostname\”: \”string\”,\n \”authStatus\”: \”string\”,\n \”stackInfo\”: {\n \”supportsStackWorkflows\”: true,\n \”isFullRing\”: true,\n \”stackMemberList\”: [\n {\n \”serialNumber\”: \”string\”,\n \”state\”: \”string\”,\n \”role\”: \”string\”,\n \”macAddress\”: \”string\”,\n \”pid\”: \”string\”,\n \”licenseLevel\”: \”string\”,\n \”licenseType\”: \”string\”,\n \”sudiSerialNumber\”: \”string\”,\n \”hardwareVersion\”: \”string\”,\n \”stackNumber\”: 0,\n \”softwareVersion\”: \”string\”,\n \”priority\”: 0\n }\n ],\n \”stackRingProtocol\”: \”string\”,\n \”validLicenseLevels\”: [\n \”string\”\n ],\n \”totalMemberCount\”: 0\n },\n \”reloadRequested\”: true,\n \”addedOn\”: 0,\n \”siteId\”: \”string\”,\n \”aaaCredentials\”: {\n \”password\”: \”string\”,\n \”username\”: \”string\”\n },\n \”userMicNumbers\”: [\n \”string\”\n ],\n \”userSudiSerialNos\”: [\n \”string\”\n ],\n \”addnMacAddrs\”: [\n \”string\”\n ],\n \”preWorkflowCliOuputs\”: [\n {\n \”cli\”: \”string\”,\n \”cliOutput\”: \”string\”\n }\n ],\n \”tags\”: {},\n \”sudiRequired\”: true,\n \”smartAccountId\”: \”string\”,\n \”virtualAccountId\”: \”string\”,\n \”populateInventory\”: true,\n \”siteName\”: \”string\”,\n \”name\”: \”string\”\n },\n \”systemResetWorkflow\”: {\n \”_id\”: \”string\”,\n \”state\”: \”string\”,\n \”type\”: \”string\”,\n \”description\”: \”string\”,\n \”lastupdateOn\”: 0,\n \”imageId\”: \”string\”,\n \”currTaskIdx\”: 0,\n \”addedOn\”: 0,\n \”tasks\”: [\n {\n \”state\”: \”string\”,\n \”type\”: \”string\”,\n \”currWorkItemIdx\”: 0,\n \”taskSeqNo\”: 0,\n \”endTime\”: 0,\n \”startTime\”: 0,\n \”workItemList\”: [\n {\n \”state\”: \”string\”,\n \”command\”: \”string\”,\n \”outputStr\”: \”string\”,\n \”endTime\”: 0,\n \”startTime\”: 0,\n \”timeTaken\”: 0\n }\n ],\n \”timeTaken\”: 0,\n \”name\”: \”string\”\n }\n ],\n \”addToInventory\”: true,\n \”instanceType\”: \”string\”,\n \”endTime\”: 0,\n \”execTime\”: 0,\n \”startTime\”: 0,\n \”useState\”: \”string\”,\n \”configId\”: \”string\”,\n \”name\”: \”string\”,\n \”version\”: 0,\n \”tenantId\”: \”string\”\n },\n \”systemWorkflow\”: {\n \”_id\”: \”string\”,\n \”state\”: \”string\”,\n \”type\”: \”string\”,\n \”description\”: \”string\”,\n \”lastupdateOn\”: 0,\n \”imageId\”: \”string\”,\n \”currTaskIdx\”: 0,\n \”addedOn\”: 0,\n \”tasks\”: [\n {\n \”state\”: \”string\”,\n \”type\”: \”string\”,\n \”currWorkItemIdx\”: 0,\n \”taskSeqNo\”: 0,\n \”endTime\”: 0,\n \”startTime\”: 0,\n \”workItemList\”: [\n {\n \”state\”: \”string\”,\n \”command\”: \”string\”,\n \”outputStr\”: \”string\”,\n \”endTime\”: 0,\n \”startTime\”: 0,\n \”timeTaken\”: 0\n }\n ],\n \”timeTaken\”: 0,\n \”name\”: \”string\”\n }\n ],\n \”addToInventory\”: true,\n \”instanceType\”: \”string\”,\n \”endTime\”: 0,\n \”execTime\”: 0,\n \”startTime\”: 0,\n \”useState\”: \”string\”,\n \”configId\”: \”string\”,\n \”name\”: \”string\”,\n \”version\”: 0,\n \”tenantId\”: \”string\”\n },\n \”workflow\”: {\n \”_id\”: \”string\”,\n \”state\”: \”string\”,\n \”type\”: \”string\”,\n \”description\”: \”string\”,\n \”lastupdateOn\”: 0,\n \”imageId\”: \”string\”,\n \”currTaskIdx\”: 0,\n \”addedOn\”: 0,\n \”tasks\”: [\n {\n \”state\”: \”string\”,\n \”type\”: \”string\”,\n \”currWorkItemIdx\”: 0,\n \”taskSeqNo\”: 0,\n \”endTime\”: 0,\n \”startTime\”: 0,\n \”workItemList\”: [\n {\n \”state\”: \”string\”,\n \”command\”: \”string\”,\n \”outputStr\”: \”string\”,\n \”endTime\”: 0,\n \”startTime\”: 0,\n \”timeTaken\”: 0\n }\n ],\n \”timeTaken\”: 0,\n \”name\”: \”string\”\n }\n ],\n \”addToInventory\”: true,\n \”instanceType\”: \”string\”,\n \”endTime\”: 0,\n \”execTime\”: 0,\n \”startTime\”: 0,\n \”useState\”: \”string\”,\n \”configId\”: \”string\”,\n \”name\”: \”string\”,\n \”version\”: 0,\n \”tenantId\”: \”string\”\n },\n \”runSummaryList\”: [\n {\n \”details\”: \”string\”,\n \”historyTaskInfo\”: {\n \”type\”: \”string\”,\n \”workItemList\”: [\n {\n \”state\”: \”string\”,\n \”command\”: \”string\”,\n \”outputStr\”: \”string\”,\n \”endTime\”: 0,\n \”startTime\”: 0,\n \”timeTaken\”: 0\n }\n ],\n \”timeTaken\”: 0,\n \”addnDetails\”: [\n {\n \”key\”: \”string\”,\n \”value\”: \”string\”\n }\n ],\n \”name\”: \”string\”\n },\n \”errorFlag\”: true,\n \”timestamp\”: 0\n }\n ],\n \”workflowParameters\”: {\n \”topOfStackSerialNumber\”: \”string\”,\n \”licenseLevel\”: \”string\”,\n \”licenseType\”: \”string\”,\n \”configList\”: [\n {\n \”configParameters\”: [\n {\n \”key\”: \”string\”,\n \”value\”: \”string\”\n }\n ],\n \”configId\”: \”string\”\n }\n ]\n },\n \”dayZeroConfig\”: {\n \”config\”: \”string\”\n },\n \”dayZeroConfigPreview\”: {},\n \”version\”: 0,\n \”tenantId\”: \”string\”\n}\n”

Authors

  • Rafael Campos (@racampos)