Debian Codegraph @

ansible_collections/cisco/meraki/plugins/modules/devices.py

raw
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
3
4 # Copyright (c) 2021, Cisco Systems
5 # GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
6
7 DOCUMENTATION = r"""
8 module: devices
9 short_description: Resource module for devices
10 description:
11 - Manage operation update of the resource devices.
12 - Update the attributes of a device.
13 version_added: '1.0.0'
14 extends_documentation_fragment:
15 - cisco.meraki.module
16 author: Francisco Munoz (@fmunoz)
17 options:
18 address:
19 description: The address of a device.
20 type: str
21 floorPlanId:
22 description: The floor plan to associate to this device. Null disassociates the
23 device from the floorplan.
24 type: str
25 lat:
26 description: The latitude of a device.
27 type: float
28 lng:
29 description: The longitude of a device.
30 type: float
31 moveMapMarker:
32 description: Whether or not to set the latitude and longitude of a device based
33 on the new address. Only applies when lat and lng are not specified.
34 type: bool
35 name:
36 description: The name of a device.
37 type: str
38 notes:
39 description: The notes for the device. String. Limited to 255 characters.
40 type: str
41 serial:
42 description: Serial path parameter.
43 type: str
44 switchProfileId:
45 description: The ID of a switch template to bind to the device (for available
46 switch templates, see the 'Switch Templates' endpoint). Use null to unbind the
47 switch device from the current profile. For a device to be bindable to a switch
48 template, it must (1) be a switch, and (2) belong to a network that is bound
49 to a configuration template.
50 type: str
51 tags:
52 description: The list of tags of a device.
53 elements: str
54 type: list
55 requirements:
56 - meraki >= 2.4.9
57 - python >= 3.5
58 seealso:
59 - name: Cisco Meraki documentation for devices updateDevice
60 description: Complete reference of the updateDevice API.
61 link: https://developer.cisco.com/meraki/api-v1/#!update-device
62 notes:
63 - SDK Method used are
64 devices.Devices.update_device,
65 - Paths used are
66 put /devices/{serial},
67 """
68
69 EXAMPLES = r"""
70 - name: Update by id
71 cisco.meraki.devices:
72 meraki_api_key: "{{ meraki_api_key }}"
73 meraki_base_url: "{{ meraki_base_url }}"
74 meraki_single_request_timeout: "{{ meraki_single_request_timeout }}"
75 meraki_certificate_path: "{{ meraki_certificate_path }}"
76 meraki_requests_proxy: "{{ meraki_requests_proxy }}"
77 meraki_wait_on_rate_limit: "{{ meraki_wait_on_rate_limit }}"
78 meraki_nginx_429_retry_wait_time: "{{ meraki_nginx_429_retry_wait_time }}"
79 meraki_action_batch_retry_wait_time: "{{ meraki_action_batch_retry_wait_time }}"
80 meraki_retry_4xx_error: "{{ meraki_retry_4xx_error }}"
81 meraki_retry_4xx_error_wait_time: "{{ meraki_retry_4xx_error_wait_time }}"
82 meraki_maximum_retries: "{{ meraki_maximum_retries }}"
83 meraki_output_log: "{{ meraki_output_log }}"
84 meraki_log_file_prefix: "{{ meraki_log_file_prefix }}"
85 meraki_log_path: "{{ meraki_log_path }}"
86 meraki_print_console: "{{ meraki_print_console }}"
87 meraki_suppress_logging: "{{ meraki_suppress_logging }}"
88 meraki_simulate: "{{ meraki_simulate }}"
89 meraki_be_geo_id: "{{ meraki_be_geo_id }}"
90 meraki_caller: "{{ meraki_caller }}"
91 meraki_use_iterator_for_get_pages: "{{ meraki_use_iterator_for_get_pages }}"
92 meraki_inherit_logging_config: "{{ meraki_inherit_logging_config }}"
93 state: present
94 address: 1600 Pennsylvania Ave
95 floorPlanId: g_2176982374
96 lat: 37.4180951010362
97 lng: -122.098531723022
98 moveMapMarker: true
99 name: My AP
100 notes: My AP's note
101 serial: string
102 switchProfileId: '1234'
103 tags:
104 - ' recently-added '
105 """
106 RETURN = r"""
107 meraki_response:
108 description: A dictionary or list with the response returned by the Cisco Meraki Python SDK
109 returned: always
110 type: dict
111 sample: >
112 {
113 "name": "string",
114 "lat": 0,
115 "lng": 0,
116 "address": "string",
117 "notes": "string",
118 "tags": [
119 "string"
120 ],
121 "networkId": "string",
122 "serial": "string",
123 "model": "string",
124 "mac": "string",
125 "lanIp": "string",
126 "firmware": "string",
127 "floorPlanId": "string",
128 "details": [
129 {
130 "name": "string",
131 "value": "string"
132 }
133 ],
134 "beaconIdParams": {
135 "uuid": "string",
136 "major": 0,
137 "minor": 0
138 }
139 }
140 """