cisco.dnac.tag – Manage Tag objects of Tag

Note

This plugin is part of the cisco.dnac collection (version 2.0.7).

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

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

New in version 1.0.0: of cisco.dnac

Synopsis

  • Returns the Tags for given filter criteria.

  • Creates Tag with specified Tag attributes.

  • Updates a Tag specified by id.

  • Deletes a Tag specified by id.

  • Returns Tag specified by Id.

  • Returns Tag count.

Note

This module has a corresponding action plugin.

Requirements

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

  • dnacentersdk

Parameters

Parameter Choices/Defaults Comments
additional_info_attributes
string
AdditionalInfo.attributes query parameter.
additional_info_name_space
string
AdditionalInfo.nameSpace query parameter.
attribute_name
string
AttributeName query parameter.
count
boolean
    Choices:
  • no
  • yes
If true gets the number of objects.
Required for state query.
description
string
TagDTO's description.
dynamicRules
list / elements=dictionary
TagDTO's dynamicRules (list of objects).
memberType
string
It is the Tag's memberType.
rules
dictionary
It is the Tag's rules.
items
list / elements=string
It is the Tag's items.
name
string
It is the Tag's name.
operation
string
It is the Tag's operation.
value
string
It is the Tag's value.
values
list / elements=string
It is the Tag's values.
field
string
Available field names are 'name,id,parentId,type,additionalInfo.nameSpace,additionalInfo.attributes'.
id
string
TagDTO's id.
Tag ID.
Required for states query and absent.
instanceTenantId
string
TagDTO's instanceTenantId.
level
string
Level query parameter.
limit
string
Limit query parameter.
name
string
Tag name is mandatory when filter operation is used.
TagDTO's name.
Name query parameter.
name_space
string
NameSpace query parameter.
offset
string
Offset query parameter.
order
string
Available values are asc and des.
size
string
Size in kilobytes(KB).
sort_by
string
Only supported attribute is name. SortyBy is mandatory when order is used.
system_tag
string
SystemTag query parameter.
systemTag
boolean
    Choices:
  • no
  • yes
TagDTO's systemTag.

See Also

See also

cisco.dnac.plugins.module_utils.definitions.tag

The official documentation on the cisco.dnac.plugins.module_utils.definitions.tag module.

Tag reference

Complete reference of the Tag object model.

Tag reference

SDK reference.

Examples

- name: get_tag
  cisco.dnac.tag:
    state: query  # required
    additional_info_attributes: SomeValue  # string
    additional_info_name_space: SomeValue  # string
    field: SomeValue  # string
    level: SomeValue  # string
    limit: SomeValue  # string
    name: SomeValue  # string
    offset: SomeValue  # string
    order: SomeValue  # string
    size: SomeValue  # string
    sort_by: SomeValue  # string
    system_tag: SomeValue  # string
  register: nm_get_tag

- name: create_tag
  cisco.dnac.tag:
    state: present  # required
    description: SomeValue  # string
    dynamicRules:
    - memberType: SomeValue  # string
      rules:
        values:
        - SomeValue  # string
        items: None
        operation: SomeValue  # string
        name: SomeValue  # string
        value: SomeValue  # string
    id: SomeValue  # string
    instanceTenantId: SomeValue  # string
    name: SomeValue  # string
    systemTag: True  # boolean

- name: update_tag
  cisco.dnac.tag:
    state: present  # required
    description: SomeValue  # string
    dynamicRules:
    - memberType: SomeValue  # string
      rules:
        values:
        - SomeValue  # string
        items: None
        operation: SomeValue  # string
        name: SomeValue  # string
        value: SomeValue  # string
    id: SomeValue  # string
    instanceTenantId: SomeValue  # string
    name: SomeValue  # string
    systemTag: True  # boolean

- name: delete_tag
  cisco.dnac.tag:
    state: absent  # required
    id: SomeValue  # string, required

- name: get_tag_by_id
  cisco.dnac.tag:
    state: query  # required
    id: SomeValue  # string, required
  register: nm_get_tag_by_id

- name: get_tag_count
  cisco.dnac.tag:
    state: query  # required
    count: True  # boolean, required
    attribute_name: SomeValue  # string
    level: SomeValue  # string
    name: SomeValue  # string
    name_space: SomeValue  # string
    size: SomeValue  # string
    system_tag: SomeValue  # string
  register: nm_get_tag_count

Return Values

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

Key Returned Description
dnac_response
dictionary
always
A dictionary with the response returned by the DNA Center Python SDK

Sample:
{'response': 29, 'version': '1.0'}
missing_params
list / elements=string
when the function request schema is not satisfied
Provided arguments do not comply with the schema of the DNA Center Python SDK function

sdk_function
string
always
The DNA Center SDK function used to execute the task

Sample:
tag.create_tag


Authors

  • Rafael Campos (@racampos)