cisco.dnac.site – Manage Site objects of Sites

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.site.

New in version 1.0.0: of cisco.dnac

Synopsis

  • Get Site with area/building/floor with specified hierarchy.

  • Creates Site with area/building/floor with specified hierarchy.

  • Delete Site with area/building/floor by SiteId.

  • Update Site area/building/floor with specified hierarchy and new values.

  • API to get Site 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
count
boolean
    Choices:
  • no
  • yes
If true gets the number of objects.
Required for state query.
limit
string
Number of Sites to be retrieved.
name
string
SiteNameHierarchy (ex global/groupName).
offset
string
Offset/starting row.
site
dictionary / required
Site, property of the request body.
area
dictionary
It is the Site's area.
name
string
It is the Site's name.
parentName
string
It is the Site's parentName.
building
dictionary
It is the Site's building.
address
string
It is the Site's address.
latitude
integer
It is the Site's latitude.
longitude
integer
It is the Site's longitude.
name
string
It is the Site's name.
parentName
string
It is the Site's parentName.
floor
dictionary
It is the Site's floor.
height
integer
It is the Site's height.
length
integer
It is the Site's length.
name
string
It is the Site's name.
parentName
string
It is the Site's parentName.
rfModel
string
It is the Site's rfModel.
width
integer
It is the Site's width.
site_id
string
Site id to which Site details to retrieve.
Site id to which Site details to be deleted.
Site id to which Site details to be updated.
Site id to retrieve Site count.
Required for states present and absent.
type
string
Type (ex area, building, floor).
Type, property of the request body.
Required for state present.

See Also

See also

cisco.dnac.plugins.module_utils.definitions.site

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

Site reference

Complete reference of the Site object model.

Site reference

SDK reference.

Examples

- name: get_site
  cisco.dnac.site:
    state: query  # required
    limit: SomeValue  # string
    name: SomeValue  # string
    offset: SomeValue  # string
    site_id: SomeValue  # string
    type: SomeValue  # string
  register: nm_get_site

- name: create_site
  cisco.dnac.site:
    state: present  # required
    site:  # required
      area:
        name: SomeValue  # string
        parentName: SomeValue  # string
      building:
        name: SomeValue  # string
        address: SomeValue  # string
        parentName: SomeValue  # string
        latitude: 1  #  number
        longitude: 1  #  number
      floor:
        name: SomeValue  # string
        parentName: SomeValue  # string
        rfModel: SomeValue  # string
        width: 1  #  number
        length: 1  #  number
        height: 1  #  number
    type: # valid values are 'area',
      # 'building',
      # 'floor'.
      SomeValue  # string, required

- name: delete_site
  cisco.dnac.site:
    state: absent  # required
    site_id: SomeValue  # string, required

- name: update_site
  cisco.dnac.site:
    state: present  # required
    site_id: SomeValue  # string, required
    site:  # required
      area:
        name: SomeValue  # string
        parentName: SomeValue  # string
      building:
        name: SomeValue  # string
        address: SomeValue  # string
        parentName: SomeValue  # string
        latitude: 1  #  number
        longitude: 1  #  number
      floor:
        name: SomeValue  # string
        rfModel: SomeValue  # string
        width: 1  #  number
        length: 1  #  number
        height: 1  #  number
    type: # valid values are 'area',
      # 'building',
      # 'floor'.
      SomeValue  # string, required

- name: get_site_count
  cisco.dnac.site:
    state: query  # required
    count: True  # boolean, required
    site_id: SomeValue  # string
  register: nm_get_site_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:
sites.create_site


Authors

  • Rafael Campos (@racampos)