cisco.dnac.pnp_device_info 模块 – PnP 设备信息信息模块

注意

此模块是 cisco.dnac 集合 (版本 6.25.0) 的一部分。

如果您使用的是 ansible 包,则可能已经安装了此集合。它不包含在 ansible-core 中。要检查它是否已安装,请运行 ansible-galaxy collection list

要安装它,请使用:ansible-galaxy collection install cisco.dnac。您需要其他要求才能使用此模块,请参阅 要求 以了解详情。

要在 playbook 中使用它,请指定:cisco.dnac.pnp_device_info

cisco.dnac 3.1.0 中的新增功能

概要

  • 此模块表示模块 pnp_device_v1_info 的别名

注意

此模块具有相应的 操作插件

要求

执行此模块的主机需要以下要求。

  • dnacentersdk >= 2.4.9

  • python >= 3.5

参数

参数

注释

dnac_debug

布尔值

用于 Cisco DNA Center SDK 以启用调试。

选项

  • false ← (默认)

  • true

dnac_host

字符串 / 必需

Cisco DNA Center 主机名。

dnac_password

字符串

用于身份验证的 Cisco DNA Center 密码。

dnac_port

整数

Cisco DNA Center 端口。

默认: 443

dnac_username

别名:user

字符串

用于身份验证的 Cisco DNA Center 用户名。

默认: "admin"

dnac_verify

布尔值

启用或禁用 SSL 证书验证的标志。

选项

  • false

  • true ← (默认)

dnac_version

字符串

告知 SDK 使用哪个版本的 Cisco DNA Center。

默认: "2.3.7.6"

headers

字典

附加标头。

hostname

字符串

主机名查询参数。设备主机名。

id

字符串

Id 路径参数。

lastContact

布尔值

LastContact 查询参数。设备已联系 lastContact > 0。

选项

  • false

  • true

limit

整数

Limit 查询参数。限制结果数量。

macAddress

字符串

MacAddress 查询参数。设备 MAC 地址。

name

列表 / 元素=字符串

Name 查询参数。设备名称。

offset

整数

Offset 查询参数。第一个结果的索引。

onbState

列表 / 元素=字符串

OnbState 查询参数。设备入网状态。

pid

列表 / 元素=字符串

Pid 查询参数。设备产品 ID。

serialNumber

列表 / 元素=字符串

SerialNumber 查询参数。设备序列号。

siteName

字符串

SiteName 查询参数。设备站点名称。

smartAccountId

列表 / 元素=字符串

SmartAccountId 查询参数。设备智能帐户。

sort

列表 / 元素=字符串

Sort 查询参数。要排序的字段的逗号分隔列表。

sortOrder

字符串

SortOrder 查询参数。排序顺序升序 (asc) 或降序 (des)。

source

列表 / 元素=字符串

Source 查询参数。设备来源。

state_

列表 / 元素=字符串

State 查询参数。设备状态。

validate_response_schema

布尔值

用于 Cisco DNA Center SDK 的标志,用于启用根据 JSON 模式验证请求正文。

选项

  • false

  • true ← (默认)

virtualAccountId

列表 / 元素=字符串

VirtualAccountId 查询参数。设备虚拟帐户。

workflowId

列表 / 元素=字符串

WorkflowId 查询参数。设备工作流 ID。

workflowName

列表 / 元素=字符串

WorkflowName 查询参数。设备工作流名称。

备注

注意

  • 使用的 SDK 方法为 device_onboarding_pnp.DeviceOnboardingPnp.get_device_by_id_v1、device_onboarding_pnp.DeviceOnboardingPnp.get_device_list,

  • 使用的路径为 get /dna/intent/api/v1/onboarding/pnp-device、get /dna/intent/api/v1/onboarding/pnp-device/{id},

  • 需要注意的是,此模块是 pnp_device_v1_info 的别名

  • 支持 check_mode

  • 插件在控制节点上运行,不使用任何 Ansible 连接插件,而是使用 Cisco DNAC SDK 中的嵌入式连接管理器

  • 以 dnac_ 开头的参数由 Cisco DNAC Python SDK 用于建立连接

另请参见

另请参见

Cisco DNA Center 设备入网 (PnP) GetDeviceByIdV1 文档

GetDeviceByIdV1 API 的完整参考。

Cisco DNA Center 设备入网 (PnP) GetDeviceListSiteManagementV1 文档

GetDeviceListSiteManagementV1 API 的完整参考。

示例

- name: Get all Pnp Device Info
  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: []
    name: []
    pid: []
    source: []
    workflowId: []
    workflowName: []
    smartAccountId: []
    virtualAccountId: []
    lastContact: True
    macAddress: string
    hostname: string
    siteName: string
  register: result

- name: Get Pnp Device Info 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

返回值

常见的返回值已在此处记录 此处,以下是此模块独有的字段

描述

dnac_response

字典

包含 Cisco DNAC Python SDK 返回的响应的字典或列表

返回:始终

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

作者

  • Rafael Campos (@racampos)