cisco.catalystcenter.network_device_licenses_count_info module -- Information module for Network Device Licenses Count

Note

This module is part of the cisco.catalystcenter collection (version 2.12.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.network_device_licenses_count_info.

New in cisco.catalystcenter 2.11.0

Synopsis

  • Get all Network Device Licenses Count.

  • API to retrieve the number of network devices based on given filters.

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

authCodeStatus

string

AuthCodeStatus query parameter. Status of authorization code for network device. Smart Licensing authorization code enables the use of a HSEC license on the device. It is applicable for routers only. | Auth Code Status | Description | |------------------|--------------------------------------------------- --------------------------------------------| | `INSTALLED` | If authorization code is installed on the device, the status will be INSTALLED. | | `NOT_INSTALLED` | If authorization code is not installed, the status will be NOT_INSTALLED. | | `NA` | If authorization code is not applicable for the device, then the status will be NA. |.

authorizationStatus

string

AuthorizationStatus query parameter. Smart License authorization status | Authorization Status | Description | | ---------------------- | --------------------------------------------------------------- -------------------------------------------------------------------------------------------------------- ---------------------------------- | | `AUTHORIZED` | Registration has been completed with a valid Smart Account and license consumption has begun. The number of licenses consumed is less than the licenses available for use. This is an indication of being in compliance. | | `EVALUATION_MODE` | The network device is running in evaluation mode when it is not registered. | | `OUT_OF_COMPLIANCE` | The device's license consumption has exceeded the number of licenses that were purchased. The virtual account containing the product instance has a shortage of one or more of license types used. | | `EVALUATION_EXPIRED` | The evaluation period has expired and the device will be in unlicensed state. | | `AUTHORIZATION_EXPIRED` | The authorization has expired. | | `NOT_AUTHORIZED` | The authorization is not valid. | | `AUTHORIZED_RESERVED` | Registration of device has been completed using SLR/PLR with a valid Smart Account and license consumption has begun. The number of licenses consumed is less than the licenses available for use. This is an indication of being in compliance. | | `NA` | The authorization is not applicable for device. 'NA' can be seen for devices having RTU mode or device for which smart licensing using policy is applicable | | `UNKNOWN` | The authorization state is not known on the device. |.

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"`

family

string

Family query parameter. Product family of the network device. | Family | Description | |--------------|------------------------------------------| | `ROUTERS` | Router product family | | `SWITCHES_AND_HUBS` | Switches and Hubs product family | | `WIRELESS_CONTROLLER` | Wireless controller product family | | `UNIFIED_AP` | Unified Access Point product family |.

headers

dictionary

Additional headers.

id

string

Id query parameter. Unique ID of the license details of the network device.

licenseMode

string

LicenseMode query parameter. Mode of license on the device. | License Mode | Description | |--------------|------------------------------------------| | `SMART_LICENSE` | Smart License mode | | `RIGHT_TO_USE` | Right to use | | `UNKNOWN` | Mode of license on the device is not known. |.

licenseStatus

string

LicenseStatus query parameter. Status of license on the network device. | License Status | Description | |-------------------------|----------------------------------------------------------------------------- -----------------| | `IN_USE` | A license is actively being used by a Cisco device and is currently authorized for features it enables. | | `NOT_IN_USE` | A license is available on the device but is not currently being used by device. | | `EXPIRED_IN_USE` | A license has expired but the device continues to use its features. | | `EXPIRED_NOT_IN_USE` | A license has expired and its features are not currently being utilized on the device. | | `USAGE_COUNT_CONSUMED` | The allowed usage limit for the license has been fully utilized. It is only applicable for Cisco Nexus devices. | | `OUT_OF_COMPLIANCE` | A device is using features that require licenses it does not have assigned to it, potentially leading to functionality limitations. | | `EVALUATION_IN_USE` | A device is currently using a trial or evaluation license for its features. | | `INACTIVE` | A license is available on the device but is not currently being used by device. This license status is only applicable for virtual wireless controllers. |.

licenseType

string

LicenseType query parameter. Type of license available on the network device. | License Type | Description | |-------------------------|--------------------------------------------------------------- -------------------------------| | `NETWORK_ESSENTIALS` | Network Essentials license | | `NETWORK_ADVANTAGE` | Network Advantage license | | `AIR_NETWORK_ESSENTIALS` | Air Network Essentials license. It is applicable for wireless controllers or switches having wireless capability. | | `AIR_NETWORK_ADVANTAGE` | Air Network Advantage license. It is applicable for wireless controllers or switches having wireless capability. | | `DNA_ESSENTIALS` | DNA Essentials license | | `DNA_ADVANTAGE` | DNA Advantage license | | `AIR_DNA_ESSENTIALS` | Air DNA Essentials license. It is applicable for wireless controllers or switches having wireless capability. | | `AIR_DNA_ADVANTAGE` | Air DNA Advantage license. It is applicable for wireless controllers or switches having wireless capability | | `CNS_ESSENTIALS` | Cisco Networking Subscription Essentials license | | `CNS_ADVANTAGE` | Cisco Networking Subscription Advantage license |.

registrationStatus

string

RegistrationStatus query parameter. Smart License registration status | Registration status | Description | | ---------------------- | --------------------------------------------------------------- -------------------------------------------------------------------------------------------------------- ---------------------------------- | | `REGISTERED` | The network device instance is registered with CSSM.| | `UNREGISTERED` | Smart Licensing is enabled on the network device, but the network device is not registered with CSSM. | | `REGISTRATION_EXPIRED` | The registration has expired. | | `RESERVATION_IN_PROGRESS` | The license reservation is in progress on the network device. | | `REGISTERED_SLR` | The device has successfully completed the process of SLR and is now registered. | | `REGISTERED_PLR` | The device has successfully completed the process of PLR and is now registered. | | `REGISTERED_SATELLITE` | The device is successfully registered with a On Prem CSSM server for Smart Licensing. | | `NA` | The registration is not applicable for device. 'NA' can be seen for devices having RTU license mode or device for which smart licensing using policy is applicable. | | `UNKNOWN` | The registration state is not known on the device. |.

smartAccountId

string

SmartAccountId query parameter. Smart Account id where device is registered. Use `GET /dna/intent/api/v1/licenses/smartAccounts` intent API to find the smart account Id.

validate_response_schema

boolean

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

Choices:

virtualAccountId

string

VirtualAccountId query parameter. Virtual Account id where device is registered. Use `GET /dna/intent/api/v1/licenses/smartAccount/${id}/virtualAccounts` intent API to find the virtual account Id.

Notes

Note

  • SDK Method used are licenses.Licenses.retrieves_the_number_of_network_devices,

  • Paths used are get /dna/intent/api/v1/networkDeviceLicenses/count,

  • 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 Licenses RetrievesTheNumberOfNetworkDevices

Complete reference of the RetrievesTheNumberOfNetworkDevices API.

Examples

---
- name: Get all Network Device Licenses Count
  cisco.catalystcenter.network_device_licenses_count_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: e910e834-e35b-4800-9401-a40e22ce09f3
    family: ROUTERS
    licenseMode: SMART_LICENSE
    licenseType: string
    licenseStatus: string
    registrationStatus: UNREGISTERED
    authorizationStatus: AUTHORIZED
    authCodeStatus: string
    smartAccountId: 1034567234567
    virtualAccountId: 10345
  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": {"count": 0}, "version": "string"}`

Authors

  • Bryan Vargas (@bvargasre)